fix: Small tweaks/fixes to custom domain UI
This commit is contained in:
@@ -45,7 +45,8 @@ const Contents = styled.div<{ $shrink?: boolean; $width?: number }>`
|
||||
background: ${(props) => props.theme.menuBackground};
|
||||
border-radius: 6px;
|
||||
padding: ${(props) => (props.$shrink ? "6px 0" : "12px 24px")};
|
||||
max-height: 50vh;
|
||||
max-height: 75vh;
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
box-shadow: ${(props) => props.theme.menuShadow};
|
||||
width: ${(props) => props.$width}px;
|
||||
|
||||
@@ -5,6 +5,7 @@ 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";
|
||||
@@ -255,31 +256,6 @@ function SharePopover({
|
||||
|
||||
{expandedOptions && (
|
||||
<>
|
||||
<Separator />
|
||||
<SwitchWrapper>
|
||||
<Input
|
||||
type="text"
|
||||
label={t("Custom link")}
|
||||
onChange={handleUrlSlugChange}
|
||||
error={slugValidationError}
|
||||
defaultValue={urlSlug}
|
||||
/>
|
||||
{!slugValidationError && urlSlug && (
|
||||
<DocumentLinkPreviewWrapper>
|
||||
<DocumentLinkPreview type="secondary" size="small">
|
||||
<Trans>The document will be available at</Trans>
|
||||
<br />
|
||||
<a
|
||||
href={urlSlug ? `${team.url}/s/${urlSlug}` : ""}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
{urlSlug ? `${team.url}/s/${urlSlug}` : ""}
|
||||
</a>
|
||||
</DocumentLinkPreview>
|
||||
</DocumentLinkPreviewWrapper>
|
||||
)}
|
||||
</SwitchWrapper>
|
||||
<Separator />
|
||||
<SwitchWrapper>
|
||||
<Switch
|
||||
@@ -302,6 +278,32 @@ function SharePopover({
|
||||
</SwitchText>
|
||||
</SwitchLabel>
|
||||
</SwitchWrapper>
|
||||
<Separator />
|
||||
<SwitchWrapper>
|
||||
<Input
|
||||
type="text"
|
||||
label={t("Custom link")}
|
||||
placeholder={slugify(document.titleWithDefault.toLowerCase())}
|
||||
onChange={handleUrlSlugChange}
|
||||
error={slugValidationError}
|
||||
defaultValue={urlSlug}
|
||||
/>
|
||||
{!slugValidationError && (
|
||||
<DocumentLinkPreviewWrapper>
|
||||
<DocumentLinkPreview type="secondary">
|
||||
<Trans>The document will be available at</Trans>
|
||||
<br />
|
||||
<a
|
||||
href={`${team.url}/s/${urlSlug || share?.id}`}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
{`${team.url}/s/${urlSlug || share?.id}`}
|
||||
</a>
|
||||
</DocumentLinkPreview>
|
||||
</DocumentLinkPreviewWrapper>
|
||||
)}
|
||||
</SwitchWrapper>
|
||||
</>
|
||||
)}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user