-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #702 from dotkom/feature/confirm-modal-on-unattend…
…-event Add confirm modal on unattend event
- Loading branch information
Showing
4 changed files
with
78 additions
and
2 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,30 @@ | ||
import { Modal, Button } from '@dotkomonline/design-system'; | ||
import { FC } from 'react'; | ||
import style from './modal.less'; | ||
|
||
interface ConfirmModalProps { | ||
title?: string; | ||
message?: string; | ||
open: boolean; | ||
onClose: (retValue: boolean) => void; | ||
} | ||
|
||
export const ConfirmModal: FC<ConfirmModalProps> = ({ | ||
title = 'Er du sikker?', | ||
message = 'Er du sikker på at du ønsker å gjøre dette?', | ||
onClose, | ||
open, | ||
}) => { | ||
return ( | ||
<Modal open={open} onClose={() => onClose(false)}> | ||
<h1 className={style.title}>{title}</h1> | ||
<p className={style.message}>{message}</p> | ||
<div className={style.buttonContainer}> | ||
<Button onClick={() => onClose(true)}>Ja</Button> | ||
<Button variant="outline" onClick={() => onClose(false)}> | ||
Nei | ||
</Button> | ||
</div> | ||
</Modal> | ||
); | ||
}; |
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 { ConfirmModal } from './ConfirmModal'; |
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,25 @@ | ||
.title { | ||
font-size: 1.2rem; | ||
font-weight: bold; | ||
margin-bottom: 0.5rem; | ||
|
||
} | ||
|
||
.message { | ||
font-size: 1.1rem; | ||
} | ||
|
||
.buttonContainer { | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: center; | ||
align-items: flex-end; | ||
width: 100%; | ||
gap: 0.5rem; | ||
margin-top: 0.5rem; | ||
|
||
& > button { | ||
padding: 0.5rem 1.4rem; | ||
min-width: 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
a4808ae
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
onlineweb-frontend – ./
onlineweb-frontend-git-master-dotkom.vercel.app
onlineweb-frontend.vercel.app
onlineweb-frontend-dotkom.vercel.app
online.ntnu.no