Skip to content

Commit c38c8c2

Browse files
hammond-ljyounocode
authored andcommitted
fix: update some style issue for space layout
1 parent 7bded90 commit c38c8c2

File tree

11 files changed

+35
-35
lines changed

11 files changed

+35
-35
lines changed

apps/nextjs-app/src/features/app/blocks/base/base-side-bar/BaseNodeTree.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ export const BaseNodeTree = (props: IBaseNodeTreeProps) => {
560560
);
561561
} else if (emptyText) {
562562
return (
563-
<div className="flex w-full flex-col gap-2 px-2 ">
563+
<div className="flex min-h-16 w-full flex-col items-center justify-center gap-2 px-2 ">
564564
<p className="text-sm text-muted-foreground">{emptyText}</p>
565565
</div>
566566
);

apps/nextjs-app/src/features/app/blocks/space/BaseItem.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export const BaseItem: FC<IBaseItemProps> = (props) => {
8989
onClick={() => onToggleExpand?.()}
9090
>
9191
{/* Name Column */}
92-
<div className="flex h-8 w-full flex-1 items-center gap-2 overflow-hidden pr-1">
92+
<div className="flex h-8 w-full flex-1 items-center gap-2 overflow-hidden px-2">
9393
<Button
9494
variant="ghost"
9595
size="xs"
@@ -158,7 +158,7 @@ export const BaseItem: FC<IBaseItemProps> = (props) => {
158158

159159
{/* Creator Column */}
160160
<div className="flex w-44 shrink-0 items-center gap-2 px-4">
161-
<Avatar className="size-6">
161+
<Avatar className="size-6 border">
162162
<AvatarImage src={base.createdUser?.avatar ?? ''} />
163163
<AvatarFallback className="text-xs">{base.createdUser?.name?.slice(0, 1)}</AvatarFallback>
164164
</Avatar>
@@ -172,7 +172,7 @@ export const BaseItem: FC<IBaseItemProps> = (props) => {
172172

173173
{/* Actions Column */}
174174
<div
175-
className="flex w-[147px] shrink-0 items-center justify-end gap-2 px-4 opacity-0 group-hover:opacity-100"
175+
className="w-37 flex shrink-0 items-center justify-end gap-2 px-4 opacity-0 group-hover:opacity-100"
176176
onClick={stopPropagation}
177177
onMouseDown={stopPropagation}
178178
>

apps/nextjs-app/src/features/app/blocks/space/BaseList.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,10 @@ export const BaseList = (props: IBaseListProps) => {
130130
);
131131

132132
return (
133-
<ScrollArea className="h-full !border-none bg-background px-2 [&>[data-radix-scroll-area-viewport]>div]:!block [&>[data-radix-scroll-area-viewport]>div]:!min-h-0 [&>[data-radix-scroll-area-viewport]>div]:!min-w-0">
133+
<ScrollArea className="h-full !border-none bg-background [&>[data-radix-scroll-area-viewport]>div]:!block [&>[data-radix-scroll-area-viewport]>div]:!min-h-0 [&>[data-radix-scroll-area-viewport]>div]:!min-w-0">
134134
{/* Header */}
135-
<div className="sticky top-0 z-10 flex h-12 items-center border-b bg-background text-xs font-medium text-muted-foreground">
136-
<div className="flex-1 px-4">{t('space:baseList.allBases')}</div>
135+
<div className="sticky top-0 z-10 flex h-8 items-center border-b bg-background text-xs font-medium text-muted-foreground">
136+
<div className="flex-1 pl-8 pr-4">{t('space:baseList.allBases')}</div>
137137
<div className="w-44 shrink-0 px-4">{t('space:baseList.owner')}</div>
138138
<div className="w-44 shrink-0 px-4">{t('space:baseList.lastOpened')}</div>
139139
<div className="w-[147px] shrink-0" />

apps/nextjs-app/src/features/app/blocks/space/SpaceInnerPage.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ export const SpaceInnerPage: React.FC = () => {
113113

114114
return (
115115
space && (
116-
<div ref={ref} className="flex h-full min-w-0 flex-1 gap-10 px-12 py-8 sm:min-w-[760px]">
116+
<div ref={ref} className="flex h-full min-w-0 flex-1 gap-12 px-8 py-6 sm:min-w-[760px]">
117117
<div className="flex min-h-0 min-w-0 flex-1 flex-col ">
118118
<div className="flex shrink-0 items-center gap-2 pb-6 sm:mr-16">
119119
<SpaceRenaming
@@ -122,7 +122,7 @@ export const SpaceInnerPage: React.FC = () => {
122122
onChange={(e) => setSpaceName(e.target.value)}
123123
onBlur={(e) => toggleUpdateSpace(e)}
124124
>
125-
<h1 className="text-2xl font-semibold">{space.name}</h1>
125+
<h1 className="line-clamp-1 text-2xl font-semibold ">{space.name}</h1>
126126
</SpaceRenaming>
127127
<StarButton className="opacity-100" id={space.id} type={PinType.Space} />
128128
{isCloud && (

apps/nextjs-app/src/features/app/blocks/space/space-side-bar/PinList.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,9 @@ export const PinList = (props: { className?: string }) => {
8989
}}
9090
>
9191
<AccordionItem className="flex min-h-0 flex-1 flex-col border-0" value="pin-list">
92-
<AccordionTrigger className="shrink-0 px-3 hover:no-underline">
93-
<div className="flex items-center gap-1">
94-
<Star className="size-3 fill-yellow-400 text-yellow-400" />
92+
<AccordionTrigger className="h-10 shrink-0 px-3 hover:no-underline">
93+
<div className="flex items-center gap-2">
94+
<Star className="size-4 fill-yellow-400 text-yellow-400" />
9595
{t('space:pin.pin')}
9696
</div>
9797
</AccordionTrigger>
@@ -100,7 +100,7 @@ export const PinList = (props: { className?: string }) => {
100100
innerClassName="flex min-h-0 flex-1 flex-col"
101101
>
102102
<ScrollArea className="flex w-full !border-none px-2 [&>[data-radix-scroll-area-viewport]>div]:!block [&>[data-radix-scroll-area-viewport]>div]:!min-w-0">
103-
<div className="flex min-h-0 flex-1 flex-col overflow-y-auto px-3">
103+
<div className="flexmin-h-0 flex-1 flex-col overflow-y-auto">
104104
{pinListData?.length === 0 && (
105105
<div className="text-center text-xs text-muted-foreground">
106106
{t('space:pin.empty')}

apps/nextjs-app/src/features/app/blocks/space/space-side-bar/SpaceInnerSideBar.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ export const SpaceInnerSideBar = (props: { isAdmin?: boolean | null }) => {
5353

5454
return (
5555
<>
56-
<div className="flex flex-col justify-center gap-2 px-2">
56+
<div className="flex flex-col justify-center px-2">
5757
{space && (
58-
<div className=" px-4">
58+
<div className="p-2">
5959
<CreateBaseModalTrigger spaceId={space.id}>
6060
<Button variant={'outline'} size={'sm'} className="w-full" disabled={!canCreateSpace}>
6161
<Plus className="size-4 shrink-0" />
@@ -64,17 +64,17 @@ export const SpaceInnerSideBar = (props: { isAdmin?: boolean | null }) => {
6464
</CreateBaseModalTrigger>
6565
</div>
6666
)}
67-
<ul>
67+
<ul className="py-1">
6868
{pageRoutes.map(({ href, text, Icon, hidden }) => {
6969
if (hidden) return null;
7070
return (
71-
<li key={href} className="my-[2px] px-2">
71+
<li key={href}>
7272
<Button
7373
variant="ghost"
7474
size={'xs'}
7575
asChild
7676
className={cn(
77-
'w-full justify-start text-sm ',
77+
'w-full justify-start h-8 text-sm ',
7878
href === router.pathname && 'bg-accent'
7979
)}
8080
>

apps/nextjs-app/src/features/app/blocks/space/space-side-bar/SpaceSwitcher.tsx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -152,17 +152,17 @@ export const SpaceSwitcher = () => {
152152
<>
153153
<Popover open={open} onOpenChange={setOpen}>
154154
<PopoverTrigger asChild>
155-
<Button variant="ghost" size="sm" className="w-full p-2 text-base">
156-
<SpaceAvatar name={currentSpace?.name ?? ''} className="size-6" />
155+
<Button variant="ghost" size="sm" className="h-10 w-full p-2 text-base">
156+
<SpaceAvatar name={currentSpace?.name ?? ''} className="size-8" />
157157
<p className="grow truncate text-left font-semibold ">{currentSpace?.name}</p>
158158
<ChevronDown className="size-4 shrink-0" />
159159
</Button>
160160
</PopoverTrigger>
161161

162162
<PopoverContent className="min-w-[360px] p-0" align="start">
163163
<Command>
164-
<div className="px-2 pt-4">
165-
<p className="pb-2 text-sm ">
164+
<div className="px-4 pb-2 pt-4">
165+
<p className="pb-2 text-sm font-semibold ">
166166
{t('space:allSpaces')} ({spaceList?.length || 0})
167167
</p>
168168
<CommandInput
@@ -175,7 +175,7 @@ export const SpaceSwitcher = () => {
175175
<CommandList className="max-h-[300px]">
176176
<CommandEmpty>{t('common:noResult')}</CommandEmpty>
177177

178-
<CommandGroup className="px-2">
178+
<CommandGroup className="px-2 py-0">
179179
{spaceList?.map((space) => {
180180
const isSelected = space.id === currentSpaceId;
181181
const subscription = subscriptionMap.get(space.id);
@@ -185,7 +185,7 @@ export const SpaceSwitcher = () => {
185185
key={space.id}
186186
value={space.name}
187187
onSelect={() => handleSelectSpace(space)}
188-
className={cn('group flex items-center gap-2 mb-1 rounded-md h-9', {
188+
className={cn('group flex items-center gap-2 rounded-md h-10', {
189189
'bg-accent': isSelected,
190190
})}
191191
>
@@ -209,7 +209,7 @@ export const SpaceSwitcher = () => {
209209
<Button
210210
onClick={handleOpenCreateDialog}
211211
variant="ghost"
212-
className=" flex h-9 w-full items-center justify-start rounded-md p-2 text-blue-700 hover:bg-accent"
212+
className="flex h-8 items-center justify-start rounded-md p-2 text-blue-600 hover:text-blue-600"
213213
>
214214
<Plus className="size-4 shrink-0 " />
215215
{t('space:action.createSpace')}
@@ -218,11 +218,11 @@ export const SpaceSwitcher = () => {
218218

219219
<CommandSeparator />
220220

221-
<div className="flex flex-col py-1">
221+
<div className="flex flex-col px-2 py-1">
222222
<Link
223223
href="/space/shared-base"
224224
onClick={() => setOpen(false)}
225-
className="flex h-9 items-center gap-3 px-4 py-3 hover:bg-accent"
225+
className="flex h-9 items-center gap-2 rounded-md p-2 hover:bg-accent"
226226
>
227227
<Database className="size-4 shrink-0" />
228228
<span className="text-sm ">{t('space:sharedBase.title')}</span>
@@ -231,7 +231,7 @@ export const SpaceSwitcher = () => {
231231
<Link
232232
href="/admin/setting"
233233
onClick={() => setOpen(false)}
234-
className="flex h-9 items-center gap-3 px-4 py-3 hover:bg-accent"
234+
className="flex h-9 items-center gap-2 rounded-md p-2 hover:bg-accent"
235235
>
236236
<Admin className="size-4 shrink-0" />
237237
<span className="text-sm ">{t('common:noun.adminPanel')}</span>
@@ -242,7 +242,7 @@ export const SpaceSwitcher = () => {
242242
<Link
243243
href={`/enterprise/${organization.id}`}
244244
onClick={() => setOpen(false)}
245-
className="flex h-9 items-center gap-3 px-4 py-3 hover:bg-accent"
245+
className="flex h-9 items-center gap-2 rounded-md p-2 hover:bg-accent"
246246
>
247247
<Settings className="size-4 shrink-0" />
248248
<span className="text-sm ">{t('common:noun.organizationPanel')}</span>
@@ -252,7 +252,7 @@ export const SpaceSwitcher = () => {
252252
<Link
253253
href="/space/trash"
254254
onClick={() => setOpen(false)}
255-
className="flex h-9 items-center gap-3 px-4 py-3 hover:bg-accent"
255+
className="flex h-9 items-center gap-2 rounded-md p-2 hover:bg-accent"
256256
>
257257
<Trash2 className="size-4 shrink-0" />
258258
<span className="text-sm ">{t('common:trash.spaceTrash')}</span>

apps/nextjs-app/src/features/app/blocks/space/space-side-bar/StarButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export const StarButton = (props: IStarButtonProps) => {
5555
>
5656
<Star
5757
className={cn(
58-
'size-3 shrink-0 opacity-0 group-hover:opacity-100 transition-colors',
58+
'size-4 shrink-0 text-muted-foreground opacity-0 group-hover:opacity-100 transition-colors',
5959
{
6060
'opacity-100': isPin,
6161
'fill-yellow-400 text-yellow-400': isPin,

apps/nextjs-app/src/features/app/components/sidebar/SidebarHeader.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export const SidebarHeader = (prop: ISidebarHeaderProps) => {
1313
const { t } = useTranslation('common');
1414

1515
return (
16-
<div className="flex h-10 w-full items-center gap-1 p-2">
16+
<div className="flex w-full items-center gap-2 py-2 pl-2 pr-3">
1717
{headerLeft}
1818
{onExpand && (
1919
<TooltipProvider>

apps/nextjs-app/src/features/app/components/space/SpaceActionBar.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ export const SpaceActionBar: React.FC<ActionBarProps> = (props) => {
8080
onSpaceSetting={onSpaceSetting}
8181
onImportBase={() => setImportBaseOpen(true)}
8282
>
83-
<Button variant={'outline'} size={buttonSize}>
84-
<MoreHorizontal />
83+
<Button variant={'outline'} size={buttonSize} className="p-[5px]">
84+
<MoreHorizontal className="size-4" />
8585
</Button>
8686
</SpaceActionTrigger>
8787

0 commit comments

Comments
 (0)