Skip to content
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

fix(types): fix cssClasses of voiceSearch #3783

Merged
merged 4 commits into from May 20, 2019

Conversation

eunjae-lee
Copy link
Contributor

Summary

This allows the widget can accept an array of string as css classes.
This was missing in the first place, allowing only strings.

@eunjae-lee eunjae-lee requested a review from a team May 17, 2019 14:39
@ghost ghost requested review from Haroenv and tkrugg and removed request for a team May 17, 2019 14:39
@eunjae-lee
Copy link
Contributor Author

fixing the lint errors now..

Copy link
Contributor

@Haroenv Haroenv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

linting is failing though 🤔

@algobot
Copy link
Contributor

algobot commented May 17, 2019

Deploy preview for instantsearchjs ready!

Built with commit c8fb656

https://deploy-preview-3783--instantsearchjs.netlify.com

@eunjae-lee
Copy link
Contributor Author

Here's a headache. The reason why the lint failed is because the type of cssClasses changes.

At the widget, cssClasses should be

export type VoiceSearchCSSClasses = {
  root: string | string[];
  button: string | string[];
  status: string | string[];
};

At the component, cssClasses should be

export type VoiceSearchComponentCSSClasses = {
  root: string;
  button: string;
  status: string;
};

Here, cssClasses are being modified from VoiceSearchCSSClasses to VoiceSearchComponentCSSClasses, but at the renderer it's still inferred as VoiceSearchCSSClasses because of the type of the widget params.

So as a workaround, I casted cssClasses to VoiceSearchComponentCSSClasses at rendering the component.

Do you have any better idea?

@eunjae-lee eunjae-lee changed the title type(voiceSearch): fix cssClasses fix(types): fix cssClasses of voiceSearch May 20, 2019
@eunjae-lee eunjae-lee merged commit f016326 into develop May 20, 2019
@eunjae-lee eunjae-lee deleted the type/fix-voice-search-css-classes branch May 20, 2019 12:52
Haroenv added a commit that referenced this pull request May 28, 2019
* **getTag:** ([#3820](#3820)) ([a7348ea](a7348ea))
* **types:** fix cssClasses of voiceSearch ([#3783](#3783)) ([f016326](f016326))
Haroenv added a commit that referenced this pull request May 28, 2019
## [3.5.3](v3.5.2...v3.5.3) (2019-05-28)

### Bug Fixes
* **voiceSearch:** let the connector handle the default value of searchAsYouSpeak when it's not given ([#3817](#3817)) ([9d3e91b](9d3e91b))
* **getTag:** use object version of toString ([#3820](#3820)) ([a7348ea](a7348ea))
* **types:** fix cssClasses of voiceSearch ([#3783](#3783)) ([f016326](f016326))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants