diff --git a/src/components/ShortcutLink.jsx b/src/components/ShortcutLink.jsx index a75cade9b..9b0c11db7 100644 --- a/src/components/ShortcutLink.jsx +++ b/src/components/ShortcutLink.jsx @@ -1,7 +1,7 @@ import React from 'react' import get from 'lodash/get' -import { useClient, useFetchShortcut } from 'cozy-client' +import { useClient, useFetchShortcut, useInstanceInfo } from 'cozy-client' import { CozyFile } from 'cozy-doctypes' import SquareAppIcon from 'cozy-ui/transpiled/react/SquareAppIcon' @@ -22,8 +22,9 @@ export const ShortcutLink = ({ // waiting an http request to resolve. const { shortcutInfos } = useFetchShortcut(client, file._id) const { isMobile } = useBreakpoints() - const computedSize = isMobile ? 32 : desktopSize + const instanceInfo = useInstanceInfo() + const computedSize = isMobile ? 32 : desktopSize const { filename } = CozyFile.splitFilename(file) const url = get(shortcutInfos, 'data.attributes.url', '#') @@ -34,6 +35,8 @@ export const ShortcutLink = ({ const icon = get(file, 'attributes.metadata.icon') const iconMimeType = get(file, 'attributes.metadata.iconMimeType') const description = get(file, 'attributes.metadata.description') + const shouldShortcutBadgeHidden = + instanceInfo.context?.data?.hide_shortcut_badge_on_home ?? false return ( } + hideShortcutBadge={shouldShortcutBadgeHidden} /> ) : ( )}