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

UI: Simplify custom Sidebar styling by adding classNames to DOM elements #13155

Merged
merged 1 commit into from
Nov 18, 2020

Conversation

tooppaaa
Copy link
Contributor

Issue:
It became difficult to add style to the sidebar

What I did

add classnames back

How to test

  • Inspect DOM

<SearchField {...getRootProps({ refKey: '' }, { suppressRefError: true })}>
<SearchField
{...getRootProps({ refKey: '' }, { suppressRefError: true })}
className="search-field"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Previously accessed using nav.container.sidebar-container form

@@ -124,7 +124,7 @@ const Result: FunctionComponent<
const nameMatch = matches.find((match: Match) => match.key === 'name');
const pathMatches = matches.filter((match: Match) => match.key === 'path');
const label = (
<div>
<div className="search-result-item--label">
Copy link
Contributor Author

Choose a reason for hiding this comment

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

invented

@@ -202,7 +202,7 @@ export const SearchResults: FunctionComponent<{
<ResultsList {...getMenuProps()}>
{results.length > 0 && !query && (
<li>
<RootNode>Recently opened</RootNode>
<RootNode className="search-result-recentlyOpened">Recently opened</RootNode>
Copy link
Contributor Author

@tooppaaa tooppaaa Nov 18, 2020

Choose a reason for hiding this comment

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

All invented in this (didn't exists before)

@@ -77,6 +77,7 @@ const Node = React.memo<NodeProps>(
<LeafNode
key={id}
id={id}
className="sidebar-item"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

already present in 6.0

<RootNode
key={id}
id={id}
className="sidebar-subheading"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

already present in 6.0

{item.name}
<Action
type="button"
className="sidebar-subheading-action"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

invented

@@ -119,6 +128,7 @@ const Node = React.memo<NodeProps>(
<BranchNode
key={id}
id={id}
className="sidebar-item"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

already present in 6.0 (they where all sidebar-item before)

@ghengeveld ghengeveld changed the title Core: add back className to sidebar elements UI: Simplify custom Sidebar styling by adding classNames to DOM elements Nov 18, 2020
@shilman shilman added this to the 6.1 search milestone Nov 18, 2020
Copy link
Member

@shilman shilman left a comment

Choose a reason for hiding this comment

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

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants