cozy-drive icon indicating copy to clipboard operation
cozy-drive copied to clipboard

Should we use FooterContent from Drive or Cozy-UI?

Open trollepierre opened this issue 2 years ago • 3 comments

While deleting the flags, we realized flag('viewer-bottom-sheet-tension') flag('viewer-bottom-sheet-friction') flag('viewer-bottom-sheet-clamp') are not used anymore : https://github.com/cozy/cozy-drive/pull/2535

However I think there is some confusion in the Viewer / FooterContent :
https://github.com/cozy/cozy-drive/blob/d0729f358224497f8bd08a8b33f65577e4cfba77/src/drive/web/modules/viewer/FilesViewer.jsx#L186 <= here drive FilesViewer tries to set its own FooterContent

but Cozy-UI viewer does not pass the Props to ViewerInformationsWrapper https://github.com/cozy/cozy-ui/blob/5df4e2b2c8da396996b0be8be64b24ce03de999f/react/Viewer/index.jsx#L223

so this component ViewerInformationsWrapper uses directly FooterContent from cozy-ui : https://github.com/cozy/cozy-ui/blob/5df4e2b2c8da396996b0be8be64b24ce03de999f/react/Viewer/index.jsx#L171

however I see a ViewerWithCustomPanelAndFooter https://github.com/cozy/cozy-ui/blob/5df4e2b2c8da396996b0be8be64b24ce03de999f/react/Viewer/index.jsx#L270 and I have no idea, if Drive choose use it or not.

@JF-Cozy : maybe you have a better knowledge than me on what should be done here.

Expected:

  • [ ] ~either Drive uses ViewerInformationsWrapper with its own FooterContent~ <= EDITED after @Crash-- comment
  • [ ] or we kept code in the production, and delete the footerProps of FilesViewer.jsx / <Viewer> + FooterContent + BottomSheet + and maybe more code
  • [ ] flags.js does not have viewer-bottom-sheet flags anymore
  • [ ] Debug Tools cleant from this flag

trollepierre avatar Mar 30 '22 14:03 trollepierre

At first, the component was developer in Drive. Then one part was done on UI, but not all and then Drive had to pass some additionnal props.

Now all the logic is in UI, we should update Drive to remove the useless stuff.

Crash-- avatar Mar 30 '22 14:03 Crash--

oui d'autant plus que maintenant, le viewer de cozy-ui affiche les bons blocs selon le file passé en prop, automatiquement.

JF-Cozy avatar Apr 01 '22 12:04 JF-Cozy

à lire : https://github.com/cozy/cozy-drive/pull/2535#discussion_r840547767

trollepierre avatar Apr 01 '22 12:04 trollepierre