mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-22 00:13:09 +08:00
refactor: update AddButton styling to use CSS variable for border radius and remove unused settings hook
This commit is contained in:
parent
251c269ab3
commit
9df38c7e83
@ -1,4 +1,3 @@
|
|||||||
import { useSettings } from '@renderer/hooks/useSettings'
|
|
||||||
import type { ButtonProps } from 'antd'
|
import type { ButtonProps } from 'antd'
|
||||||
import { Button } from 'antd'
|
import { Button } from 'antd'
|
||||||
import { PlusIcon } from 'lucide-react'
|
import { PlusIcon } from 'lucide-react'
|
||||||
@ -9,7 +8,7 @@ const StyledButton = styled(Button)`
|
|||||||
height: 36px;
|
height: 36px;
|
||||||
width: calc(var(--assistants-width) - 20px);
|
width: calc(var(--assistants-width) - 20px);
|
||||||
justify-content: flex-start;
|
justify-content: flex-start;
|
||||||
border-radius: 8px;
|
border-radius: var(--list-item-border-radius);
|
||||||
padding: 0 12px;
|
padding: 0 12px;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
color: var(--color-text-2);
|
color: var(--color-text-2);
|
||||||
@ -20,12 +19,9 @@ const StyledButton = styled(Button)`
|
|||||||
`
|
`
|
||||||
|
|
||||||
const AddButton: FC<ButtonProps> = ({ ...props }) => {
|
const AddButton: FC<ButtonProps> = ({ ...props }) => {
|
||||||
const { topicPosition } = useSettings()
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<StyledButton
|
<StyledButton
|
||||||
{...props}
|
{...props}
|
||||||
style={{ borderRadius: topicPosition === 'left' ? 20 : 8 }}
|
|
||||||
type="text"
|
type="text"
|
||||||
onClick={props.onClick}
|
onClick={props.onClick}
|
||||||
icon={<PlusIcon size={16} style={{ flexShrink: 0 }} />}>
|
icon={<PlusIcon size={16} style={{ flexShrink: 0 }} />}>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user