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

feat: reuse config index name as default sort option #137

Merged
merged 2 commits into from
Jul 23, 2020

Conversation

sarahdayan
Copy link
Member

@sarahdayan sarahdayan commented Jul 22, 2020

Currently, we're repeating the default index name twice in the config file: under index.indexName and under sorts as the first (default) sort-by option. We can remove this and instead reuse index.indexName within the Search component.

Note that I didn't keep the default label in the configuration to avoid making it more complex than it needs to be. In case users need to change it (which is possible but probably won't happen that much), they can search it through the project and change it without much trouble.

I've also changed the condition for displaying the sorts (more than one vs. more than none) because we don't need to show the widget if we only have the default sorting.

src/components/Search.js Outdated Show resolved Hide resolved
Co-authored-by: François Chalifour <francoischalifour@users.noreply.github.com>
@sarahdayan sarahdayan merged commit be54236 into next Jul 23, 2020
@sarahdayan sarahdayan deleted the feat/default-sort branch July 23, 2020 16:27
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

2 participants