-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
183ebfb
commit 1b5faba
Showing
10 changed files
with
175 additions
and
4,309 deletions.
There are no files selected for viewing
This file contains 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,35 @@ | ||
import { deployment_state } from '@prisma/client' | ||
import Button from 'components/Button' | ||
import Spinner from 'components/Spinner' | ||
import { capitalize } from 'utils/capitalize' | ||
|
||
export interface Props { | ||
deploy: () => void | ||
deployStatus?: deployment_state | null | ||
} | ||
|
||
function isInProgress(deployStaus?: deployment_state | null) { | ||
switch (deployStaus) { | ||
case null: | ||
case deployment_state.generating: | ||
case deployment_state.deploying: | ||
return true | ||
default: | ||
return false | ||
} | ||
} | ||
|
||
function DeployButton({ deploy, deployStatus }: Props) { | ||
const inProgress = isInProgress() | ||
|
||
return ( | ||
<Button | ||
text={deployStatus ? capitalize(deployStatus) : 'Deploy'} | ||
onClick={deploy} | ||
variant={Button.variant.Full} | ||
icon={inProgress ? <Spinner /> : null} | ||
/> | ||
) | ||
} | ||
|
||
export default DeployButton |
This file contains 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
This file contains 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
This file contains 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
This file contains 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 type Log = string |
This file contains 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
This file contains 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
This file contains 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
This file contains 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,3 @@ | ||
export function capitalize(str: string) { | ||
return str.charAt(0).toUpperCase() + str.slice(1); | ||
} |
Oops, something went wrong.