Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 34 additions & 13 deletions src/components/NotePage/NoteList/NoteList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import styled from '../../../lib/styled'
import {
borderBottom,
inputStyle,
iconColor
iconColor,
selectTabStyle
} from '../../../lib/styled/styleFunctions'
import { IconEdit, IconLoupe, IconArrowSingleDown } from '../../icons'

Expand Down Expand Up @@ -64,6 +65,28 @@ export const StyledNoteListContainer = styled.div`
}
}

.filterTab {
height: 25px;
display: flex;
align-items: center;
padding-left: 13px;
.filterIcon {
font-size: 10px;
margin-right: 5px;
z-index: 0;
pointer-events: none;
${iconColor}
}
.input {
${selectTabStyle}
}
select {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
}
}

.newNoteButton {
width: 35px;
height: 30px;
Expand Down Expand Up @@ -154,18 +177,16 @@ const NoteList = ({
</button>
)}
</div>
<div className='control'>
<div className='searchInput'>
<IconArrowSingleDown className='icon' size='0.8em' />
<select
className='input'
onChange={e => setSort(e.target.value as SortProps)}
>
<option value='updatedAt'>Updated</option>
<option value='createdAt'>Created</option>
<option value='title'>Title</option>
</select>
</div>
<div className='filterTab'>
<IconArrowSingleDown className='filterIcon' size='0.8em' />
<select
className='input'
onChange={e => setSort(e.target.value as SortProps)}
>
<option value='updatedAt'>Updated</option>
<option value='createdAt'>Created</option>
<option value='title'>Title</option>
</select>
</div>
<ul tabIndex={0} onKeyDown={handleListKeyDown} ref={listRef}>
{sortedNotes.map(note => {
Expand Down
14 changes: 14 additions & 0 deletions src/lib/styled/styleFunctions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,20 @@ color: ${theme.textColor};
}
`

export const selectTabStyle = ({ theme }: StyledProps) =>
`background-color: ${theme.backgroundColor};
border: none;
color: ${theme.uiTextColor};
cursor: pointer;
font-weight: 400;
&:hover,
&:focus,
&:active,
&.active{
color: ${theme.textColor};
}
`

export const primaryButtonStyle = ({ theme }: StyledProps) => `border: none;
background-color: ${theme.primaryColor};
color: ${theme.primaryButtonLabelColor};
Expand Down