Skip to content

Commit

Permalink
feat(Assistant): Use new SearchBar
Browse files Browse the repository at this point in the history
  • Loading branch information
JF-Cozy committed Oct 16, 2024
1 parent 59bf991 commit c758d0c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/assistant/AssistantWrapperDesktop.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import flag from 'cozy-flags'

import { useBreakpoints } from 'cozy-ui/transpiled/react/providers/Breakpoints'

import AssistantBar from 'assistant/AssistantBar'
import SearchBar from './Search/SearchBar'

const AssistantWrapperDesktop = () => {
const { isMobile } = useBreakpoints()
Expand All @@ -12,7 +12,7 @@ const AssistantWrapperDesktop = () => {

return (
<div className="app-list-wrapper u-mb-3 u-mh-auto u-w-100">
<AssistantBar />
<SearchBar />
</div>
)
}
Expand Down
18 changes: 16 additions & 2 deletions src/assistant/AssistantWrapperMobile.jsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
import React from 'react'
import { useNavigate } from 'react-router-dom'
import flag from 'cozy-flags'
import cx from 'classnames'

import { getFlagshipMetadata } from 'cozy-device-helper'
import { useBreakpoints } from 'cozy-ui/transpiled/react/providers/Breakpoints'
import { useCozyTheme } from 'cozy-ui/transpiled/react/providers/CozyTheme'
import SearchBar from 'cozy-ui/transpiled/react/SearchBar'
import Icon from 'cozy-ui/transpiled/react/Icon'
import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n'

import AssistantBar from 'assistant/AssistantBar'
import AssistantIcon from 'assets/images/icon-assistant.png'

import styles from './styles.styl'

export const AssistantWrapperMobile = () => {
const { isMobile } = useBreakpoints()
const { type } = useCozyTheme()
const { t } = useI18n()
const navigate = useNavigate()

if (!flag('cozy.assistant.enabled') || !isMobile) return null

Expand All @@ -30,7 +36,15 @@ export const AssistantWrapperMobile = () => {
}
)}
>
<AssistantBar />
<SearchBar
size="medium"
icon={
<Icon className="u-ml-1 u-mr-half" icon={AssistantIcon} size={24} />
}
type="button"
label={t('assistant.search.placeholder')}
onClick={() => navigate('search')}
/>
</div>
)
}
Expand Down

0 comments on commit c758d0c

Please sign in to comment.