Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions src/renderer/src/components/Layout/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export interface BoxProps {
opacity?: string | number
borderRadius?: PxValue
border?: string
gap?: PxValue
$gap?: PxValue
mt?: PxValue
marginTop?: PxValue
mb?: PxValue
Expand All @@ -46,9 +46,9 @@ export interface BoxProps {
}

export interface StackProps extends BoxProps {
justifyContent?: 'center' | 'flex-start' | 'flex-end' | 'space-between'
alignItems?: 'center' | 'flex-start' | 'flex-end' | 'space-between'
flexDirection?: 'row' | 'row-reverse' | 'column' | 'column-reverse'
$justifyContent?: 'center' | 'flex-start' | 'flex-end' | 'space-between'
$alignItems?: 'center' | 'flex-start' | 'flex-end' | 'space-between'
$flexDirection?: 'row' | 'row-reverse' | 'column' | 'column-reverse'
}

export interface ButtonProps extends StackProps {
Expand Down Expand Up @@ -90,12 +90,11 @@ export const Box = styled.div<BoxProps>`
right: ${(props) => getElementValue(props.right) || 'auto'};
bottom: ${(props) => getElementValue(props.bottom) || 'auto'};
top: ${(props) => getElementValue(props.top) || 'auto'};
gap: ${(p) => (p.gap ? getElementValue(p.gap) : 0)};
gap: ${(p) => (p.$gap ? getElementValue(p.$gap) : 0)};
opacity: ${(props) => props.opacity ?? 1};
border-radius: ${(props) => getElementValue(props.borderRadius) || 0};
box-sizing: border-box;
border: ${(props) => props?.border || 'none'};
gap: ${(p) => (p.gap ? getElementValue(p.gap) : 0)};
margin: ${(props) => (props.m || props.margin ? (props.m ?? props.margin) : 'none')};
margin-top: ${(props) =>
props.mt || props.marginTop ? getElementValue(props.mt || props.marginTop) : 'default'};
Expand All @@ -118,9 +117,9 @@ export const Box = styled.div<BoxProps>`

export const Stack = styled(Box)<StackProps>`
display: flex;
justify-content: ${(props) => props.justifyContent ?? 'flex-start'};
align-items: ${(props) => props.alignItems ?? 'flex-start'};
flex-direction: ${(props) => props.flexDirection ?? 'row'};
justify-content: ${(props) => props.$justifyContent ?? 'flex-start'};
align-items: ${(props) => props.$alignItems ?? 'flex-start'};
flex-direction: ${(props) => props.$flexDirection ?? 'row'};
`

export const Center = styled(Stack)<StackProps>`
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/pages/settings/AboutSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ const AboutSettings: FC = () => {
<SettingGroup theme={theme}>
<SettingTitle>
{t('settings.about.title')}
<HStack alignItems="center">
<HStack $alignItems="center">
<Link to={APP_REPOSITORY}>
<GithubOutlined
style={{ marginRight: 4, color: 'var(--color-text)', fontSize: 20 }}
Expand Down
10 changes: 5 additions & 5 deletions src/renderer/src/pages/settings/AppearanceSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const ColorCircleWrapper = styled.div`
justify-content: center;
`

const ColorCircle = styled.div<{ color: string; isActive?: boolean }>`
const ColorCircle = styled.div<{ color: string; $isActive?: boolean }>`
position: absolute;
top: 50%;
left: 50%;
Expand All @@ -37,7 +37,7 @@ const ColorCircle = styled.div<{ color: string; isActive?: boolean }>`
background-color: ${(props) => props.color};
cursor: pointer;
transform: translate(-50%, -50%);
border: 2px solid ${(props) => (props.isActive ? 'var(--color-border)' : 'transparent')};
border: 2px solid ${(props) => (props.$isActive ? 'var(--color-border)' : 'transparent')};
transition: opacity 0.2s;

&:hover {
Expand Down Expand Up @@ -169,13 +169,13 @@ export function AppearanceSettings(): React.JSX.Element {
<SettingDivider />
<SettingRow>
<SettingRowTitle>{t('settings.theme.color_primary')}</SettingRowTitle>
<HStack gap="12px" alignItems="center">
<HStack gap="12px">
<HStack $gap="12px" $alignItems="center">
<HStack $gap="12px">
{THEME_COLOR_PRESETS.map((color) => (
<ColorCircleWrapper key={color}>
<ColorCircle
color={color}
isActive={colorPrimary === color}
$isActive={colorPrimary === color}
onClick={() => handleColorPrimaryChange(color)}
/>
</ColorCircleWrapper>
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/src/pages/settings/ShortcutSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ const ShortcutSettings: FC = () => {
alignItems: 'center'
}}
>
<HStack alignItems="center" style={{ position: 'relative' }}>
<HStack $alignItems="center" style={{ position: 'relative' }}>
{isEditing ? (
<ShortcutInput
ref={(el) => {
Expand Down Expand Up @@ -417,7 +417,7 @@ const ShortcutSettings: FC = () => {
showHeader={false}
/>
<SettingDivider style={{ marginBottom: 0 }} />
<HStack justifyContent="flex-end" padding="16px 0">
<HStack $justifyContent="flex-end" padding="16px 0">
<Button onClick={handleResetAllShortcuts}>
{t('settings.shortcuts.reset_defaults')}
</Button>
Expand Down