-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Quentin Guidée <[email protected]>
- Loading branch information
1 parent
c21f013
commit ce5d345
Showing
15 changed files
with
259 additions
and
313 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
52 changes: 52 additions & 0 deletions
52
client/src/apps/Containers/components/ContainerInstalledPopup/ContainerInstalledPopup.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,52 @@ | ||
import Popup, { PopupActions } from "../../../../components/Popup/Popup"; | ||
import { Container } from "../../backend/models"; | ||
import { Button, Horizontal } from "@vertex-center/components"; | ||
import styles from "../../../../components/TemplateInstallPopup/TemplateInstallPopup.module.sass"; | ||
import Spacer from "../../../../components/Spacer/Spacer"; | ||
import { CaretRight, CheckCircle } from "@phosphor-icons/react"; | ||
import { useNavigate } from "react-router-dom"; | ||
import TemplateImage from "../TemplateImage/TemplateImage"; | ||
|
||
type Props = { | ||
container: Container; | ||
onDismiss: () => void; | ||
}; | ||
|
||
export default function ContainerInstalledPopup(props: Readonly<Props>) { | ||
const { container, onDismiss } = props; | ||
const navigate = useNavigate(); | ||
|
||
if (!container) return null; | ||
|
||
const open = () => navigate(`/containers/${container.id}/logs`); | ||
|
||
const image = ( | ||
<TemplateImage icon={container.icon} color={container.color} /> | ||
); | ||
|
||
return ( | ||
<Popup title={container?.name} onDismiss={onDismiss} image={image}> | ||
<PopupActions> | ||
<Horizontal | ||
gap={8} | ||
alignItems="center" | ||
className={styles.installed} | ||
> | ||
<CheckCircle /> | ||
Installed successfully | ||
</Horizontal> | ||
<Spacer /> | ||
<Button onClick={onDismiss} variant="outlined"> | ||
Close | ||
</Button> | ||
<Button | ||
variant="colored" | ||
onClick={open} | ||
rightIcon={<CaretRight />} | ||
> | ||
Open | ||
</Button> | ||
</PopupActions> | ||
</Popup> | ||
); | ||
} |
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
5 changes: 5 additions & 0 deletions
5
client/src/apps/Containers/components/TemplateImage/TemplateImage.module.sass
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,5 @@ | ||
.logo | ||
position: relative | ||
width: 100% | ||
padding: 48px | ||
box-sizing: border-box |
19 changes: 19 additions & 0 deletions
19
client/src/apps/Containers/components/TemplateImage/TemplateImage.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,19 @@ | ||
import ServiceLogo from "../../../../components/ServiceLogo/ServiceLogo"; | ||
import styles from "./TemplateImage.module.sass"; | ||
|
||
type Props = { | ||
icon: string; | ||
color: string; | ||
}; | ||
|
||
export default function TemplateImage(props: Readonly<Props>) { | ||
const { icon, color } = props; | ||
|
||
const backgroundColor = `${color ?? "#000000"}08`; | ||
|
||
return ( | ||
<div className={styles.logo} style={{ backgroundColor }}> | ||
<ServiceLogo icon={icon} color={color} /> | ||
</div> | ||
); | ||
} |
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.