Merge pull request #117 from Dhravya/ui-improvements

more improved ui
This commit is contained in:
CodeTorso 2024-07-13 03:03:10 +05:30 committed by GitHub
commit 817bfa6cd9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 11 additions and 16 deletions

View file

@ -209,9 +209,7 @@ function Menu() {
</DialogHeader>
<div>
<Label htmlFor="name">
Resource (URL or content)
</Label>
<Label htmlFor="name">Resource (URL or content)</Label>
<Textarea
className={`bg-[#2F353C] text-[#DBDEE1] max-h-[35vh] overflow-auto focus-visible:ring-0 border-none focus-visible:ring-offset-0 mt-2 ${/^https?:\/\/\S+$/i.test(content) && "text-[#1D9BF0] underline underline-offset-2"}`}
id="content"
@ -231,14 +229,11 @@ function Menu() {
{autoDetectedType != "none" && (
<div>
<Label
className="space-y-2"
htmlFor="space"
>
<h3 className="font-bold text-lg">Spaces</h3>
<Label className="space-y-2" htmlFor="space">
<h3 className="font-bold text-lg">Spaces (Optional)</h3>
<p className="leading-normal">
A space is a collection of memories. You can create a
space and then chat/write/ideate with it.
A space is a collection of memories. It's a way to
organise your memories.
</p>
</Label>
@ -287,7 +282,7 @@ function Menu() {
);
}
}}
placeholder="Save or create space by typing."
placeholder="select or create a new space."
className="bg-[#2F353C] h-min rounded-md mt-4 mb-4"
/>

View file

@ -34,7 +34,7 @@ const ComboboxWithCreate: React.FC<ComboboxWithCreateProps> = ({
onSubmit,
placeholder = "Select an option",
emptyMessage = "No option found.",
createNewMessage = "Create",
createNewMessage = "Create - ",
className,
}) => {
const [options, setOptions] = useState<Option[]>(initialOptions);
@ -54,6 +54,7 @@ const ComboboxWithCreate: React.FC<ComboboxWithCreateProps> = ({
<CommandList className="z-10 translate-y-12 translate-x-5 opacity-0 absolute group-focus-within:opacity-100 bg-secondary p-2 rounded-b-xl max-w-64">
<CommandEmpty>
<Button
className="px-1"
type="button"
onClick={async () => onSubmit(inputValue)}
variant="link"
@ -64,10 +65,9 @@ const ComboboxWithCreate: React.FC<ComboboxWithCreateProps> = ({
{createNewMessage} "{inputValue}"
</>
) : (
<>Create a space by typing here</>
<>Create a new space</>
)}
</Button>
<p>Start by creating a space and adding content to it</p>
</CommandEmpty>
<CommandGroup className="hidden group-focus-within:block">
{options.map((option, idx) => (

View file

@ -72,7 +72,7 @@ const CommandEmpty = React.forwardRef<
>((props, ref) => (
<CommandPrimitive.Empty
ref={ref}
className="py-6 text-center text-sm"
className="text-center text-sm"
{...props}
/>
));
@ -114,7 +114,7 @@ const CommandItem = React.forwardRef<
<CommandPrimitive.Item
ref={ref}
className={cn(
"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50",
"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent/10 aria-selected:text-accent data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50",
className,
)}
{...props}