From 7fb02c96e623048d45f329fe082be2265407da0c Mon Sep 17 00:00:00 2001 From: Philip Molares Date: Sun, 19 Feb 2023 20:29:05 +0100 Subject: [PATCH] refactor(frontend): title for common modal via titleI18nKey or title prop This is mainly needed because we use the common modal to show image light boxes and the title is then the title or alt text of the image Signed-off-by: Philip Molares --- .../__snapshots__/common-modal.test.tsx.snap | 21 ++++++++++++++----- .../deletion-moadal.test.tsx.snap | 4 +++- .../common/modals/common-modal.test.tsx | 6 +++--- .../components/common/modals/common-modal.tsx | 10 ++++----- .../common/modals/deletion-modal.tsx | 12 ++++++++--- .../common/motd-modal/motd-modal.tsx | 7 +++++-- .../app-bar/help-button/help-modal.tsx | 10 ++------- .../document-bar/aliases/aliases-modal.tsx | 4 ++-- .../note-info/note-info-modal.tsx | 4 ++-- .../permissions/permission-modal.tsx | 4 ++-- .../document-bar/revisions/revision-modal.tsx | 4 ++-- .../document-bar/share/share-modal.tsx | 4 ++-- .../max-length-warning-modal.tsx | 4 ++-- .../table-picker/custom-table-size-modal.tsx | 4 ++-- .../delete-note-modal.tsx | 4 ++-- .../history-toolbar/clear-history-button.tsx | 4 ++-- .../version-info/version-info-modal.tsx | 4 ++-- .../layout/settings-dialog/settings-modal.tsx | 4 ++-- .../extensions/image/image-lightbox-modal.tsx | 5 ++--- .../access-token-created-modal.tsx | 4 ++-- .../access-token-deletion-modal.tsx | 4 ++-- .../account-deletion-modal.tsx | 4 ++-- 22 files changed, 73 insertions(+), 58 deletions(-) diff --git a/frontend/src/components/common/modals/__snapshots__/common-modal.test.tsx.snap b/frontend/src/components/common/modals/__snapshots__/common-modal.test.tsx.snap index f9151276c..8e8eed99a 100644 --- a/frontend/src/components/common/modals/__snapshots__/common-modal.test.tsx.snap +++ b/frontend/src/components/common/modals/__snapshots__/common-modal.test.tsx.snap @@ -15,7 +15,9 @@ exports[`CommonModal render correctly in size lg 1`] = ` > testText @@ -35,7 +37,9 @@ exports[`CommonModal render correctly in size sm 1`] = ` > testText @@ -55,7 +59,9 @@ exports[`CommonModal render correctly in size xl 1`] = ` > testText @@ -75,7 +81,9 @@ exports[`CommonModal render correctly with additionalClasses 1`] = ` > testText @@ -144,6 +152,7 @@ exports[`CommonModal render correctly with title icon 1`] = ` class="fa fa-heart " />   + testText @@ -164,7 +173,9 @@ exports[`CommonModal renders correctly and calls onHide, when close button is cl >