Skip to content

Commit

Permalink
feat: Add shared subtitle for shared drive
Browse files Browse the repository at this point in the history
  • Loading branch information
zatteo committed Feb 24, 2025
1 parent b12a2d5 commit 6f8f8ed
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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}",
Expand Down
1 change: 1 addition & 0 deletions src/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -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}",
Expand Down
12 changes: 12 additions & 0 deletions src/modules/filelist/cells/FileName.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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')
Expand Down Expand Up @@ -147,6 +149,16 @@ const FileName = ({
{isMobile && <CertificationsIcons attributes={attributes} />}
</div>
))}
{!withFilePath && isSharedDriveFolder(attributes) && (
<div className={styles['fil-file-shared']}>
<Icon
icon={ShareIcon}
size="10"
className={styles['fil-file-shared-icon']}
/>
{t('Files.share.shared')}
</div>
)}
</div>
)}
</TableCell>
Expand Down
7 changes: 7 additions & 0 deletions src/styles/filelist.styl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6f8f8ed

Please sign in to comment.