-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
00fa1be
commit f44ab46
Showing
4 changed files
with
86 additions
and
37 deletions.
There are no files selected for viewing
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,42 @@ | ||
import {useTranslation} from "react-i18next"; | ||
import Backdrop from "@mui/material/Backdrop"; | ||
import {CardContent, Fade, Grid, Modal, Paper, Typography} from "@mui/material"; | ||
import Box from "@mui/material/Box"; | ||
import {NavLink} from "react-router-dom"; | ||
import React, {useState} from "react"; | ||
|
||
|
||
export const DeleteModal = ({open, setOpen}) => { | ||
const { t } = useTranslation(); | ||
|
||
return( | ||
<> | ||
<Modal open={open} | ||
onClose={()=>{setOpen(false)}} | ||
closeAfterTransition | ||
BackdropComponent={Backdrop} | ||
BackdropProps={{ | ||
timeout: 500, | ||
}}> | ||
<Fade in={open}> | ||
<Box sx={{ | ||
position: 'absolute', | ||
top: '50%', | ||
left: '50%', | ||
transform: 'translate(-50%, -50%)', | ||
width: 400, | ||
bgcolor: 'background.paper', | ||
border: '2px solid', | ||
boxShadow: 24, | ||
p: 4, | ||
maxHeight: "70vh", | ||
overflow: "auto", | ||
minWidth: "60vw" | ||
}}> | ||
<Typography>löschen</Typography> | ||
</Box> | ||
</Fade> | ||
</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,43 @@ | ||
import React, {useState} from 'react'; | ||
import SpeedDial from '@mui/material/SpeedDial'; | ||
import SpeedDialAction from '@mui/material/SpeedDialAction'; | ||
import {useTranslation} from "react-i18next"; | ||
import {ContentCopy, ContentPaste, Delete, Edit} from "@mui/icons-material"; | ||
import {SpeedDialIcon} from "@mui/material"; | ||
import {DeleteModal} from "./Delete"; | ||
|
||
|
||
const ForumActionSD = () => { | ||
const { t } = useTranslation(); | ||
|
||
const [deleteOpen, setDeleteOpen] = useState(false); | ||
|
||
const actions = [ | ||
{ icon: <ContentPaste />, name: t("PASTE") }, | ||
{ icon: <ContentCopy />, name: t("CUT") }, | ||
{ icon: <Delete />, name: t("DELETE"), action: ()=>setDeleteOpen(true) }, | ||
{ icon: <Edit />, name: t("EDIT") }, | ||
]; | ||
|
||
return ( | ||
<> | ||
<DeleteModal open={deleteOpen} setOpen={setDeleteOpen} /> | ||
<SpeedDial | ||
sx={{ position: 'fixed', bottom: 16, right: 16 }} | ||
icon={<SpeedDialIcon />} | ||
ariaLabel={"forum-actions"}> | ||
{actions.map((action) => ( | ||
<SpeedDialAction | ||
key={action.name} | ||
icon={action.icon} | ||
tooltipTitle={action.name} | ||
onClick={action.action} | ||
/> | ||
))} | ||
</SpeedDial> | ||
</> | ||
|
||
); | ||
} | ||
|
||
export default ForumActionSD; |
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