From 0b568128cfedd0dbdd48137739acad709bfb85f2 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Thu, 29 Sep 2022 07:26:43 -0400 Subject: [PATCH] Language and UI tweaks --- app/components/Popover.tsx | 2 +- .../Document/components/SharePopover.tsx | 93 ++++++++----------- shared/i18n/locales/en_US/translation.json | 7 +- 3 files changed, 43 insertions(+), 59 deletions(-) diff --git a/app/components/Popover.tsx b/app/components/Popover.tsx index 2399ab4185..254fff8474 100644 --- a/app/components/Popover.tsx +++ b/app/components/Popover.tsx @@ -46,7 +46,7 @@ const Contents = styled.div<{ $shrink?: boolean; $width?: number }>` border-radius: 6px; padding: ${(props) => (props.$shrink ? "6px 0" : "12px 24px")}; max-height: 50vh; - overflow-y: scroll; + overflow-y: auto; box-shadow: ${(props) => props.theme.menuShadow}; width: ${(props) => props.$width}px; diff --git a/app/scenes/Document/components/SharePopover.tsx b/app/scenes/Document/components/SharePopover.tsx index 236e550597..54e77eb0e3 100644 --- a/app/scenes/Document/components/SharePopover.tsx +++ b/app/scenes/Document/components/SharePopover.tsx @@ -10,7 +10,6 @@ import Share from "~/models/Share"; import Button from "~/components/Button"; import CopyToClipboard from "~/components/CopyToClipboard"; import Flex from "~/components/Flex"; -import Input from "~/components/Input"; import Notice from "~/components/Notice"; import Switch from "~/components/Switch"; import Text from "~/components/Text"; @@ -135,8 +134,8 @@ function SharePopover({ ) : ( - )}{" "} - {t("Share this document")} + )} + {t("Share this document")} {sharedParent && !document.isDraft && ( @@ -204,33 +203,13 @@ function SharePopover({ {share.includeChildDocuments ? t("Nested documents are publicly available") : t("Nested documents are not shared")} + . )} - - - - - - - - {expandedOptions ? ( + {expandedOptions && ( <> @@ -247,26 +226,40 @@ function SharePopover({ {isEditMode ? t( - "Users with enough permissions will be redirected to the editor" + "Users with edit permission will be redirected to the main app" ) - : `${t("Shared view mode")}: ${t( - "page has Edit button that redirects to the editor" - )}`} + : t("All users see the same publicly shared view")} + . - ) : ( - - setExpandedOptions(true)} - title={t("More Options")} - aria-label={t("More Options")} - > - - - )} + + + {expandedOptions ? ( + + ) : ( + } + onClick={() => setExpandedOptions(true)} + neutral + borderOnHover + > + {t("More options")} + + )} + + + + ); } @@ -275,6 +268,9 @@ const Heading = styled.h2` display: flex; align-items: center; margin-top: 12px; + gap: 8px; + + /* accounts for icon padding */ margin-left: -4px; `; @@ -282,17 +278,11 @@ const SwitchWrapper = styled.div` margin: 20px 0; `; -export const MoreOptionsButton = styled.button` +const MoreOptionsButton = styled(Button)` background: none; - border: 0; - transition: opacity 100ms ease-in-out; - opacity: 0.5; - color: ${(props) => props.theme.divider}; - cursor: pointer; - - &:hover { - opacity: 1; - } + font-size: 14px; + color: ${(props) => props.theme.textSecondary}; + margin-left: -8px; `; const Separator = styled.div` @@ -301,11 +291,6 @@ const Separator = styled.div` background-color: ${(props) => props.theme.divider}; `; -const InputLink = styled(Input)` - flex-grow: 1; - margin-right: 8px; -`; - const SwitchLabel = styled(Flex)` svg { flex-shrink: 0; diff --git a/shared/i18n/locales/en_US/translation.json b/shared/i18n/locales/en_US/translation.json index 7793db9050..1082a8d091 100644 --- a/shared/i18n/locales/en_US/translation.json +++ b/shared/i18n/locales/en_US/translation.json @@ -431,10 +431,9 @@ "Nested documents are publicly available": "Nested documents are publicly available", "Nested documents are not shared": "Nested documents are not shared", "Automatically redirect to the editor": "Automatically redirect to the editor", - "Users with enough permissions will be redirected to the editor": "Users with enough permissions will be redirected to the editor", - "Shared view mode": "Shared view mode", - "page has Edit button that redirects to the editor": "page has Edit button that redirects to the editor", - "More Options": "More Options", + "Users with edit permission will be redirected to the main app": "Users with edit permission will be redirected to the main app", + "All users see the same publicly shared view": "All users see the same publicly shared view", + "More options": "More options", "{{ teamName }} is using Outline to share documents, please login to continue.": "{{ teamName }} is using Outline to share documents, please login to continue.", "Are you sure you want to delete the {{ documentTitle }} template?": "Are you sure you want to delete the {{ documentTitle }} template?", "Are you sure about that? Deleting the {{ documentTitle }} document will delete all of its history.": "Are you sure about that? Deleting the {{ documentTitle }} document will delete all of its history.",