Skip to content

Commit 6bc582b

Browse files
committed
UI improvements on mobile
1 parent 41cfd99 commit 6bc582b

File tree

5 files changed

+39
-6
lines changed

5 files changed

+39
-6
lines changed

frontend/src/components/ui/settings/card/card.props.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ export type SettingsCardProps = ParentProps & JSX.StylableSVGAttributes & Settin
88
export type SettingsCardHeaderGroupProps = ParentProps & JSX.StylableSVGAttributes;
99
export type SettingsCardHeaderProps = ParentProps & JSX.StylableSVGAttributes;
1010
export type SettingsCardDescriptionProps = ParentProps & JSX.StylableSVGAttributes;
11+
export type SettingsCardValueProps = ParentProps & JSX.StylableSVGAttributes;

frontend/src/components/ui/settings/card/card.tsx

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import type {
99
SettingsCardHeaderGroupProps,
1010
SettingsCardHeaderProps,
1111
SettingsCardProps,
12+
SettingsCardValueProps,
1213
} from "./card.props";
1314

1415
import { styles } from "./card.styles";
@@ -36,5 +37,28 @@ export const SettingsCardDescription = <T extends ValidComponent = "p">(
3637
props: PolymorphicProps<T, SettingsCardDescriptionProps>,
3738
) => {
3839
const [local, others] = splitProps(props, ["class"]);
39-
return <Polymorphic as="p" class={merge("text-xs text-fg-muted", local.class)} {...others} />;
40+
return (
41+
<Polymorphic
42+
as="p"
43+
class={merge("text-xs text-fg-muted max-md:hidden max-md:leading-none", local.class)}
44+
{...others}
45+
/>
46+
);
47+
};
48+
49+
export const SettingsCardValue = <T extends ValidComponent = "span">(
50+
props: PolymorphicProps<T, SettingsCardValueProps>,
51+
) => {
52+
const [local, others] = splitProps(props, ["class"]);
53+
return (
54+
<Polymorphic
55+
as="span"
56+
class={merge(
57+
"text-xs text-fg-muted max-md:leading-none",
58+
"transition-[opacity,color] group-data-[expanded]/collapsible:opacity-0",
59+
local.class,
60+
)}
61+
{...others}
62+
/>
63+
);
4064
};

frontend/src/components/ui/settings/card/index.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
import { Icon } from "solid-heroicons";
2-
import { SettingsCardDescription, SettingsCardHeader, SettingsCardHeaderGroup, SettingsCardRoot } from "./card";
2+
3+
import {
4+
SettingsCardDescription,
5+
SettingsCardHeader,
6+
SettingsCardHeaderGroup,
7+
SettingsCardRoot,
8+
SettingsCardValue,
9+
} from "./card";
310

411
export * from "./card";
512
export * from "./card.props";
@@ -10,4 +17,5 @@ export const SettingsCard = Object.assign(SettingsCardRoot, {
1017
HeaderGroup: SettingsCardHeaderGroup,
1118
Header: SettingsCardHeader,
1219
Description: SettingsCardDescription,
20+
Value: SettingsCardValue,
1321
});

frontend/src/routes/(sidebar)/(authenticated)/settings/account.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export default function Account() {
6161
{i18n.t.routes.settings.account.sections.security.cards.email.description()}
6262
</SettingsCard.Description>
6363
</SettingsCard.HeaderGroup>
64-
<SettingsCard.Description>{user().email}</SettingsCard.Description>
64+
<SettingsCard.Value>{user().email}</SettingsCard.Value>
6565
<SettingsCard.Icon path={chevronRight} class="size-4" />
6666
</SettingsCard>
6767

frontend/src/routes/(sidebar)/settings.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ export default function Settings() {
5959
{i18n.t.routes.settings.sections.appearance.cards.theme.description()}
6060
</SettingsCard.Description>
6161
</SettingsCard.HeaderGroup>
62-
<SettingsCard.Description class="transition-all group-data-[expanded]/collapsible:opacity-0">
62+
<SettingsCard.Value>
6363
{i18n.t.routes.settings.sections.appearance.cards.theme.options[theme.theme()]()}
64-
</SettingsCard.Description>
64+
</SettingsCard.Value>
6565
<SettingsExpander.Indicator />
6666
</SettingsExpander.Trigger>
6767
<SettingsExpander.Content>
@@ -97,7 +97,7 @@ export default function Settings() {
9797
{i18n.t.routes.settings.sections.about.cards.app.description()}
9898
</SettingsCard.Description>
9999
</SettingsCard.HeaderGroup>
100-
<SettingsCard.Description as="code">{import.meta.env.VITE_APP_VERSION}</SettingsCard.Description>
100+
<SettingsCard.Value as="code">{import.meta.env.VITE_APP_VERSION}</SettingsCard.Value>
101101
</SettingsCard>
102102
</SettingsGroup>
103103
</section>

0 commit comments

Comments
 (0)