-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reduces duplicate code by creating a "DetailsModal" component for e.g. event details or user details. Functionality should be unchanged, but there may be some slight CSS changes.
- Loading branch information
Showing
16 changed files
with
119 additions
and
360 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
43 changes: 0 additions & 43 deletions
43
src/components/configuration/partials/wizard/ThemeDetailsModal.tsx
This file was deleted.
Oops, something went wrong.
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
57 changes: 0 additions & 57 deletions
57
src/components/recordings/partials/modal/RecordingDetailsModal.tsx
This file was deleted.
Oops, something went wrong.
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,48 @@ | ||
import React, { PropsWithChildren } from "react"; | ||
import { useTranslation } from "react-i18next"; | ||
import { useHotkeys } from "react-hotkeys-hook"; | ||
import { availableHotkeys } from "../../../configs/hotkeysConfig"; | ||
|
||
/** | ||
* This component renders the modal for displaying series details | ||
*/ | ||
const DetailsModal = ({ | ||
handleClose, | ||
prefix, | ||
title, | ||
children | ||
}: PropsWithChildren<{ | ||
handleClose: () => void | ||
prefix: string | ||
title: string | ||
}>) => { | ||
const { t } = useTranslation(); | ||
|
||
const close = () => { | ||
handleClose(); | ||
}; | ||
|
||
useHotkeys( | ||
availableHotkeys.general.CLOSE_MODAL.sequence, | ||
() => close(), | ||
{ description: t(availableHotkeys.general.CLOSE_MODAL.description) ?? undefined }, | ||
[close], | ||
); | ||
|
||
return ( | ||
<> | ||
<div className="modal-animation modal-overlay" /> | ||
<section className="modal wizard modal-animation" id="details-modal"> | ||
<header> | ||
<button className="button-like-anchor fa fa-times close-modal" onClick={() => close()} /> | ||
<h2> | ||
{t(prefix, { name: title })} | ||
</h2> | ||
</header> | ||
{children} | ||
</section> | ||
</> | ||
); | ||
}; | ||
|
||
export default DetailsModal; |
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.