From 6f8f8edd64ec68e6a4ce494159ab6ad667586976 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Poizat?= Date: Mon, 24 Feb 2025 08:59:36 +0100 Subject: [PATCH] feat: Add shared subtitle for shared drive --- src/locales/en.json | 1 + src/locales/fr.json | 1 + src/modules/filelist/cells/FileName.jsx | 12 ++++++++++++ src/styles/filelist.styl | 7 +++++++ 4 files changed, 21 insertions(+) diff --git a/src/locales/en.json b/src/locales/en.json index ceba3a0add..2f28b77698 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -82,6 +82,7 @@ "rw": "You can view, update, delete and add this content to your Cozy. Updates you make will be seen on other Cozies." } }, + "shared": "Shared", "sharedByMe": "Shared by me", "sharedWithMe": "Shared with me", "sharedBy": "Shared by %{name}", diff --git a/src/locales/fr.json b/src/locales/fr.json index 9103366ae6..303d35aa48 100644 --- a/src/locales/fr.json +++ b/src/locales/fr.json @@ -82,6 +82,7 @@ "rw": "Vous pouvez consulter, modifier et supprimer du contenu. Les modifications sur le contenu seront répercutées automatiquement entre vos Cozy." } }, + "shared": "Partagé", "sharedByMe": "Partagé", "sharedWithMe": "Partagé avec moi", "sharedBy": "Partagé par %{name}", diff --git a/src/modules/filelist/cells/FileName.jsx b/src/modules/filelist/cells/FileName.jsx index c276178505..48ac8e8b0e 100644 --- a/src/modules/filelist/cells/FileName.jsx +++ b/src/modules/filelist/cells/FileName.jsx @@ -8,6 +8,7 @@ import { isDirectory } from 'cozy-client/dist/models/file' import AppIcon from 'cozy-ui/transpiled/react/AppIcon' import Icon from 'cozy-ui/transpiled/react/Icon' import CarbonCopyIcon from 'cozy-ui/transpiled/react/Icons/CarbonCopy' +import ShareIcon from 'cozy-ui/transpiled/react/Icons/Share' import MidEllipsis from 'cozy-ui/transpiled/react/MidEllipsis' import { TableCell } from 'cozy-ui/transpiled/react/deprecated/Table' import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n' @@ -16,6 +17,7 @@ import styles from '@/styles/filelist.styl' import RenameInput from '@/modules/drive/RenameInput' import { getFileNameAndExtension } from '@/modules/filelist/helpers' +import { isSharedDriveFolder } from '@/modules/shareddrives/helpers' export const CertificationsIcons = ({ attributes }) => { const isCarbonCopy = get(attributes, 'metadata.carbonCopy') @@ -147,6 +149,16 @@ const FileName = ({ {isMobile && } ))} + {!withFilePath && isSharedDriveFolder(attributes) && ( +
+ + {t('Files.share.shared')} +
+ )} )} diff --git a/src/styles/filelist.styl b/src/styles/filelist.styl index 2ba74e9a34..6f886fbb69 100644 --- a/src/styles/filelist.styl +++ b/src/styles/filelist.styl @@ -259,6 +259,13 @@ column-width-thumbnail-bigger = 7rem .fil-file-infos display none +.fil-file-shared + color var(--actionColorActive) + font-size .75rem + +.fil-file-shared-icon + margin-right 0.2rem + @keyframes placeHolderShimmer 0% background-position -20rem 0