-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Import assistant and search components from cozy-dataproxy-lib
Add wrapper to manage style and props to pass.
- Loading branch information
Showing
6 changed files
with
88 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import React from 'react' | ||
|
||
import CozyTheme from 'cozy-ui/transpiled/react/providers/CozyTheme' | ||
|
||
import { AssistantDesktop } from 'cozy-dataproxy-lib' | ||
|
||
export const AssistantDesktopWrapper = () => { | ||
return ( | ||
<CozyTheme variant="normal"> | ||
<div className="app-list-wrapper u-mh-auto u-mb-3"> | ||
<AssistantDesktop | ||
componentsProps={{ | ||
SearchBarDesktop: { | ||
elevation: true, | ||
hasHalfBorderRadius: true | ||
} | ||
}} | ||
/> | ||
</div> | ||
</CozyTheme> | ||
) | ||
} | ||
|
||
export default AssistantDesktopWrapper |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import cx from 'classnames' | ||
import React from 'react' | ||
|
||
import { getFlagshipMetadata } from 'cozy-device-helper' | ||
import flag from 'cozy-flags' | ||
|
||
import CozyTheme, { | ||
useCozyTheme | ||
} from 'cozy-ui/transpiled/react/providers/CozyTheme' | ||
|
||
import styles from './styles.styl' | ||
|
||
import { useWallpaperContext } from 'hooks/useWallpaperContext' | ||
import { AssistantMobile } from 'cozy-dataproxy-lib' | ||
|
||
export const AssistantMobileWrapper = () => { | ||
const { type } = useCozyTheme() | ||
|
||
const { | ||
data: { isCustomWallpaper } | ||
} = useWallpaperContext() | ||
|
||
return ( | ||
<CozyTheme variant="normal"> | ||
<div | ||
className={cx(styles['mobile-assistant'], { | ||
[styles[`mobile-assistant--${type}`]]: !isCustomWallpaper, | ||
[styles['mobile-assistant--offset']]: flag('home.fab.button.enabled'), | ||
[styles['mobile-assistant--immersive']]: | ||
getFlagshipMetadata().immersive | ||
})} | ||
> | ||
<AssistantMobile isCustomWallpaper={isCustomWallpaper} /> | ||
</div> | ||
</CozyTheme> | ||
) | ||
} | ||
|
||
export default AssistantMobileWrapper |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
.mobile-assistant | ||
position fixed | ||
bottom 0 | ||
right 0 | ||
left 0 | ||
padding 1rem | ||
|
||
&--light | ||
background-color #E9F4FF | ||
|
||
&--dark | ||
background-color #142536 | ||
|
||
&--offset | ||
padding-right 4.5rem | ||
|
||
&--immersive | ||
padding-bottom calc(1rem + var(--flagship-bottom-height)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters