diff --git a/app/components/Input.tsx b/app/components/Input.tsx index d0ecd6d48..7cad0db43 100644 --- a/app/components/Input.tsx +++ b/app/components/Input.tsx @@ -200,11 +200,13 @@ class Input extends React.Component { )} - - - {error} - - + {error && ( + + + {error} + + + )} ); } diff --git a/app/scenes/Document/components/SharePopover.tsx b/app/scenes/Document/components/SharePopover.tsx index 7aa407c26..c6e58320b 100644 --- a/app/scenes/Document/components/SharePopover.tsx +++ b/app/scenes/Document/components/SharePopover.tsx @@ -5,7 +5,6 @@ import { observer } from "mobx-react"; import { ExpandedIcon, GlobeIcon, PadlockIcon } from "outline-icons"; import * as React from "react"; import { useTranslation, Trans } from "react-i18next"; -import slugify from "slugify"; import styled from "styled-components"; import { SHARE_URL_SLUG_REGEX } from "@shared/utils/urlHelpers"; import Document from "~/models/Document"; @@ -13,10 +12,7 @@ import Share from "~/models/Share"; import Button from "~/components/Button"; import CopyToClipboard from "~/components/CopyToClipboard"; import Flex from "~/components/Flex"; -import Input, { - TextWrapper, - StyledText as DocumentLinkPreview, -} from "~/components/Input"; +import Input, { StyledText } from "~/components/Input"; import Notice from "~/components/Notice"; import Switch from "~/components/Switch"; import Text from "~/components/Text"; @@ -172,6 +168,8 @@ function SharePopover({ shareUrl += "?edit=true"; } + const url = shareUrl.replace(/https?:\/\//, ""); + return ( <> @@ -283,25 +281,20 @@ function SharePopover({ - {!slugValidationError && ( - - - The document will be available at -
- - {`${team.url}/s/${urlSlug || share?.id}`} + {!slugValidationError && urlSlug && ( + + + The document will be accessible at{" "} + + {{ url }} -
-
+ + )} @@ -372,7 +365,7 @@ const SwitchText = styled(Text)` font-size: 15px; `; -const DocumentLinkPreviewWrapper = styled(TextWrapper)` +const DocumentLinkPreview = styled(StyledText)` margin-top: -12px; `; diff --git a/shared/i18n/locales/en_US/translation.json b/shared/i18n/locales/en_US/translation.json index ef11ba9ab..578cb8871 100644 --- a/shared/i18n/locales/en_US/translation.json +++ b/shared/i18n/locales/en_US/translation.json @@ -490,7 +490,7 @@ "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", "Custom link": "Custom link", - "The document will be available at": "The document will be available at", + "The document will be accessible at <2>{{url}}": "The document will be accessible at <2>{{url}}", "More options": "More options", "Close": "Close", "{{ teamName }} is using Outline to share documents, please login to continue.": "{{ teamName }} is using Outline to share documents, please login to continue.",