-
Notifications
You must be signed in to change notification settings - Fork 2.4k
🔨 Refactor Deployment to use hooks #1969
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
CompuIves
merged 20 commits into
codesandbox:master
from
MichaelDeBoey:refactor-deployment
Jul 16, 2019
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
2b6dec9
🔨 Refactor Deployment Workspace to use hooks
Saeris 2113591
Resolve discussions
MichaelDeBoey 1c68397
Fix TypeScript errors
MichaelDeBoey 550720b
Move Netlify & Zeit components into it's own folder
MichaelDeBoey c681687
Extract DeployButton
MichaelDeBoey e703377
Extract SiteInfo
MichaelDeBoey 298459a
Extract ViewLogsButton
MichaelDeBoey f9a22dd
Extract Actions
MichaelDeBoey eba701b
Extract Functions
MichaelDeBoey 6465c73
Extract DeployButton
MichaelDeBoey 6a3c673
Extract Deploys
MichaelDeBoey 069a553
Extract Actions
MichaelDeBoey ee9bd81
Extract Alias
MichaelDeBoey 163835b
Cleanup Zeit
MichaelDeBoey a463a54
Reactor DeploymentIntegration
MichaelDeBoey 6936d0b
Fix build
MichaelDeBoey 05a9217
Fix Netlify build
MichaelDeBoey 71db461
Add observer
CompuIves fa34dff
Fix styling of button
CompuIves da0bd1e
Make deployment button call without event
CompuIves File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
48 changes: 48 additions & 0 deletions
48
packages/app/src/app/components/DeploymentIntegration/DeploymentIntegration.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| import React from 'react'; | ||
|
|
||
| import { DetailInfo } from './DetailInfo'; | ||
| import { | ||
| Container, | ||
| Down, | ||
| IntegrationBlock, | ||
| Name, | ||
| Notice, | ||
| Up, | ||
| } from './elements'; | ||
|
|
||
| export const DeploymentIntegration = ({ | ||
| beta = false, | ||
| children, | ||
| color, | ||
| deploy, | ||
| Icon, | ||
| light = false, | ||
| loading = false, | ||
| name, | ||
| open = true, | ||
| toggle, | ||
| }) => ( | ||
| <Container> | ||
| <IntegrationBlock bgColor={color} onClick={toggle}> | ||
| <div> | ||
| <Icon /> | ||
|
|
||
| <Name light={light}>{name}</Name> | ||
|
|
||
| {beta && <Notice>Beta</Notice>} | ||
| </div> | ||
|
|
||
| {open ? <Up light={light} /> : <Down light={light} />} | ||
| </IntegrationBlock> | ||
|
|
||
| {open ? ( | ||
| <DetailInfo | ||
| bgColor={color} | ||
| deploy={deploy} | ||
| info={children} | ||
| light={light} | ||
| loading={loading} | ||
| /> | ||
| ) : null} | ||
| </Container> | ||
| ); |
17 changes: 17 additions & 0 deletions
17
packages/app/src/app/components/DeploymentIntegration/DetailInfo/DetailInfo.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| import Margin from '@codesandbox/common/lib/components/spacing/Margin'; | ||
| import { Button } from '@codesandbox/common/lib/components/Button'; | ||
| import React from 'react'; | ||
|
|
||
| import { Details, Info } from './elements'; | ||
|
|
||
| export const DetailInfo = ({ info, deploy, bgColor, light, loading }) => ( | ||
| <Details bgColor={bgColor}> | ||
| <Margin right={2}> | ||
| <Info light={light}>{info}</Info> | ||
| </Margin> | ||
|
|
||
| <Button small disabled={loading} onClick={() => deploy()}> | ||
| Deploy | ||
| </Button> | ||
| </Details> | ||
| ); | ||
22 changes: 0 additions & 22 deletions
22
packages/app/src/app/components/DeploymentIntegration/DetailInfo/elements.js
This file was deleted.
Oops, something went wrong.
28 changes: 28 additions & 0 deletions
28
packages/app/src/app/components/DeploymentIntegration/DetailInfo/elements.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| import styled, { css } from 'styled-components'; | ||
|
|
||
| export const Details = styled.div<{ bgColor: string }>` | ||
| ${({ bgColor }) => css` | ||
| display: inline-flex; | ||
| justify-content: space-between; | ||
| align-items: center; | ||
| flex: 3; | ||
| padding: 0.75rem 1rem; | ||
| background-color: ${bgColor}; | ||
| margin-top: -1px; | ||
| `} | ||
| `; | ||
|
|
||
| export const Heading = styled.div<{ light: boolean }>` | ||
| ${({ light }) => css` | ||
| color: ${light ? '#000000' : '#ffffff'}; | ||
| font-size: 0.75rem; | ||
| margin-bottom: 0.25rem; | ||
| `} | ||
| `; | ||
|
|
||
| export const Info = styled.div<{ light: boolean }>` | ||
| ${({ light }) => css` | ||
| color: ${light ? '#000000' : '#ffffff'}; | ||
| font-weight: 400; | ||
| `} | ||
| `; |
20 changes: 0 additions & 20 deletions
20
packages/app/src/app/components/DeploymentIntegration/DetailInfo/index.js
This file was deleted.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
packages/app/src/app/components/DeploymentIntegration/DetailInfo/index.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export { DetailInfo } from './DetailInfo'; |
45 changes: 0 additions & 45 deletions
45
packages/app/src/app/components/DeploymentIntegration/elements.js
This file was deleted.
Oops, something went wrong.
68 changes: 68 additions & 0 deletions
68
packages/app/src/app/components/DeploymentIntegration/elements.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| import BaseNotice from '@codesandbox/common/lib/components/Notice'; | ||
| import BaseDown from 'react-icons/lib/fa/angle-down'; | ||
| import BaseUp from 'react-icons/lib/fa/angle-up'; | ||
| import styled, { css } from 'styled-components'; | ||
|
|
||
| export const Container = styled.div` | ||
| ${({ theme }) => css` | ||
| display: inline-flex; | ||
| border-radius: 4px; | ||
| overflow: hidden; | ||
| width: 100%; | ||
| flex-direction: column; | ||
| font-size: 0.875rem; | ||
|
|
||
| color: ${theme.light ? '#000000' : '#ffffff'}; | ||
| `} | ||
| `; | ||
|
|
||
| export const Down = styled(BaseDown)<{ light: boolean }>` | ||
| ${({ light }) => css` | ||
| fill: ${light ? '#000000' : '#ffffff'}; | ||
| cursor: pointer; | ||
| width: 1.5rem; | ||
| height: auto; | ||
| `} | ||
| `; | ||
|
|
||
| export const IntegrationBlock = styled.div<{ bgColor: string }>` | ||
| ${({ bgColor }) => css` | ||
| display: inline-flex; | ||
| align-items: center; | ||
| cursor: pointer; | ||
| box-sizing: border-box; | ||
| background-color: ${bgColor}; | ||
| flex: 1; | ||
| color: white; | ||
| padding: 0.75em 0.75em; | ||
| min-height: 45px; | ||
| font-size: 1em; | ||
| justify-content: space-between; | ||
|
|
||
| > div { | ||
| display: flex; | ||
| align-items: center; | ||
| } | ||
| `} | ||
| `; | ||
|
|
||
| export const Name = styled.span<{ light: boolean }>` | ||
| ${({ light }) => css` | ||
| margin-left: 0.75em; | ||
| font-size: 1.375em; | ||
| color: ${light ? '#000000' : '#ffffff'}; | ||
| `} | ||
| `; | ||
|
|
||
| export const Notice = styled(BaseNotice)` | ||
| margin-left: 0.7rem; | ||
| `; | ||
|
|
||
| export const Up = styled(BaseUp)<{ light: boolean }>` | ||
| ${({ light }) => css` | ||
| fill: ${light ? '#000000' : '#ffffff'}; | ||
| cursor: pointer; | ||
| width: 1.5rem; | ||
| height: auto; | ||
| `} | ||
| `; |
67 changes: 0 additions & 67 deletions
67
packages/app/src/app/components/DeploymentIntegration/index.js
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export { DeploymentIntegration } from './DeploymentIntegration'; |
11 changes: 8 additions & 3 deletions
11
packages/app/src/app/pages/Sandbox/Editor/Workspace/index.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.