File tree Expand file tree Collapse file tree 2 files changed +25
-21
lines changed Expand file tree Collapse file tree 2 files changed +25
-21
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ import ShortcutCreateModal from './Shortcuts/ShortcutCreateModal'
1313 *
1414 * @returns {JSX.Element } The rendered AddTile component.
1515 */
16- const AddTile = ( ) => {
16+ const AddTile = ( { isStoreAvailable } ) => {
1717 const client = useClient ( )
1818 const nativePath = '/discover'
1919 const slug = 'store'
@@ -38,25 +38,29 @@ const AddTile = () => {
3838 )
3939 }
4040
41- return (
42- < AppLinker
43- app = { { slug : 'store' } }
44- nativePath = { nativePath }
45- href = { generateWebLink ( {
46- pathname : '/' ,
47- cozyUrl : cozyURL . origin ,
48- slug,
49- hash : nativePath ,
50- subDomainType
51- } ) }
52- >
53- { ( { onClick, href } ) => (
54- < a onClick = { onClick } href = { href } className = { styles [ 'scale-hover' ] } >
55- < SquareAppIcon name = { t ( 'add_service' ) } variant = "add" />
56- </ a >
57- ) }
58- </ AppLinker >
59- )
41+ if ( isStoreAvailable ) {
42+ return (
43+ < AppLinker
44+ app = { { slug : 'store' } }
45+ nativePath = { nativePath }
46+ href = { generateWebLink ( {
47+ pathname : '/' ,
48+ cozyUrl : cozyURL . origin ,
49+ slug,
50+ hash : nativePath ,
51+ subDomainType
52+ } ) }
53+ >
54+ { ( { onClick, href } ) => (
55+ < a onClick = { onClick } href = { href } className = { styles [ 'scale-hover' ] } >
56+ < SquareAppIcon name = { t ( 'add_service' ) } variant = "add" />
57+ </ a >
58+ ) }
59+ </ AppLinker >
60+ )
61+ }
62+
63+ return null
6064}
6165
6266export default AddTile
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ export const ApplicationsAndServices = () => {
3636 < EntrypointLink key = { entrypoint . name } entrypoint = { entrypoint } />
3737 ) ) }
3838 { isMobile && flag ( 'cozy.assistant.enabled' ) && < AssistantTile /> }
39- { isStoreAvailable && < AddTile /> }
39+ < AddTile isStoreAvailable = { isStoreAvailable } />
4040 { showLogout && < LogoutTile /> }
4141 </ div >
4242 </ div >
You can’t perform that action at this time.
0 commit comments