diff options
| author | CodeTorso <[email protected]> | 2024-07-13 03:03:10 +0530 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-07-13 03:03:10 +0530 |
| commit | 817bfa6cd962c201c80f4e8053093bdd738d1d22 (patch) | |
| tree | a7eece9a1353988b2d5fb63f7ec6b3f3dd7e9570 | |
| parent | Merge pull request #116 from Dhravya/ui-improvements (diff) | |
| parent | more improved ui (diff) | |
| download | supermemory-817bfa6cd962c201c80f4e8053093bdd738d1d22.tar.xz supermemory-817bfa6cd962c201c80f4e8053093bdd738d1d22.zip | |
Merge pull request #117 from Dhravya/ui-improvements
more improved ui
| -rw-r--r-- | apps/web/app/(dash)/menu.tsx | 17 | ||||
| -rw-r--r-- | packages/ui/shadcn/combobox.tsx | 6 | ||||
| -rw-r--r-- | packages/ui/shadcn/command.tsx | 4 |
3 files changed, 11 insertions, 16 deletions
diff --git a/apps/web/app/(dash)/menu.tsx b/apps/web/app/(dash)/menu.tsx index a481ae1f..04d3b898 100644 --- a/apps/web/app/(dash)/menu.tsx +++ b/apps/web/app/(dash)/menu.tsx @@ -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" /> diff --git a/packages/ui/shadcn/combobox.tsx b/packages/ui/shadcn/combobox.tsx index 4883ea19..9fdb4b67 100644 --- a/packages/ui/shadcn/combobox.tsx +++ b/packages/ui/shadcn/combobox.tsx @@ -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) => ( diff --git a/packages/ui/shadcn/command.tsx b/packages/ui/shadcn/command.tsx index e3b22841..a98b35c3 100644 --- a/packages/ui/shadcn/command.tsx +++ b/packages/ui/shadcn/command.tsx @@ -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} |