react-instantsearch icon indicating copy to clipboard operation
react-instantsearch copied to clipboard

feat(poweredBy): add `theme` property

Open shortcuts opened this issue 3 years ago • 4 comments

Summary

Similar implementation as in InstantSearch.js

  • Adds a new theme prop to the poweredBy 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

shortcuts avatar Apr 21 '21 14:04 shortcuts

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

codesandbox-ci[bot] avatar Apr 21 '21 14:04 codesandbox-ci[bot]

: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

algobot avatar Apr 21 '21 14:04 algobot

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

shortcuts avatar Apr 22 '21 10:04 shortcuts

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 avatar Jun 07 '21 10:06 shortcuts

@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.

sarahdayan avatar Dec 22 '22 15:12 sarahdayan