-
-
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.
Enable hearing/seeing speaker consent
- Loading branch information
1 parent
4d678cd
commit e581134
Showing
22 changed files
with
425 additions
and
148 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { Close } from "@mui/icons-material"; | ||
import { IconButton } from "@mui/material"; | ||
import { CSSProperties, ReactElement } from "react"; | ||
|
||
interface CloseButtonProps { | ||
close: () => void; | ||
} | ||
|
||
export default function CloseButton(props: CloseButtonProps): ReactElement { | ||
const closeButtonStyle: CSSProperties = { | ||
position: "absolute", | ||
top: 0, | ||
...(document.body.dir === "rtl" ? { left: 0 } : { right: 0 }), | ||
}; | ||
|
||
return ( | ||
<IconButton | ||
aria-label="close" | ||
onClick={props.close} | ||
style={closeButtonStyle} | ||
> | ||
<Close /> | ||
</IconButton> | ||
); | ||
} |
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,45 @@ | ||
import { Delete } from "@mui/icons-material"; | ||
import { ReactElement, useState } from "react"; | ||
|
||
import { IconButtonWithTooltip } from "components/Buttons"; | ||
import { CancelConfirmDialog } from "components/Dialogs"; | ||
|
||
interface DeleteButtonWithDialogProps { | ||
buttonId: string; | ||
buttonIdCancel?: string; | ||
buttonIdConfirm?: string; | ||
delete: () => void | Promise<void>; | ||
disabled?: boolean; | ||
textId: string; | ||
tooltipTextId?: string; | ||
} | ||
|
||
export default function DeleteButtonWithDialog( | ||
props: DeleteButtonWithDialogProps | ||
): ReactElement { | ||
const [open, setOpen] = useState(false); | ||
|
||
const handleConfirm = async (): Promise<void> => { | ||
await props.delete(); | ||
setOpen(false); | ||
}; | ||
|
||
return ( | ||
<> | ||
<IconButtonWithTooltip | ||
buttonId={props.buttonId} | ||
icon={<Delete />} | ||
onClick={props.disabled ? undefined : () => setOpen(true)} | ||
textId={props.tooltipTextId || props.textId} | ||
/> | ||
<CancelConfirmDialog | ||
buttonIdCancel={props.buttonIdCancel} | ||
buttonIdConfirm={props.buttonIdConfirm} | ||
handleCancel={() => setOpen(false)} | ||
handleConfirm={handleConfirm} | ||
open={open} | ||
textId={props.textId} | ||
/> | ||
</> | ||
); | ||
} |
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
Oops, something went wrong.