Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Show share synchronization as a minor action (Part 1) #3250

Merged
merged 12 commits into from
Nov 22, 2024
2 changes: 1 addition & 1 deletion src/modules/drive/Toolbar/components/MoreMenu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ const MoreMenu = ({
<DownloadButtonItem displayedFolder={displayedFolder} />
</InsideRegularFolder>
{isMobile && hasWriteAccess && <AddMenuItem />}
<SelectableItem showSelectionBar={showSelectionBar} />
<SelectableItem onClick={showSelectionBar} />
{hasWriteAccess && (
<InsideRegularFolder
displayedFolder={displayedFolder}
Expand Down
7 changes: 3 additions & 4 deletions src/modules/drive/Toolbar/selectable/SelectableItem.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n'
/**
* Action to show the selection bar
*/
const SelectableItem = ({ showSelectionBar }) => {
const SelectableItem = ({ onClick }) => {
const { t } = useI18n()

return (
<ActionMenuItem
<ActionMenuItem left={<Icon icon={CheckSquareIcon} />} onClick={onClick}>
Merkur39 marked this conversation as resolved.
Show resolved Hide resolved
left={<Icon icon={CheckSquareIcon} />}
onClick={showSelectionBar}
>
Expand All @@ -23,8 +23,7 @@ const SelectableItem = ({ showSelectionBar }) => {
}

SelectableItem.propTypes = {
/** Function to show the selection bar coming from SelectionBar */
showSelectionBar: PropTypes.func.isRequired
onClick: PropTypes.func.isRequired
}

export default SelectableItem
4 changes: 1 addition & 3 deletions src/modules/public/PublicToolbarMoreMenu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ const PublicToolbarMoreMenu = ({
</ActionMenuItem>
)}
{isMobile && hasWriteAccess && <AddMenuItem />}
{files.length > 1 && (
<SelectableItem showSelectionBar={showSelectionBar} />
)}
{files.length > 1 && <SelectableItem onClick={showSelectionBar} />}
</ActionMenu>
)}
</>
Expand Down