Skip to content

Commit

Permalink
fix: display save/cancel for image dropzone button (naturalsolutions#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
ophdlv authored Sep 4, 2023
1 parent cb934d2 commit 3024962
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
11 changes: 8 additions & 3 deletions frontend/src/components/common/buttonsYesNo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,17 @@ import { useTranslation } from "react-i18next";
import ButtonCancel from "./buttonCancel";
import ButtonValidate from "./buttonValidate";

export default function ButtonsYesNo({onYes, onNo}) {
export default function ButtonsYesNo({
onYes,
onNo,
yesContent="",
noContent=""
}) {
const { t } = useTranslation();
return (
<>
<ButtonCancel content={ capitalize(t("main.no")) } cancel={ onNo } />
<ButtonValidate content={ capitalize(t("main.yes")) } validate={ onYes } />
<ButtonCancel content={ noContent ? noContent : capitalize(t("main.no")) } cancel={ onNo } />
<ButtonValidate content={ yesContent ? yesContent : capitalize(t("main.yes")) } validate={ onYes } />
</>
)
}
7 changes: 6 additions & 1 deletion frontend/src/components/imageList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,12 @@ const ImageList: FC<{}> = () => {
alignItems="center"
spacing={2}
>
<ButtonsYesNo onYes={ save } onNo={ clear } />
<ButtonsYesNo
onYes={ save }
onNo={ clear }
yesContent={ capitalize(t("main.save"))}
noContent={capitalize(t("main.cancel"))}
/>
</Stack>
<ImageMasonry />
</Stack>
Expand Down

0 comments on commit 3024962

Please sign in to comment.