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

feat(ui): Add org settings frontend #718

Merged
merged 5 commits into from
Jan 9, 2025
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Add CustomTagsInput component
daryllimyt committed Jan 9, 2025
commit 46913c0e16a15ccd5f55f07085ff16ba66d1edf6
32 changes: 32 additions & 0 deletions frontend/src/components/tags-input.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { useState } from "react"
import { TagInput as EmblorTagInput } from "emblor"
import type { TagInputProps } from "emblor"

// Define the props we want to expose to consumers
type CustomTagInputProps = Omit<
TagInputProps,
"activeTagIndex" | "setActiveTagIndex" | "styleClasses"
>

/**
* Wrapper component for Emblor's TagInput that internally manages activeTagIndex state
* and applies consistent styling across the application
*/
export function CustomTagInput(props: CustomTagInputProps) {
const [activeTagIndex, setActiveTagIndex] = useState<number | null>(null)

return (
<EmblorTagInput
{...props}
activeTagIndex={activeTagIndex}
setActiveTagIndex={setActiveTagIndex}
styleClasses={{
input: "shadow-none",
inlineTagsContainer: "shadow-sm h-10 items-center border",
tag: {
body: "h-6",
},
}}
/>
)
}