Skip to content

Commit

Permalink
feat: Upgrade cozy-sharing and apply BC
Browse files Browse the repository at this point in the history
And add `syncToCozySharingLink` with `addToCozySharingLink`
  • Loading branch information
Merkur39 committed Jan 27, 2025
1 parent 1bad864 commit 24321a9
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
"cozy-keys-lib": "^6.2.0",
"cozy-logger": "^1.16.1",
"cozy-realtime": "^5.6.1",
"cozy-sharing": "^20.0.0",
"cozy-sharing": "^21.2.0",
"cozy-stack-client": "^51.0.0",
"cozy-ui": "^116.0.0",
"eventemitter2": "4.1.2",
Expand Down
4 changes: 2 additions & 2 deletions src/components/app.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ const PublicContext = () => {
const [sharedDocumentId, setSharedDocumentId] = useState(null)
const [readOnly, setReadOnly] = useState(false)
const returnUrl = useMemo(() => getReturnUrl(), [])
const { loading, isSharingShortcutCreated, discoveryLink } =
const { loading, isSharingShortcutCreated, addSharingLink } =
useSharingInfos(SHARING_LOCATION)
const isPreview = usePreview(window.location.pathname)
const isAddToMyCozyFabDisplayed =
Expand Down Expand Up @@ -135,7 +135,7 @@ const PublicContext = () => {
/>
{isAddToMyCozyFabDisplayed && (
<OpenSharingLinkFabButton
link={discoveryLink}
link={addSharingLink}
isSharingShortcutCreated={isSharingShortcutCreated}
style={openSharingLinkFabButtonStyle}
/>
Expand Down
11 changes: 6 additions & 5 deletions src/components/notes/EditorCorner.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import React from 'react'

import {
useSharingInfos,
openSharingLink,
addToCozySharingLink,
syncToCozySharingLink,
OpenSharingLinkButton
} from 'cozy-sharing'
import { makeActions } from 'cozy-ui/transpiled/react/ActionsMenu/Actions'
Expand Down Expand Up @@ -38,13 +39,13 @@ const ForwardedIcon = React.forwardRef(function ForwardedIcon(props, ref) {
const EditorCorner = ({ isPublic, isReadOnly, title, file }) => {
const { t } = useI18n()
const { isMobile } = useBreakpoints()
const { discoveryLink, isSharingShortcutCreated, loading } =
const { addSharingLink, isSharingShortcutCreated, loading } =
useSharingInfos(SHARING_LOCATION)
const isPreview = usePreview(window.location.pathname)

const actions = makeActions([isPublic && openSharingLink], {
const actions = makeActions([addToCozySharingLink, syncToCozySharingLink], {
isSharingShortcutCreated,
link: discoveryLink
addSharingLink
})

if (!isPublic) {
Expand All @@ -58,7 +59,7 @@ const EditorCorner = ({ isPublic, isReadOnly, title, file }) => {
<>
{isToolbarButtonsDisplayed && (
<OpenSharingLinkButton
link={discoveryLink}
link={addSharingLink}
isSharingShortcutCreated={isSharingShortcutCreated}
/>
)}
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7957,10 +7957,10 @@ cozy-scripts@^8.3.0:
webpack-dev-server "3.10.3"
webpack-merge "4.2.2"

cozy-sharing@^20.0.0:
version "20.0.0"
resolved "https://registry.yarnpkg.com/cozy-sharing/-/cozy-sharing-20.0.0.tgz#75e8da9ba586e5246ab61a492cef5ca76a2a2018"
integrity sha512-fq9ah106L+BFsr8BuGLMw1JNjqieYaDA4y/AHMvt2UbuDUGOkwGJ/evhedastPaxJY0faga+HkKNNX4TzNqo8A==
cozy-sharing@^21.2.0:
version "21.2.0"
resolved "https://registry.yarnpkg.com/cozy-sharing/-/cozy-sharing-21.2.0.tgz#d40e843950fc3f85243349dea0b0a3065ccb77a0"
integrity sha512-7Nb/Rrt8e43p95JnCmHGWbFCpjnw7w4vFeuK2jQay0szW19ZapSolW5sp8lDLzTs2QpKp3GgEO/T/Bh3ERV9Lg==
dependencies:
"@cozy/minilog" "^1.0.0"
classnames "^2.2.6"
Expand Down

0 comments on commit 24321a9

Please sign in to comment.