Skip to content

Commit

Permalink
refactor: Rename FabWithMenuContext
Browse files Browse the repository at this point in the history
  • Loading branch information
Merkur39 committed Nov 27, 2024
1 parent d1af4f6 commit 6629104
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n'
import { AddMenuContext } from 'modules/drive/AddMenu/AddMenuProvider'
import { useFabStyles } from 'modules/drive/helpers'

const FabWithMenuContext = ({ noSidebar }) => {
const FabWithAddMenuContext = ({ noSidebar }) => {
const { t } = useI18n()

const {
Expand Down Expand Up @@ -42,4 +42,4 @@ const FabWithMenuContext = ({ noSidebar }) => {
)
}

export default React.memo(FabWithMenuContext)
export default React.memo(FabWithAddMenuContext)
4 changes: 2 additions & 2 deletions src/modules/views/Drive/DriveFolderView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import { removeFromFavorites } from 'modules/actions/components/removeFromFavori
import { makeExtraColumnsNamesFromMedia } from 'modules/certifications'
import { useExtraColumns } from 'modules/certifications/useExtraColumns'
import AddMenuProvider from 'modules/drive/AddMenu/AddMenuProvider'
import FabWithMenuContext from 'modules/drive/FabWithMenuContext'
import FabWithAddMenuContext from 'modules/drive/FabWithAddMenuContext'
import Toolbar from 'modules/drive/Toolbar'
import { useFolderSort } from 'modules/navigation/duck'
import { useSelectionContext } from 'modules/selection/SelectionProvider'
Expand Down Expand Up @@ -241,7 +241,7 @@ const DriveFolderView = () => {
displayedFolder={displayedFolder}
isSelectionBarVisible={isSelectionBarVisible}
>
<FabWithMenuContext />
<FabWithAddMenuContext />
</AddMenuProvider>
)}
<Outlet />
Expand Down
8 changes: 6 additions & 2 deletions src/modules/views/Public/PublicFolderView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import { download, trash, rename, versions } from 'modules/actions'
import { makeExtraColumnsNamesFromMedia } from 'modules/certifications'
import { useExtraColumns } from 'modules/certifications/useExtraColumns'
import AddMenuProvider from 'modules/drive/AddMenu/AddMenuProvider'
import FabWithMenuContext from 'modules/drive/FabWithMenuContext'
import FabWithAddMenuContext from 'modules/drive/FabWithAddMenuContext'
import Main from 'modules/layout/Main'
import PublicToolbar from 'modules/public/PublicToolbar'
import { useSelectionContext } from 'modules/selection/SelectionProvider'
Expand Down Expand Up @@ -158,6 +158,10 @@ const PublicFolderView = () => {
// Check if the sharing shortcut has already been created (but not synced)
const isShareAlreadyAdded = sharingInfos?.isSharingShortcutCreated

console.log('==========')

Check warning on line 161 in src/modules/views/Public/PublicFolderView.jsx

View workflow job for this annotation

GitHub Actions / Build and publish

Unexpected console statement
console.log('isFabDisplayed : ', isFabDisplayed)

Check warning on line 162 in src/modules/views/Public/PublicFolderView.jsx

View workflow job for this annotation

GitHub Actions / Build and publish

Unexpected console statement
console.log('==========')

Check warning on line 163 in src/modules/views/Public/PublicFolderView.jsx

View workflow job for this annotation

GitHub Actions / Build and publish

Unexpected console statement

return (
<Main isPublic={true}>
<ModalStack />
Expand Down Expand Up @@ -209,7 +213,7 @@ const PublicFolderView = () => {
displayedFolder={displayedFolder}
isSelectionBarVisible={isSelectionBarVisible}
>
<FabWithMenuContext noSidebar={true} />
<FabWithAddMenuContext noSidebar={true} />
</AddMenuProvider>
)}
<Outlet />
Expand Down

0 comments on commit 6629104

Please sign in to comment.