-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: several improvements 🎨 (#93)
- Loading branch information
1 parent
05b7554
commit 24cc41e
Showing
24 changed files
with
133 additions
and
195 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@tablex/core": patch | ||
--- | ||
|
||
Removes the splash screen + replace background images with procedural ones to reduce bundle size |
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 was deleted.
Oops, something went wrong.
File renamed without changes
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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
70 changes: 70 additions & 0 deletions
70
apps/core/src/routes/connect/-components/driver-selector.tsx
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,70 @@ | ||
import type { Drivers } from "@/bindings" | ||
import { Button } from "@/components/ui/button" | ||
import { Command, CommandGroup, CommandItem } from "@/components/ui/command" | ||
import { | ||
Popover, | ||
PopoverContent, | ||
PopoverTrigger | ||
} from "@/components/ui/popover" | ||
import { MappedDrivers } from "@/lib/types" | ||
import { cn } from "@tablex/lib/utils" | ||
import { Check, ChevronsUpDown } from "lucide-react" | ||
import { useState, type Dispatch, type SetStateAction } from "react" | ||
|
||
type Props = { | ||
selectedDriver: Drivers | null | ||
setSelectedDriver: Dispatch<SetStateAction<Drivers | null>> | ||
} | ||
const DriverSelector = ({ selectedDriver, setSelectedDriver }: Props) => { | ||
const [isPopoverOpen, setIsPopoverOpen] = useState(false) | ||
|
||
return ( | ||
<Popover open={isPopoverOpen} onOpenChange={setIsPopoverOpen}> | ||
<PopoverTrigger asChild> | ||
<Button | ||
role="combobox" | ||
aria-expanded={isPopoverOpen} | ||
className="w-[230px] justify-between" | ||
> | ||
{selectedDriver | ||
? MappedDrivers.find((driver) => driver.value === selectedDriver) | ||
?.label | ||
: "Select a Database Driver"} | ||
<ChevronsUpDown className="ml-2 h-4 w-4 shrink-0 opacity-50" /> | ||
</Button> | ||
</PopoverTrigger> | ||
<PopoverContent className="w-[200px] p-0"> | ||
<Command> | ||
<CommandGroup> | ||
{MappedDrivers.map((driver) => ( | ||
<CommandItem | ||
key={driver.value} | ||
value={driver.value} | ||
onSelect={(currentValue) => { | ||
setSelectedDriver( | ||
currentValue === selectedDriver | ||
? null | ||
: (currentValue as Drivers) | ||
) | ||
setIsPopoverOpen(false) | ||
}} | ||
> | ||
<Check | ||
className={cn( | ||
"mr-2 h-4 w-4", | ||
driver.value === selectedDriver | ||
? "opacity-100" | ||
: "opacity-0" | ||
)} | ||
/> | ||
{driver.label} | ||
</CommandItem> | ||
))} | ||
</CommandGroup> | ||
</Command> | ||
</PopoverContent> | ||
</Popover> | ||
) | ||
} | ||
|
||
export default DriverSelector |
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
Oops, something went wrong.