-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use assistant (search and AI) from cozy-dataproxy-lib #3266
Changes from all commits
a09b489
17ee2be
0b35de0
73106a5
5a84c68
c15c634
b53265f
2015e54
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ import React from 'react' | |
import { Provider } from 'react-redux' | ||
|
||
import { BarProvider } from 'cozy-bar' | ||
import { DataProxyProvider } from 'cozy-dataproxy-lib' | ||
import { WebviewIntentProvider } from 'cozy-intent' | ||
|
||
import PushBannerProvider from 'components/PushBanner/PushBannerProvider' | ||
|
@@ -28,7 +29,13 @@ const App = ({ isPublic, store, client, lang, polyglot, children }) => { | |
<PushBannerProvider> | ||
<AcceptingSharingProvider> | ||
<ThumbnailSizeContextProvider> | ||
<ModalContextProvider>{children}</ModalContextProvider> | ||
<ModalContextProvider> | ||
{isPublic ? ( | ||
children | ||
) : ( | ||
<DataProxyProvider>{children}</DataProxyProvider> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. je crois qu'on gère les providers public autrement 🤔 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Je suis pas hyper fan de cette solution mais j'ai pas trouvé de meilleur endroit. En regardant le code la seule différence que j'ai vu entre public et non public c'est la prop isPublic pour la target public |
||
)} | ||
</ModalContextProvider> | ||
</ThumbnailSizeContextProvider> | ||
</AcceptingSharingProvider> | ||
</PushBannerProvider> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,21 @@ | ||
import React from 'react' | ||
|
||
import { BarSearch } from 'cozy-bar' | ||
import { AssistantDesktop } from 'cozy-dataproxy-lib' | ||
import useBreakpoints from 'cozy-ui/transpiled/react/providers/Breakpoints' | ||
import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n' | ||
|
||
import BarSearchAutosuggest from 'modules/search/components/BarSearchAutosuggest' | ||
|
||
const AppBarSearch = () => { | ||
const { t } = useI18n() | ||
const { isMobile } = useBreakpoints() | ||
|
||
return <BarSearch>{!isMobile && <BarSearchAutosuggest t={t} />}</BarSearch> | ||
return ( | ||
<BarSearch> | ||
{!isMobile && ( | ||
<AssistantDesktop | ||
componentsProps={{ SearchBarDesktop: { size: 'small' } }} | ||
/> | ||
)} | ||
</BarSearch> | ||
) | ||
} | ||
|
||
export default AppBarSearch |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pourquoi fait-on ça ? Un commentaire serait bienvenu je pense. Est-ce qu'on devrait généraliser l'approche à toutes les libs ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deux raisons :
Pas sûr que ce soit généralisable.