Skip to content

Commit

Permalink
Move Undo Button
Browse files Browse the repository at this point in the history
  • Loading branch information
jayfo committed Aug 13, 2024
1 parent bce1a7d commit 3bdd60c
Showing 1 changed file with 14 additions and 15 deletions.
29 changes: 14 additions & 15 deletions web_registry/src/components/common/ContentsMenu.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, { FunctionComponent } from "react";

import AssignmentReturnOutlinedIcon from "@mui/icons-material/AssignmentReturnOutlined";
import AssignmentTurnedInOutlinedIcon from "@mui/icons-material/AssignmentTurnedInOutlined";
import {
Badge,
Expand Down Expand Up @@ -317,27 +316,16 @@ export const ContentsMenu: FunctionComponent<IContentsMenuProps> = observer(
<Typography>CONTENTS</Typography>
{!!recentEntryCutoffDateTime && (
<FormHelperText>
Last Reviewed:
Last Marked Reviewed:
<br />
{format(recentEntryCutoffDateTime, "MM/dd/yyyy h:mm aaa")}
</FormHelperText>
)}
</Stack>
<Stack direction={"column"} alignItems={"start"} spacing={1}>
<Button
variant="outlined"
size="small"
color="primary"
disabled={!recentEntryBadgeContent}
startIcon={<AssignmentTurnedInOutlinedIcon />}
onClick={onRecentEntryMarkReviewed}
>
{getString("recent_patient_entry_mark_reviewed")}
</Button>
<Button
variant="text"
size="small"
color="primary"
sx={{ marginLeft: "-5px" }}
disabled={((): boolean => {
// Undo is possible if:
// (1) there is no existing mark
Expand All @@ -363,12 +351,23 @@ export const ContentsMenu: FunctionComponent<IContentsMenuProps> = observer(

return true;
})()}
startIcon={<AssignmentReturnOutlinedIcon />}
onClick={onRecentEntryMarkUndo}
>
{getString("recent_patient_entry_undo_previous_mark")}
</Button>
</Stack>
<Stack direction={"column"} alignItems={"start"} spacing={1}>
<Button
variant="outlined"
size="small"
color="primary"
disabled={!recentEntryBadgeContent}
startIcon={<AssignmentTurnedInOutlinedIcon />}
onClick={onRecentEntryMarkReviewed}
>
{getString("recent_patient_entry_mark_reviewed")}
</Button>
</Stack>
</Stack>
</TitleContainer>
<List dense={true}>{contents.map(createListItem)}</List>
Expand Down

0 comments on commit 3bdd60c

Please sign in to comment.