feat(web): ui upgrade

This commit is contained in:
zhaoying
2026-04-01 16:43:45 +08:00
parent e77a1a92fd
commit ad4ddea977
13 changed files with 590 additions and 219 deletions

View File

@@ -24,10 +24,11 @@ interface BtnTabsProps {
onChange: (key: string) => void;
/** Optional extra class name for the container */
className?: string;
variant?: 'outline' | 'borderless'
}
/** Button-style tab switcher — renders tabs as pill-shaped buttons with active highlight */
const BtnTabs: FC<BtnTabsProps> = ({ items, activeKey, onChange, className }) => {
const BtnTabs: FC<BtnTabsProps> = ({ items, activeKey, onChange, className, variant = 'borderless' }) => {
return (
<Flex align="center" gap={8} className={className || ''}>
{items.map((tab) => (
@@ -35,8 +36,9 @@ const BtnTabs: FC<BtnTabsProps> = ({ items, activeKey, onChange, className }) =>
key={tab.key}
onClick={() => onChange(tab.key)}
className={clsx('rb:px-2 rb:py-1 rb:rounded-[13px] rb:text-[12px] rb:leading-4.5 rb:cursor-pointer', {
'rb:bg-[#F6F6F6]': activeKey !== tab.key,
'rb:bg-[#171719] rb:text-white': activeKey === tab.key,
'rb:bg-[#F6F6F6]': activeKey !== tab.key && variant === 'borderless',
'rb-border rb:bg-white': activeKey !== tab.key && variant === 'outline',
'rb:bg-[#171719] rb:text-white rb:border-[#171719]': activeKey === tab.key,
})}
>
{tab.label}