chore: update select style

This commit is contained in:
steven
2023-04-14 16:39:57 +08:00
parent 14f86897d6
commit 9a47f87550
3 changed files with 4 additions and 6 deletions

View File

@ -2,7 +2,7 @@
"name": "sqlchat", "name": "sqlchat",
"private": false, "private": false,
"scripts": { "scripts": {
"dev": "next dev --turbo", "dev": "next dev",
"build": "next build", "build": "next build",
"export": "next export", "export": "next export",
"start": "next start", "start": "next start",

View File

@ -228,7 +228,7 @@ const ConnectionSidebar = () => {
{databaseList.length > 0 && ( {databaseList.length > 0 && (
<div className="w-full sticky top-0 z-1 my-4"> <div className="w-full sticky top-0 z-1 my-4">
<Select <Select
className="w-full px-4 py-3 text-base" className="w-full px-4 py-3 !text-base"
value={currentConnectionCtx?.database?.name} value={currentConnectionCtx?.database?.name}
itemList={databaseList.map((database) => { itemList={databaseList.map((database) => {
return { return {

View File

@ -38,13 +38,11 @@ const Select = (props: Props) => {
> >
<SelectUI.Viewport className="bg-white dark:bg-zinc-700 border dark:border-zinc-800 drop-shadow-lg p-1 rounded-lg"> <SelectUI.Viewport className="bg-white dark:bg-zinc-700 border dark:border-zinc-800 drop-shadow-lg p-1 rounded-lg">
<SelectUI.Group> <SelectUI.Group>
{placeholder && <SelectUI.Label className="w-full px-3 mt-2 mb-1 text-sm text-gray-400">{placeholder}</SelectUI.Label>} {placeholder && <SelectUI.Label className="w-full px-3 mt-2 mb-2 text-sm text-gray-400">{placeholder}</SelectUI.Label>}
{itemList.map((item) => ( {itemList.map((item) => (
<SelectUI.Item <SelectUI.Item
className="w-full px-3 py-2 whitespace-nowrap truncate text-ellipsis overflow-x-hidden text-sm rounded-lg flex flex-row justify-between items-center cursor-pointer hover:bg-gray-100 dark:hover:bg-zinc-800"
key={item.label} key={item.label}
className={`${
className || ""
} w-full px-3 py-2 whitespace-nowrap truncate text-ellipsis overflow-x-hidden text-sm rounded-lg flex flex-row justify-between items-center cursor-pointer hover:bg-gray-100 dark:hover:bg-zinc-800`}
value={item.value} value={item.value}
> >
<SelectUI.ItemText className="truncate">{item.label}</SelectUI.ItemText> <SelectUI.ItemText className="truncate">{item.label}</SelectUI.ItemText>