-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added admin confirmation popup and fixed server page styling (#60)
- Loading branch information
Showing
11 changed files
with
135 additions
and
43 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
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
50 changes: 50 additions & 0 deletions
50
src/dashboard/src/components/confirmPopup/ConfirmPopup.module.scss
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,50 @@ | ||
@import '@/styles/utils.scss'; | ||
|
||
.popupConfirm { | ||
width: 100%; | ||
max-width: 450px; | ||
min-height: 170px; | ||
border: 0; | ||
border-radius: 10px; | ||
@include dropshadow; | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: space-between; | ||
align-items: center; | ||
z-index: 1; | ||
position: fixed; | ||
} | ||
|
||
.popupTitle { | ||
font-weight: bold; | ||
text-align: center; | ||
font-size: $font-size-20; | ||
} | ||
|
||
.popupContent { | ||
text-align: center; | ||
line-height: 1.8; | ||
} | ||
|
||
.popupFooter { | ||
display: flex; | ||
justify-content: center; | ||
gap: 1rem; | ||
|
||
button { | ||
width: 200px; | ||
padding: 8px; | ||
} | ||
} | ||
|
||
.backdrop { | ||
content: ''; | ||
height: 100vh; | ||
width: 100vw; | ||
position: fixed; | ||
top: 0; | ||
left: 0; | ||
background-color: $bc-black; | ||
opacity: 0.4; | ||
z-index: 1; | ||
} |
24 changes: 24 additions & 0 deletions
24
src/dashboard/src/components/confirmPopup/ConfirmPopup.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,24 @@ | ||
import styles from './ConfirmPopup.module.scss'; | ||
import { Button } from '@/components/buttons'; | ||
|
||
export interface PopupProps { | ||
onCancel: () => void; | ||
onConfirm: () => void; | ||
} | ||
|
||
export const ConfirmPopup: React.FC<PopupProps> = ({ onCancel, onConfirm }) => { | ||
return ( | ||
<> | ||
<span className={styles.backdrop}></span> | ||
<dialog className={styles.popupConfirm}> | ||
<p className={styles.popupTitle}>Confirm Navigation</p> | ||
<p className={styles.popupContent}>You have unsaved changes.<br/>Are you sure you want to navigate away?</p> | ||
<div className={styles.popupFooter}> | ||
<Button variant="secondary" onClick={onConfirm}>Leave this page</Button> | ||
<Button onClick={onCancel}>Stay on this page</Button> | ||
</div> | ||
</dialog> | ||
</> | ||
) | ||
}; | ||
|
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 * from './ConfirmPopup'; |
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