mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-23 17:28:29 +02:00
fix padding and hover highlight in tabs (#243)
This commit is contained in:
@@ -14,7 +14,7 @@ export function openWorkspaceSettings(tab?: WorkspaceSettingsTab) {
|
|||||||
id: 'workspace-settings',
|
id: 'workspace-settings',
|
||||||
title: 'Workspace Settings',
|
title: 'Workspace Settings',
|
||||||
size: 'md',
|
size: 'md',
|
||||||
className: 'h-[calc(100vh-5rem)] max-h-[40rem]',
|
className: 'h-[calc(100vh-5rem)] !max-h-[40rem]',
|
||||||
noPadding: true,
|
noPadding: true,
|
||||||
render: ({ hide }) => (
|
render: ({ hide }) => (
|
||||||
<WorkspaceSettingsDialog workspaceId={workspaceId} hide={hide} tab={tab} />
|
<WorkspaceSettingsDialog workspaceId={workspaceId} hide={hide} tab={tab} />
|
||||||
|
|||||||
@@ -74,22 +74,22 @@ export default function Settings({ hide }: Props) {
|
|||||||
onChangeValue={setTab}
|
onChangeValue={setTab}
|
||||||
tabs={tabs.map((value) => ({ value, label: capitalize(value) }))}
|
tabs={tabs.map((value) => ({ value, label: capitalize(value) }))}
|
||||||
>
|
>
|
||||||
<TabContent value={TAB_GENERAL} className="pt-3 overflow-y-auto h-full px-4">
|
<TabContent value={TAB_GENERAL} className="overflow-y-auto h-full px-4">
|
||||||
<SettingsGeneral />
|
<SettingsGeneral />
|
||||||
</TabContent>
|
</TabContent>
|
||||||
<TabContent value={TAB_INTERFACE} className="pt-3 overflow-y-auto h-full px-4">
|
<TabContent value={TAB_INTERFACE} className="overflow-y-auto h-full px-4">
|
||||||
<SettingsInterface />
|
<SettingsInterface />
|
||||||
</TabContent>
|
</TabContent>
|
||||||
<TabContent value={TAB_THEME} className="pt-3 overflow-y-auto h-full px-4">
|
<TabContent value={TAB_THEME} className="overflow-y-auto h-full px-4">
|
||||||
<SettingsTheme />
|
<SettingsTheme />
|
||||||
</TabContent>
|
</TabContent>
|
||||||
<TabContent value={TAB_PLUGINS} className="pt-3 h-full px-4 grid grid-rows-1">
|
<TabContent value={TAB_PLUGINS} className="h-full px-4 grid grid-rows-1">
|
||||||
<SettingsPlugins />
|
<SettingsPlugins />
|
||||||
</TabContent>
|
</TabContent>
|
||||||
<TabContent value={TAB_PROXY} className="pt-3 overflow-y-auto h-full px-4">
|
<TabContent value={TAB_PROXY} className="overflow-y-auto h-full px-4">
|
||||||
<SettingsProxy />
|
<SettingsProxy />
|
||||||
</TabContent>
|
</TabContent>
|
||||||
<TabContent value={TAB_LICENSE} className="pt-3 overflow-y-auto h-full px-4">
|
<TabContent value={TAB_LICENSE} className="overflow-y-auto h-full px-4">
|
||||||
<SettingsLicense />
|
<SettingsLicense />
|
||||||
</TabContent>
|
</TabContent>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ export function Tabs({
|
|||||||
tabListClassName,
|
tabListClassName,
|
||||||
addBorders && '!-ml-1',
|
addBorders && '!-ml-1',
|
||||||
'flex items-center hide-scrollbars mb-2',
|
'flex items-center hide-scrollbars mb-2',
|
||||||
layout === 'horizontal' && 'h-full overflow-auto px-2',
|
layout === 'horizontal' && 'h-full overflow-auto p-2',
|
||||||
layout === 'vertical' && 'overflow-x-auto overflow-y-visible ',
|
layout === 'vertical' && 'overflow-x-auto overflow-y-visible ',
|
||||||
// Give space for button focus states within overflow boundary.
|
// Give space for button focus states within overflow boundary.
|
||||||
layout === 'vertical' && 'py-1 -ml-5 pl-3 pr-1',
|
layout === 'vertical' && 'py-1 -ml-5 pl-3 pr-1',
|
||||||
@@ -100,9 +100,9 @@ export function Tabs({
|
|||||||
const isActive = t.value === value;
|
const isActive = t.value === value;
|
||||||
const btnClassName = classNames(
|
const btnClassName = classNames(
|
||||||
'h-sm flex items-center rounded whitespace-nowrap',
|
'h-sm flex items-center rounded whitespace-nowrap',
|
||||||
'!px-2 ml-[1px]',
|
'!px-2 ml-[1px] hocus:text-text',
|
||||||
addBorders && 'border',
|
addBorders && 'border hocus:bg-surface-highlight',
|
||||||
isActive ? 'text-text' : 'text-text-subtle hover:text-text',
|
isActive ? 'text-text' : 'text-text-subtle',
|
||||||
isActive && addBorders
|
isActive && addBorders
|
||||||
? 'border-surface-active bg-surface-active'
|
? 'border-surface-active bg-surface-active'
|
||||||
: layout === 'vertical'
|
: layout === 'vertical'
|
||||||
@@ -177,7 +177,7 @@ export const TabContent = memo(function TabContent({
|
|||||||
<div
|
<div
|
||||||
tabIndex={-1}
|
tabIndex={-1}
|
||||||
data-tab={value}
|
data-tab={value}
|
||||||
className={classNames(className, 'tab-content', 'hidden w-full h-full')}
|
className={classNames(className, 'tab-content', 'hidden w-full h-full py-2')}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user