Skip to content

Commit cd270fc

Browse files
committed
update card styles and component to render toggle switch
1 parent e442a80 commit cd270fc

File tree

2 files changed

+39
-23
lines changed

2 files changed

+39
-23
lines changed

src/features/common/components/card/card.component.tsx

Lines changed: 27 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import React, { PropsWithChildren, useId } from "react";
22
import styles from "./card.module.scss";
33
import { clsx } from "clsx";
4-
import { getLocalizedSecondaryFont, MonoFont } from "@/libs/theme/fonts";
4+
import { getLocalizedSecondaryFont } from "@/libs/theme/fonts";
55
import { CardMessageComponent } from "@/features/common/components/card-message/card-message.component";
66
import { HeaderIcon } from "../icons/header/header-icon";
77
import { CheckIcon } from "../icons/check/check-icon";
8+
import { EncodingFormatToggleSwitchComponent } from "@/features/decoder/components/encoding-format-toggle-swith/encoding-format-toggle-switch";
89

910
export interface CardComponentProps extends PropsWithChildren {
1011
id: string;
@@ -151,8 +152,8 @@ export const CardComponent: React.FC<CardComponentProps> = (props) => {
151152
{messages.success.map((line, index) => {
152153
return (
153154
<>
154-
<CheckIcon />
155-
<CardMessageComponent key={index}>{line}</CardMessageComponent>
155+
<CheckIcon />
156+
<CardMessageComponent key={index}>{line}</CardMessageComponent>
156157
</>
157158
);
158159
})}
@@ -201,27 +202,30 @@ export const CardWithHeadlineComponent: React.FC<
201202
return (
202203
<div role="region" aria-labelledby={regionId}>
203204
{sectionHeadline && (
204-
<>
205-
<h3
206-
id={regionId}
207-
className={clsx(
208-
styles.cardHeadline__title,
209-
getLocalizedSecondaryFont(languageCode)
210-
)}
211-
>
212-
{sectionHeadline.title}
213-
{sectionHeadline.titleTag && (
214-
<span className={styles.cardHeadline__titleTag}>
215-
{sectionHeadline.titleTag}
216-
</span>
205+
<div className={styles.title__container}>
206+
<div>
207+
<h3
208+
id={regionId}
209+
className={clsx(
210+
styles.cardHeadline__title,
211+
getLocalizedSecondaryFont(languageCode)
212+
)}
213+
>
214+
{sectionHeadline.title}
215+
{sectionHeadline.titleTag && (
216+
<span className={styles.cardHeadline__titleTag}>
217+
{sectionHeadline.titleTag}
218+
</span>
219+
)}
220+
</h3>
221+
{sectionHeadline.description && (
222+
<p className={styles.cardHeadline__description}>
223+
{sectionHeadline.description}
224+
</p>
217225
)}
218-
</h3>
219-
{sectionHeadline.description && (
220-
<p className={styles.cardHeadline__description}>
221-
{sectionHeadline.description}
222-
</p>
223-
)}
224-
</>
226+
</div>
227+
<EncodingFormatToggleSwitchComponent languageCode={languageCode} />
228+
</div>
225229
)}
226230
<CardComponent languageCode={languageCode} {...props} />
227231
</div>

src/features/common/components/card/card.module.scss

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,18 @@
5656
}
5757
}
5858

59+
.title__container {
60+
grid-column: 1/-1;
61+
width: 100%;
62+
color: var(--color_fg_bold);
63+
font-size: 1.75rem;
64+
font-weight: 500;
65+
line-height: 1.5;
66+
margin-bottom: .5rem;
67+
display: flex;
68+
justify-content: space-between;
69+
}
70+
5971
.card {
6072
isolation: isolate;
6173
grid-column: span 6;

0 commit comments

Comments
 (0)