diff --git a/app/components/ContextMenu/MenuItem.js b/app/components/ContextMenu/MenuItem.js
index 1be7feb61..7f2d0a8d3 100644
--- a/app/components/ContextMenu/MenuItem.js
+++ b/app/components/ContextMenu/MenuItem.js
@@ -101,7 +101,8 @@ export const MenuAnchor = styled.a`
? "pointer-events: none;"
: `
- &:hover,
+ &:hover,
+ &:focus,
&.focus-visible {
color: ${props.theme.white};
background: ${props.theme.primary};
@@ -112,11 +113,6 @@ export const MenuAnchor = styled.a`
fill: ${props.theme.white};
}
}
-
- &:focus {
- color: ${props.theme.white};
- background: ${props.theme.primary};
- }
`};
${breakpoint("tablet")`
diff --git a/app/menus/TemplatesMenu.js b/app/menus/TemplatesMenu.js
index 334e8d80c..c1f7d6477 100644
--- a/app/menus/TemplatesMenu.js
+++ b/app/menus/TemplatesMenu.js
@@ -9,6 +9,7 @@ import Document from "models/Document";
import Button from "components/Button";
import ContextMenu from "components/ContextMenu";
import MenuItem from "components/ContextMenu/MenuItem";
+import Separator from "components/ContextMenu/Separator";
import useStores from "hooks/useStores";
type Props = {|
@@ -19,12 +20,36 @@ function TemplatesMenu({ document }: Props) {
const menu = useMenuState({ modal: true });
const { documents } = useStores();
const { t } = useTranslation();
- const templates = documents.templatesInCollection(document.collectionId);
+ const templates = documents.templates;
if (!templates.length) {
return null;
}
+ const templatesInCollection = templates.filter(
+ (t) => t.collectionId === document.collectionId
+ );
+ const otherTemplates = templates.filter(
+ (t) => t.collectionId !== document.collectionId
+ );
+
+ const renderTemplate = (template) => (
+
+ );
+
return (
<>
@@ -35,21 +60,11 @@ function TemplatesMenu({ document }: Props) {
)}
- {templates.map((template) => (
-
- ))}
+ {templatesInCollection.map(renderTemplate)}
+ {otherTemplates.length && templatesInCollection.length ? (
+
+ ) : undefined}
+ {otherTemplates.map(renderTemplate)}
>
);