-
Notifications
You must be signed in to change notification settings - Fork 239
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
06ceabc
commit 1b0e2dc
Showing
8 changed files
with
161 additions
and
51 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
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
63 changes: 63 additions & 0 deletions
63
dashboard/src/main/home/app-dashboard/app-view/ConfirmRedeployModal.tsx
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,63 @@ | ||
import Button from "components/porter/Button"; | ||
import Modal from "components/porter/Modal"; | ||
import Spacer from "components/porter/Spacer"; | ||
import Text from "components/porter/Text"; | ||
import { PorterAppFormData } from "lib/porter-apps"; | ||
import React, { Dispatch, SetStateAction } from "react"; | ||
import { useFormContext } from "react-hook-form"; | ||
import styled from "styled-components"; | ||
|
||
type Props = { | ||
cancelRedeploy: () => void; | ||
setOpen: Dispatch<SetStateAction<boolean>>; | ||
finalizeDeploy: () => void; | ||
}; | ||
|
||
const ConfirmRedeployModal: React.FC<Props> = ({ | ||
cancelRedeploy, | ||
setOpen, | ||
finalizeDeploy, | ||
}) => { | ||
const { setValue } = useFormContext<PorterAppFormData>(); | ||
|
||
return ( | ||
<Modal closeModal={() => setOpen(false)}> | ||
<Text size={16}>Confirm deploy</Text> | ||
<Spacer y={0.5} /> | ||
<Text color="helper"> | ||
A change to your application's build settings has been detected. | ||
Confirming this change will trigger a rerun of your application's CI | ||
pipeline. | ||
</Text> | ||
<Spacer y={0.5} /> | ||
|
||
<ButtonContainer> | ||
<Button | ||
onClick={() => { | ||
cancelRedeploy(); | ||
setOpen(false); | ||
}} | ||
color="#b91133" | ||
> | ||
Cancel | ||
</Button> | ||
<Button | ||
onClick={() => { | ||
setValue("redeployOnSave", true); | ||
finalizeDeploy(); | ||
}} | ||
> | ||
Continue | ||
</Button> | ||
</ButtonContainer> | ||
</Modal> | ||
); | ||
}; | ||
|
||
export default ConfirmRedeployModal; | ||
|
||
const ButtonContainer = styled.div` | ||
display: flex; | ||
justify-content: flex-end; | ||
column-gap: 0.5rem; | ||
`; |
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
Oops, something went wrong.