Skip to content

Commit

Permalink
feat: Adjust MoreMenu order in public views
Browse files Browse the repository at this point in the history
  • Loading branch information
Merkur39 committed Nov 28, 2024
1 parent 1f17339 commit b65fee1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 6 additions & 2 deletions src/modules/public/PublicToolbarByLink.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useDisplayedFolder } from 'hooks'
import React from 'react'

import Divider from 'cozy-ui/transpiled/react/Divider'
import useBreakpoints from 'cozy-ui/transpiled/react/providers/Breakpoints'

import { BarRightOnMobile } from 'components/Bar'
Expand Down Expand Up @@ -49,12 +50,15 @@ const PublicToolbarByLink = ({
showSelectionBar={showSelectionBar}
actions={[]}
>
{isMobile && <OpenExternalLinkItem link={HOME_LINK_HREF} />}
{isMobile && files.length > 0 && (
<DownloadButtonItem files={files} />
)}
{isMobile && hasWriteAccess && <AddMenuItem />}
{files.length > 1 && <SelectableItem onClick={showSelectionBar} />}
{isMobile && hasWriteAccess && <AddMenuItem />}
{isMobile && (files.length > 1 || hasWriteAccess) && (
<Divider className="u-mv-half" />
)}
{isMobile && <OpenExternalLinkItem link={HOME_LINK_HREF} />}
</PublicToolbarMoreMenu>
)}
</AddMenuProvider>
Expand Down
8 changes: 6 additions & 2 deletions src/modules/public/PublicToolbarCozyToCozy.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react'

import Divider from 'cozy-ui/transpiled/react/Divider'
import useBreakpoints from 'cozy-ui/transpiled/react/providers/Breakpoints'

import { BarRightOnMobile } from 'components/Bar'
Expand Down Expand Up @@ -34,12 +35,15 @@ const PublicToolbarCozyToCozy = ({
showSelectionBar={showSelectionBar}
actions={[]}
>
{isMobile && files.length > 0 && <DownloadButtonItem files={files} />}
{files.length > 1 && <SelectableItem onClick={showSelectionBar} />}
{((isMobile && files.length > 0) || files.length > 1) && (
<Divider className="u-mv-half" />
)}
<OpenExternalLinkItem
isSharingShortcutCreated={isSharingShortcutCreated}
link={discoveryLink}
/>
{isMobile && files.length > 0 && <DownloadButtonItem files={files} />}
{files.length > 1 && <SelectableItem onClick={showSelectionBar} />}
</PublicToolbarMoreMenu>
</BarRightOnMobile>
)
Expand Down

0 comments on commit b65fee1

Please sign in to comment.