Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#386 add tags component #426

Merged
merged 9 commits into from
Aug 18, 2024
Merged

#386 add tags component #426

merged 9 commits into from
Aug 18, 2024

Conversation

Jasminamih
Copy link
Contributor

No description provided.

Copy link

vercel bot commented Jul 17, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
app ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 18, 2024 8:43pm

Copy link
Contributor

@edichoska edichoska left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The functionality is working as intended. I also like that we are able to remove the element from the modal and it removes it from the screen as well.
Just the small eslint fixes and we are good.

Comment on lines 34 to 44
const addTag = (tag: string) => {
if (!selectedTags.includes(tag)) {
setSelectedTags([...selectedTags, tag]);
}
setSearchTag('');
setFilteredTags([]);
};

const removeTag = (tag: string) => {
setSelectedTags(selectedTags.filter((item) => item !== tag));
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To avoid issues with stale state, we should use the snapshot of the most recent state. something like: setSelectedTags((prevTags) ....

};

return (
<div className={styles.modalWrapper}>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the reusable modal here

components/reusable-components/tags-modal/TagsModal.tsx Outdated Show resolved Hide resolved
Copy link
Contributor

@edichoska edichoska left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you attach a screenshot of how the UI looks? And also implement it so we can test it if it works as intended.

@edichoska edichoska linked an issue Aug 18, 2024 that may be closed by this pull request
@edichoska edichoska merged commit ac40269 into staging Aug 18, 2024
2 of 3 checks passed
@edichoska edichoska deleted the #386-Add-tags-component branch August 18, 2024 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FE] Add tags component
2 participants