react-instantsearch
react-instantsearch copied to clipboard
feat(poweredBy): add `theme` property
Summary
Similar implementation as in InstantSearch.js
- Adds a new
theme
prop to thepoweredBy
component to handle dark mode. - Updates the Algolia logo
Result
Changes the logo/text color when theme="dark"
is passed to the component
closes https://github.com/algolia/react-instantsearch/issues/3044
This pull request is automatically built and testable in CodeSandbox.
To see build info of the built libraries, click here or the icon next to each commit SHA.
Latest deployment of this branch, based on commit 0fdf673a21f1bad90c87b6700f4c17a9d78a4f7f:
Sandbox | Source |
---|---|
react-instantsearch-app | Configuration |
routing-basic | Configuration |
:heavy_check_mark: Deploy Preview for react-instantsearch ready!
:hammer: Explore the source changes: 0fdf673a21f1bad90c87b6700f4c17a9d78a4f7f
:mag: Inspect the deploy log: https://app.netlify.com/sites/react-instantsearch/deploys/60bde842625da400074194eb
:sunglasses: Browse the preview: https://deploy-preview-3045--react-instantsearch.netlify.app
Do we really need to change the API to support dark themes? Can't this be solved with CSS?
The API will be different from other InstantSearch flavors now.
This implementation is the same as in the InstantSearch.js PoweredBy component
It doesn't seem to work as expected on dark mode: See story.
@francoischalifour @Haroenv It seems like the issue is related to storybook not picking the changes locally.
Importing the component with import { PoweredBy } from '../packages/react-instantsearch-dom'
in PoweredBy.stories.js
actually show the changes.
https://user-images.githubusercontent.com/20689156/120993692-16f99d00-c784-11eb-9a84-135371e4928e.mov
@shortcuts We're in the process of moving algolia/react-instantsearch
to our InstantSearch monorepo. This PR won't be transferrable, so I'll close it here, but please feel free to reopen it once the migration is done.