diff --git a/src/components/FormDialog/index.js b/src/components/FormDialog/index.js new file mode 100644 index 0000000..0b8ca30 --- /dev/null +++ b/src/components/FormDialog/index.js @@ -0,0 +1,33 @@ +import { + Button, + Dialog, + DialogActions, + DialogContent, + DialogContentText, + DialogTitle, +} from '@mui/material'; + +function FormDialog({ + isOpened, + title, + contentText, + inputs, + onDismiss, + onSave, +}) { + return ( + + {title} + + {contentText} + {[...inputs]} + + + + + + + ); +} + +export default FormDialog; diff --git a/src/screens/professor/Classroom/AnnouncementsTab/index.js b/src/screens/professor/Classroom/AnnouncementsTab/index.js index c5af40b..74fbe3b 100644 --- a/src/screens/professor/Classroom/AnnouncementsTab/index.js +++ b/src/screens/professor/Classroom/AnnouncementsTab/index.js @@ -6,27 +6,50 @@ import { Grid, IconButton, Link, + Menu, + MenuItem, Skeleton, Stack, + TextField, + Tooltip, Typography, } from '@mui/material'; import MoreVertIcon from '@mui/icons-material/MoreVert'; import AnnouncementCard from '../../../../components/AnnouncementCard'; +import PublishAnnouncementCard from '../../../../components/PublishAnnouncementCard'; +import FormDialog from '../../../../components/FormDialog'; import styles from './styles'; import jitsiLogo from '../../../../assets/jitsi.svg'; import { createArrayFrom1ToN } from '../../../../utils/createArrayFrom1ToN'; -import PublishAnnouncementCard from '../../../../components/PublishAnnouncementCard'; function AnnouncementsTab({ layoutType, announcementsTabData, classroom, + onChangeEditInput, + onSaveEditChanges, user, }) { + const [anchorEl, setAnchorEl] = useState({ + virtualRoom: null, + appointmentSlots: null, + }); + const [dialogOpened, setDialogOpened] = useState(null); const [composingTextValue, setComposingTextValue] = useState(''); const { container, emptyStateContainer } = styles[layoutType]; + const onSaveEdit = anchorName => { + onSaveEditChanges(); + setDialogOpened(null); + setAnchorEl({ ...anchorEl, [anchorName]: null }); + }; + + const onDismissEdit = anchorName => { + setDialogOpened(null); + setAnchorEl({ ...anchorEl, [anchorName]: null }); + }; + const layoutResolver = (state, layoutType) => { if (layoutType === 'desktop') { switch (state) { @@ -82,9 +105,62 @@ function AnnouncementsTab({ Sala de aula virtual - - - + + + + setAnchorEl({ + ...anchorEl, + virtualRoom: e.currentTarget, + }) + } + aria-label="edit" + size="medium" + > + + + + + setAnchorEl({ ...anchorEl, virtualRoom: null }) + } + > + setDialogOpened('virtualRoom')} + > + Editar + + + , + ]} + onDismiss={() => onDismissEdit('virtualRoom')} + onSave={() => onSaveEdit('virtualRoom')} + />