Skip to content

Commit

Permalink
feat(HarvestBanner): Adjust style for desktop and mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
JF-Cozy committed Aug 29, 2024
1 parent c613d58 commit dddbde9
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 9 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
"cozy-device-helper": "^2.7.0",
"cozy-doctypes": "1.85.4",
"cozy-flags": "4.0.0",
"cozy-harvest-lib": "29.0.0",
"cozy-harvest-lib": "^29.0.0",
"cozy-intent": "^2.22.0",
"cozy-keys-lib": "6.0.0",
"cozy-logger": "1.9.1",
Expand All @@ -99,7 +99,7 @@
"cozy-scripts": "^8.3.0",
"cozy-sharing": "15.0.3",
"cozy-stack-client": "^48.12.0",
"cozy-ui": "111.8.1",
"cozy-ui": "^111.8.1",
"date-fns": "1.30.1",
"diacritics": "1.3.0",
"filesize": "3.6.1",
Expand Down
17 changes: 14 additions & 3 deletions src/modules/views/Drive/HarvestBanner.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ import React from 'react'
import { useQuery, isQueryLoading, Q } from 'cozy-client'
import { LaunchTriggerCard } from 'cozy-harvest-lib'
import Divider from 'cozy-ui/transpiled/react/Divider'
import { useBreakpoints } from 'cozy-ui/transpiled/react/providers/Breakpoints'

import useDocument from 'components/useDocument'
import { buildTriggersQueryByAccountId, buildFileByIdQuery } from 'queries'

const HarvestBanner = ({ folderId }) => {
const folder = useDocument('io.cozy.files', folderId)
const { isMobile } = useBreakpoints()

let konnectorSlug = undefined
let accountId = undefined
Expand Down Expand Up @@ -40,20 +42,29 @@ const HarvestBanner = ({ folderId }) => {
singleDocData: true
}
)

if (!konnector.data || konnector.data.length === 0 || isTriggersLoading) {
return null
}

return (
<>
<div className="u-mh-0-s u-mb-0-s u-mh-2 u-mb-1">
<LaunchTriggerCard
flowProps={{
initialTrigger: triggers[0],
konnector: konnector.data
}}
konnectorRoot={`harvest/${konnectorSlug}`}
/>
<Divider />
</>
{isMobile && (
<Divider
style={{
height: 12,
backgroundColor: 'var(--defaultBackgroundColor)'
}}
/>
)}
</div>
)
}

Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6393,7 +6393,7 @@ cozy-flags@^2.8.7:
dependencies:
microee "^0.0.6"

[email protected]:
cozy-harvest-lib@^29.0.0:
version "29.0.0"
resolved "https://registry.yarnpkg.com/cozy-harvest-lib/-/cozy-harvest-lib-29.0.0.tgz#67a1c2943c1612320fade04e395695602d24c82a"
integrity sha512-6r+G0cZrd2j2NZZAoO2QNE7gdPTYKEgt88hi5XDfmmLOgCcE53pE22f0SGAwoUvf0dH87rIrn57uAPQrQQZlbQ==
Expand Down Expand Up @@ -6666,7 +6666,7 @@ [email protected]:
resolved "https://registry.yarnpkg.com/cozy-tsconfig/-/cozy-tsconfig-1.2.0.tgz#17e61f960f139fae4d26cbac2254b9ab632b269e"
integrity sha512-TRHnY9goF3FzVlUbP7BcHxuN2XAA4AmppT4fHHZmTKaSwYTByVR1Al+riFMDbce94kJZ1wzl9WNLWQuqzGZ6Cw==

[email protected]:
cozy-ui@^111.8.1:
version "111.8.1"
resolved "https://registry.yarnpkg.com/cozy-ui/-/cozy-ui-111.8.1.tgz#589f6743811bbb0ec1e0e8ff55d65337e4752f23"
integrity sha512-jbDCUlatd1djQe5kZ0P7eufiWcf3Sm6LuKOsoAPLCppPb849ywd6cdkVkYRkt+Hzpe7k0b1sZ0+/CRg+L3Fyaw==
Expand Down Expand Up @@ -13125,9 +13125,9 @@ msgpack5@^4.0.2:
readable-stream "^2.3.6"
safe-buffer "^5.1.2"

"mui-bottom-sheet@https://github.com/cozy/mui-bottom-sheet.git#v1.0.9":
"mui-bottom-sheet@git+https://github.com/cozy/mui-bottom-sheet.git#v1.0.9":
version "1.0.8"
resolved "https://github.com/cozy/mui-bottom-sheet.git#3dc4c2a245ab39079bc2f73546bccf80847be14c"
resolved "git+https://github.com/cozy/mui-bottom-sheet.git#3dc4c2a245ab39079bc2f73546bccf80847be14c"
dependencies:
"@juggle/resize-observer" "^3.1.3"
jest-environment-jsdom-sixteen "^1.0.3"
Expand Down

0 comments on commit dddbde9

Please sign in to comment.