Skip to content

Commit 0325125

Browse files
lethemanhlethemanh
authored andcommitted
feat: Implement new UI of file viewer ✨
1 parent 82832de commit 0325125

File tree

21 files changed

+105
-14
lines changed

21 files changed

+105
-14
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,9 @@
102102
"cozy-search": "^0.14.1",
103103
"cozy-sharing": "^28.3.0",
104104
"cozy-stack-client": "^60.19.0",
105-
"cozy-ui": "^135.3.0",
105+
"cozy-ui": "^135.6.0",
106106
"cozy-ui-plus": "^4.4.0",
107-
"cozy-viewer": "^26.5.1",
107+
"cozy-viewer": "^26.6.0",
108108
"date-fns": "2.30.0",
109109
"diacritics": "1.3.0",
110110
"filesize": "10.1.6",

src/hooks/useMoreMenuActions.jsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useState, useEffect } from 'react'
2-
import { useNavigate } from 'react-router-dom'
2+
import { useLocation, useNavigate } from 'react-router-dom'
33
import { useI18n } from 'twake-i18n'
44

55
import { useClient } from 'cozy-client'
@@ -28,6 +28,7 @@ import { addToFavorites } from '@/modules/actions/components/addToFavorites'
2828
import { duplicateTo } from '@/modules/actions/components/duplicateTo'
2929
import { moveTo } from '@/modules/actions/components/moveTo'
3030
import { removeFromFavorites } from '@/modules/actions/components/removeFromFavorites'
31+
import { details } from '@/modules/actions/details'
3132
import { filterActionsByPolicy } from '@/modules/actions/policies'
3233

3334
export const useMoreMenuActions = file => {
@@ -46,6 +47,7 @@ export const useMoreMenuActions = file => {
4647
const currentFolderId = useCurrentFolderId()
4748
const { isSharingShortcutCreated, addSharingLink, syncSharingLink } =
4849
useSharingInfos()
50+
const location = useLocation()
4951
const canWriteToCurrentFolder = hasWriteAccess(currentFolderId, file.driveId)
5052
const isPDFDoc = file.mime === 'application/pdf'
5153
const showPrintAction = isPDFDoc && isPrintAvailable
@@ -60,6 +62,7 @@ export const useMoreMenuActions = file => {
6062
isCozySharing && syncToCozySharingLink,
6163
download,
6264
showPrintAction && print,
65+
details,
6366
hr,
6467
moveTo,
6568
!isSharedDrive && duplicateTo, // TO DO: Remove condition when duplicating is available in shared drive
@@ -95,7 +98,8 @@ export const useMoreMenuActions = file => {
9598
fetchBlobFileById,
9699
isFile,
97100
addSharingLink,
98-
driveId: file.driveId
101+
driveId: file.driveId,
102+
location
99103
}
100104
)
101105

src/locales/ar.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@
147147
}
148148
},
149149
"actions": {
150+
"details": "تفاصيل",
150151
"personalizeFolder": {
151152
"label": "تخصيص المجلد"
152153
},

src/locales/de.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,7 @@
479479
"empty": "Es wurde kein Ergebnis für die Suche \"%{query}\" gefunden"
480480
},
481481
"actions": {
482+
"details": "Details",
482483
"personalizeFolder": {
483484
"label": "Ordner personalisieren"
484485
},

src/locales/en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -675,6 +675,7 @@
675675
"error": "An error occurred, please try again."
676676
},
677677
"actions": {
678+
"details": "Details",
678679
"infos": "Details and qualification",
679680
"infosMobile": "Details",
680681
"duplicateTo": {

src/locales/es.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,7 @@
452452
}
453453
},
454454
"actions": {
455+
"details": "Detalles",
455456
"personalizeFolder": {
456457
"label": "Personalizar carpeta"
457458
},

src/locales/fr.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -672,6 +672,7 @@
672672
"error": "Une erreur est survenue, merci de réessayer."
673673
},
674674
"actions": {
675+
"details": "Détails",
675676
"infos": "Détails et qualification",
676677
"infosMobile": "Détails",
677678
"duplicateTo": {

src/locales/it.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,7 @@
302302
}
303303
},
304304
"actions": {
305+
"details": "Dettagli",
305306
"personalizeFolder": {
306307
"label": "Personalizza cartella"
307308
},

src/locales/ja.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,7 @@
414414
"empty": "問い合わせ “%{query}” の結果が見つかりません"
415415
},
416416
"actions": {
417+
"details": "詳細",
417418
"personalizeFolder": {
418419
"label": "フォルダをカスタマイズ"
419420
},

src/locales/ko.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@
8888
}
8989
},
9090
"actions": {
91+
"details": "세부 정보",
9192
"personalizeFolder": {
9293
"label": "폴더 개인화"
9394
},

0 commit comments

Comments
 (0)