-
Notifications
You must be signed in to change notification settings - Fork 508
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
487d98a
commit 3b967a5
Showing
7 changed files
with
72 additions
and
70 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
.segment { | ||
display: flex; | ||
justify-self: flex-start; | ||
width: 70%; | ||
border: 2px solid #ccc; | ||
} | ||
|
||
.segmentBtn { | ||
background-color: var(--shadow-footer); | ||
width: 50%; | ||
border: none; | ||
text-transform: capitalize; | ||
|
||
&[data-active='true'] { | ||
background-color: rgb(75, 75, 255); | ||
border: none; | ||
padding: 10px 20px; | ||
border-radius: 5px; | ||
cursor: pointer; | ||
color: white; | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { ETag } from '@fmc/data/types'; | ||
import styles from './tags.module.scss'; | ||
|
||
interface Props { | ||
tag: ETag; | ||
setTag: React.Dispatch<React.SetStateAction<ETag>>; | ||
setSelectedChallengesByTags: React.Dispatch<React.SetStateAction<ETag[] | []>>; | ||
} | ||
|
||
function Tags({ tag, setTag, setSelectedChallengesByTags }: Props) { | ||
return ( | ||
<div className={styles.segment}> | ||
{Object.entries(ETag).map(([key, value]) => ( | ||
<button | ||
data-active={tag === value} | ||
className={styles.segmentBtn} | ||
key={key} | ||
onClick={() => { | ||
setTag(value); | ||
setSelectedChallengesByTags([value]); | ||
}} | ||
> | ||
{value} | ||
</button> | ||
))} | ||
</div> | ||
); | ||
} | ||
|
||
export default Tags; |
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
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