show collection name in pin menu (#4705)
* show collection name in pin menu * fix: fetching right collection name * refactor: better variable names * Update app/actions/definitions/documents.tsx Co-authored-by: Tom Moor <tom.moor@gmail.com> * Avoid additional translation Co-authored-by: Tom Moor <tom.moor@gmail.com>
This commit is contained in:
@@ -352,7 +352,17 @@ export const duplicateDocument = createAction({
|
||||
* of the collection for all collection members to see.
|
||||
*/
|
||||
export const pinDocumentToCollection = createAction({
|
||||
name: ({ t }) => t("Pin to collection"),
|
||||
name: ({ activeDocumentId = "", t, stores }) => {
|
||||
const selectedDocument = stores.documents.get(activeDocumentId);
|
||||
const collectionName = selectedDocument
|
||||
? stores.documents.getCollectionForDocument(selectedDocument)?.name
|
||||
: t("collection");
|
||||
|
||||
return t("Pin to {{collectionName}}", {
|
||||
collectionName,
|
||||
});
|
||||
},
|
||||
|
||||
section: DocumentSection,
|
||||
icon: <PinIcon />,
|
||||
iconInContextMenu: false,
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
"Duplicate": "Duplicate",
|
||||
"Duplicate document": "Duplicate document",
|
||||
"Document duplicated": "Document duplicated",
|
||||
"Pin to collection": "Pin to collection",
|
||||
"Pin to {{collectionName}}": "Pin to {{collectionName}}",
|
||||
"Pinned to collection": "Pinned to collection",
|
||||
"Pin to home": "Pin to home",
|
||||
"Pinned to team home": "Pinned to team home",
|
||||
|
||||
Reference in New Issue
Block a user