Add black border to tag filter

This commit is contained in:
Tanner Collin 2022-04-26 20:27:26 +00:00
parent 0aeecdcbba
commit 5d3ab17f74
3 changed files with 62 additions and 32 deletions

View File

@ -155,6 +155,9 @@ function NewClassTable(props) {
{name} {name}
</Label> </Label>
)} )}
<p/>
<p>No upcoming classes.</p>
</Segment> </Segment>
)} )}
</div> </div>
@ -275,32 +278,42 @@ export function Classes(props) {
<p> <p>
Filter by tag: Filter by tag:
<div className='coursetags'> <div className='coursetags'>
{Object.entries(tags).map(([name, color]) => <div
className='labelbox'
style={{borderColor: tagFilter === false ? 'black' : 'transparent'}}
>
<Label <Label
onClick={() => { onClick={() => {
setTagFilter(name); setTagFilter(false);
tagFilterCache = name; tagFilterCache = false;
}} }}
as='a' as='a'
color={color}
tag tag
> >
{name} No Filter
</Label> </Label>
</div>
{Object.entries(tags).map(([name, color]) =>
<div
className='labelbox'
style={{borderColor: tagFilter === name ? 'black' : 'transparent'}}
>
<Label
onClick={() => {
setTagFilter(name);
tagFilterCache = name;
}}
as='a'
color={color}
tag
>
{name}
</Label>
</div>
)} )}
</div> </div>
</p> </p>
<p>
{tagFilter && <Button
onClick={() => {
setTagFilter(false);
tagFilterCache = false;
}}
>
Clear {tagFilter} filter
</Button>}
</p>
{classes.length && courses.length ? {classes.length && courses.length ?
sortByCourse ? sortByCourse ?

View File

@ -56,31 +56,42 @@ export function Courses(props) {
<p> <p>
Filter by tag: Filter by tag:
<div className='coursetags'> <div className='coursetags'>
{Object.entries(tags).map(([name, color]) => <div
className='labelbox'
style={{borderColor: tagFilter === false ? 'black' : 'transparent'}}
>
<Label <Label
onClick={() => { onClick={() => {
setTagFilter(name); setTagFilter(false);
tagFilterCache = name; tagFilterCache = false;
}} }}
as='a' as='a'
color={color}
tag tag
> >
{name} No Filter
</Label> </Label>
</div>
{Object.entries(tags).map(([name, color]) =>
<div
className='labelbox'
style={{borderColor: tagFilter === name ? 'black' : 'transparent'}}
>
<Label
onClick={() => {
setTagFilter(name);
tagFilterCache = name;
}}
as='a'
color={color}
tag
>
{name}
</Label>
</div>
)} )}
</div> </div>
</p> </p>
<p>
{tagFilter && <Button
onClick={() => {
setTagFilter(false);
tagFilterCache = false;
}}
>
Clear {tagFilter} filter
</Button>}
</p>
{courses ? {courses ?
<Table basic='very'> <Table basic='very'>

View File

@ -138,11 +138,17 @@ body {
flex-wrap: wrap; flex-wrap: wrap;
} }
.newclasstable .ui.tag.label { .ui.tag.label {
padding-left: 1rem; padding-left: 1rem;
padding-right: 0.5rem; padding-right: 0.5rem;
} }
.labelbox {
display: inline;
padding: 0.55rem 0.1rem;
border: 2px solid black;
}
.usage { .usage {
height: 100vh; height: 100vh;
background-color: black; background-color: black;