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{" "}
- {" "}
- unless restored.
-
- ) : (
-
- This document will be permanently deleted in{" "}
- {" "}
- unless restored.
-
- )}
- >
- )}
-
- )}
+ }>
{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{" "}
+ unless restored.
+
+ ) : (
+
+ This document will be permanently deleted in{" "}
+ unless restored.
+
+ );
+ }
+
+ return (
+ <>
+ {document.isTemplate && !readOnly && (
+ }
+ description={
+
+ Highlight some text and use the{" "}
+ control to add
+ placeholders that can be filled out when creating new documents
+
+ }
+ >
+ {t("You’re editing a template")}
+
+ )}
+ {document.archivedAt && !document.deletedAt && (
+ }>
+ {t("Archived by {{userName}}", {
+ userName: document.updatedBy.name,
+ })}
+
+
+
+ )}
+ {document.deletedAt && (
+ }
+ description={permanentlyDeletedDescription()}
+ >
+ {t("Deleted by {{userName}}", {
+ userName: document.updatedBy.name,
+ })}
+
+
+
+ )}
+ >
+ );
+}
+
+const PlaceholderIcon = styled(InputIcon)`
+ position: relative;
+ top: 6px;
+ margin-top: -6px;
+`;
diff --git a/shared/i18n/locales/en_US/translation.json b/shared/i18n/locales/en_US/translation.json
index 05fe869f3..762618d16 100644
--- a/shared/i18n/locales/en_US/translation.json
+++ b/shared/i18n/locales/en_US/translation.json
@@ -364,14 +364,11 @@
"Add groups to {{ collectionName }}": "Add groups to {{ collectionName }}",
"Add people to {{ collectionName }}": "Add people to {{ collectionName }}",
"Document updated by {{userName}}": "Document updated by {{userName}}",
- "You have unsaved changes.\nAre you sure you want to discard them?": "You have unsaved changes.\nAre you sure you want to discard them?",
- "Images are still uploading.\nAre you sure you want to discard them?": "Images are still uploading.\nAre you sure you want to discard them?",
- "You’re editing a template. Highlight some text and use the <2>2> control to add placeholders that can be filled out when creating new documents from this template.": "You’re editing a template. Highlight some text and use the <2>2> control to add placeholders that can be filled out when creating new documents from this template.",
- "Archived by {{userName}}": "Archived by {{userName}}",
- "Deleted by {{userName}}": "Deleted by {{userName}}",
"This template will be permanently deleted in <2>2> unless restored.": "This template will be permanently deleted in <2>2> unless restored.",
"This document will be permanently deleted in <2>2> unless restored.": "This document will be permanently deleted in <2>2> unless restored.",
- "Name your template…": "Name your template…",
+ "You have unsaved changes.\nAre you sure you want to discard them?": "You have unsaved changes.\nAre you sure you want to discard them?",
+ "Images are still uploading.\nAre you sure you want to discard them?": "Images are still uploading.\nAre you sure you want to discard them?",
+ "Untitled template": "Untitled template",
"Type '/' to insert, or start writing…": "Type '/' to insert, or start writing…",
"Hide contents": "Hide contents",
"Show contents": "Show contents",
@@ -385,6 +382,9 @@
"Publish": "Publish",
"Publishing": "Publishing",
"Sorry, it looks like you don’t have permission to access the document": "Sorry, it looks like you don’t have permission to access the document",
+ "You’re editing a template. Highlight some text and use the <2>2> control to add placeholders that can be filled out when creating new documents from this template.": "You’re editing a template. Highlight some text and use the <2>2> control to add placeholders that can be filled out when creating new documents from this template.",
+ "Archived by {{userName}}": "Archived by {{userName}}",
+ "Deleted by {{userName}}": "Deleted by {{userName}}",
"Observing {{ userName }}": "Observing {{ userName }}",
"Nested documents": "Nested documents",
"Referenced by": "Referenced by",