diff --git a/app/components/Notice.ts b/app/components/Notice.ts deleted file mode 100644 index a0a4d1d7d..000000000 --- a/app/components/Notice.ts +++ /dev/null @@ -1,11 +0,0 @@ -import styled from "styled-components"; - -const Notice = styled.p` - background: ${(props) => props.theme.sidebarBackground}; - color: ${(props) => props.theme.sidebarText}; - padding: 10px 12px; - border-radius: 4px; - position: relative; -`; - -export default Notice; diff --git a/app/components/Notice.tsx b/app/components/Notice.tsx new file mode 100644 index 000000000..8fff91d67 --- /dev/null +++ b/app/components/Notice.tsx @@ -0,0 +1,50 @@ +import React from "react"; +import styled from "styled-components"; +import Flex from "./Flex"; +import Text from "./Text"; + +type Props = { + children: React.ReactNode; + icon?: JSX.Element; + description?: JSX.Element; +}; + +const Notice = ({ children, icon, description }: Props) => { + return ( + + + {icon} + + {children} + {description && ( + <> +
+ {description} + + )} +
+
+
+ ); +}; + +const Title = styled.span` + font-weight: 500; + font-size: 16px; +`; + +const Container = styled(Text)` + background: ${(props) => props.theme.sidebarBackground}; + color: ${(props) => props.theme.sidebarText}; + padding: 10px 12px; + border-radius: 4px; + position: relative; + font-size: 14px; + margin: 1em 0 0; + + svg { + flex-shrink: 0; + } +`; + +export default Notice; diff --git a/app/scenes/Document/components/Document.tsx b/app/scenes/Document/components/Document.tsx index 690fb737c..83ab850f9 100644 --- a/app/scenes/Document/components/Document.tsx +++ b/app/scenes/Document/components/Document.tsx @@ -1,10 +1,9 @@ import { debounce } from "lodash"; import { action, observable } from "mobx"; import { observer } from "mobx-react"; -import { InputIcon } from "outline-icons"; import { AllSelection } from "prosemirror-state"; import * as React from "react"; -import { WithTranslation, Trans, withTranslation } from "react-i18next"; +import { WithTranslation, withTranslation } from "react-i18next"; import { Prompt, Route, @@ -26,11 +25,9 @@ import ErrorBoundary from "~/components/ErrorBoundary"; import Flex from "~/components/Flex"; import LoadingIndicator from "~/components/LoadingIndicator"; import Modal from "~/components/Modal"; -import Notice from "~/components/Notice"; import PageTitle from "~/components/PageTitle"; import PlaceholderDocument from "~/components/PlaceholderDocument"; import RegisterKeyDown from "~/components/RegisterKeyDown"; -import Time from "~/components/Time"; import withStores from "~/components/withStores"; import { NavigationNode } from "~/types"; import { client } from "~/utils/ApiClient"; @@ -50,6 +47,7 @@ import Editor from "./Editor"; import Header from "./Header"; import KeyboardShortcutsButton from "./KeyboardShortcutsButton"; import MarkAsViewed from "./MarkAsViewed"; +import Notices from "./Notices"; import PublicReferences from "./PublicReferences"; import References from "./References"; @@ -534,52 +532,7 @@ class DocumentScene extends React.Component { column auto > - {document.isTemplate && !readOnly && ( - - - You’re editing a template. Highlight some text and use the{" "} - control to add - placeholders that can be filled out when creating new - documents from this template. - - - )} - {document.archivedAt && !document.deletedAt && ( - - {t("Archived by {{userName}}", { - userName: document.updatedBy.name, - })}{" "} - - )} - {document.deletedAt && ( - - - {t("Deleted by {{userName}}", { - userName: document.updatedBy.name, - })}{" "} - - {document.permanentlyDeletedAt && ( - <> -
- {document.template ? ( - - This template will be permanently deleted in{" "} - - ) : ( - - This document will be permanently deleted in{" "} - - )} - - )} -
- )} + }> {showContents && ( @@ -651,11 +604,6 @@ class DocumentScene extends React.Component { } } -const PlaceholderIcon = styled(InputIcon)` - position: relative; - top: 6px; -`; - const Background = styled(Container)` background: ${(props) => props.theme.background}; transition: ${(props) => props.theme.backgroundTransition}; @@ -677,9 +625,6 @@ type MaxWidthProps = { }; const MaxWidth = styled(Flex)` - ${(props) => - props.archived && `* { color: ${props.theme.textSecondary} !important; } `}; - // Adds space to the gutter to make room for heading annotations padding: 0 32px; transition: padding 100ms; diff --git a/app/scenes/Document/components/Editor.tsx b/app/scenes/Document/components/Editor.tsx index c106aea9e..9a4d9175a 100644 --- a/app/scenes/Document/components/Editor.tsx +++ b/app/scenes/Document/components/Editor.tsx @@ -101,9 +101,7 @@ function DocumentEditor(props: Props, ref: React.RefObject) { onGoToNextInput={handleGoToNextInput} onChange={onChangeTitle} starrable={!shareId} - placeholder={ - document.isTemplate ? t("Name your template…") : t("Untitled") - } + placeholder={t("Untitled")} /> {!shareId && ( + This template will be permanently deleted in{" "} +