Skip to content

Commit

Permalink
feat: wrap search option bubbles if not enough space (#918)
Browse files Browse the repository at this point in the history
  • Loading branch information
amanharwara committed Mar 10, 2022
1 parent b31afee commit be6a9fd
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 16 deletions.
3 changes: 1 addition & 2 deletions app/assets/javascripts/components/Bubble.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ const styles = {

const Bubble = ({ label, selected, onSelect }: BubbleProperties) => (
<span
role="tab"
className={`bubble ${styles.base} ${
className={`${styles.base} ${
selected ? styles.selected : styles.unselected
}`}
onClick={onSelect}
Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/components/NotesView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ export const NotesView: FunctionComponent<Props> = observer(
</button>
</div>
<div className="filter-section" role="search">
<div>
<div className="relative">
<input
type="text"
id="search-bar"
Expand Down
6 changes: 1 addition & 5 deletions app/assets/javascripts/components/SearchOptions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@ export const SearchOptions = observer(({ appState }: Props) => {
}

return (
<div
role="tablist"
className="search-options justify-center"
onMouseDown={(e) => e.preventDefault()}
>
<div className="search-options" onMouseDown={(e) => e.preventDefault()}>
<Bubble
label="Protected Contents"
selected={includeProtectedContents}
Expand Down
12 changes: 4 additions & 8 deletions app/assets/stylesheets/_notes.scss
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@

.filter-section {
clear: left;
max-height: 80px;
margin-top: 10px;
position: relative;
display: flex;
Expand All @@ -77,14 +76,11 @@
.search-options {
margin-top: 10px;

display: grid;
grid-template-columns: repeat( 3, 1fr );
gap: .5rem;
display: flex;
flex-wrap: wrap;
gap: 0.5rem;

font-size: var(--sn-stylekit-font-size-p);
white-space: nowrap;

overflow-x: auto;
}

#search-clear-button {
Expand All @@ -100,7 +96,7 @@
line-height: 17px;
text-align: center;
position: absolute;
top: 20%;
top: 50%;
transform: translateY(-50%);
right: 10px;
cursor: pointer;
Expand Down

0 comments on commit be6a9fd

Please sign in to comment.