-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Now need to work on scaffold net settings
- Loading branch information
1 parent
faa3088
commit b8a58e9
Showing
7 changed files
with
115 additions
and
20 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { useState } from "react"; | ||
|
||
const TagComponent = ({ tags, onClick }) => { | ||
const [selectedTag, setSelectedTag] = useState(null); | ||
|
||
const toggleTag = (tag) => { | ||
setSelectedTag(tag === selectedTag ? null : tag); | ||
onClick(tag === selectedTag ? null : tag); | ||
}; | ||
|
||
return ( | ||
<div className="tag-container"> | ||
{tags.map((tag, index) => ( | ||
<span | ||
key={index} | ||
className={`tag ${tag === selectedTag ? 'selected' : ''}`} | ||
onClick={() => toggleTag(tag)} | ||
> | ||
{tag} | ||
</span> | ||
))} | ||
</div> | ||
); | ||
}; | ||
|
||
export default TagComponent; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* TagComponent.css */ | ||
|
||
.tag-container { | ||
display: flex; | ||
flex-wrap: wrap; | ||
} | ||
|
||
.tag { | ||
cursor: pointer; | ||
background-color: var(--background-color); | ||
color: var(--text-color); | ||
padding: 5px 10px; | ||
margin: 5px; | ||
border-radius: 5px; | ||
border: 1px solid var(--border-color); | ||
} | ||
|
||
.tag:hover { | ||
background-color: var(--hover-accent-color); | ||
color: var(--text-color); | ||
} | ||
|
||
.selected { | ||
background-color: var(--accent-color); | ||
color: var(--text-opp-color); | ||
} |