This repository has been archived by the owner on Feb 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 63
Use links instead of buttons for header search type switcher #1131
Merged
Merged
Changes from 4 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
92f8ef4
Convert search type buttons in the header to links
obulat 710e40c
Temporarily replace the method that is only available in refactored s…
obulat 4e53013
Add pot file
obulat e3a3f8c
Merge branch 'main' into use_links_for_header_search_type_switcher
obulat 5a07f7c
Apply suggestions from code review
obulat 158a8db
Apply changes from code review
obulat 8ef03b3
Merge branch 'main' into use_links_for_header_search_type_switcher
obulat File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,7 @@ | |
:item="item" | ||
:item-id="idx" | ||
:icon="content.icons[item]" | ||
:is-in-header="placement === 'header'" | ||
:selected="item === activeItem" | ||
@click="handleClick(item)" | ||
/> | ||
|
@@ -46,6 +47,10 @@ export default defineComponent({ | |
required: true, | ||
validator: (val) => supportedSearchTypes.includes(val), | ||
}, | ||
placement: { | ||
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. Like I mentioned earlier, I think a name that indicates the internal component behavior is better than one that refers to the external context. |
||
type: String, | ||
required: true, | ||
}, | ||
}, | ||
setup(props, { emit }) { | ||
const content = useSearchType() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This props like these I always wonder whether continue to drill them down or switching to using
provide/inject
would make more sense. I guess this is probably easier to test. It also crosses my mind "at what point does one decide to turn the enum into a boolean" in this case. For example, why pass the boolean here instead of passing placement directly which can then be evaluated by the component?I don't have good answers for these though 😛
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.
Thank you for this comment, @sarayourfriend ! I have also thought about replacing props drilling with
provide/inject
, but decided against it for one single prop.