Skip to content

Commit f2b0627

Browse files
committed
feat: selected calendars list
1 parent 0f5ce0c commit f2b0627

File tree

2 files changed

+64
-7
lines changed

2 files changed

+64
-7
lines changed

packages/platform/atoms/selected-calendars/wrappers/SelectedCalendarsSettingsPlatformWrapper.tsx

Lines changed: 44 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,21 @@ export type SelectedCalendarsClassNames = {
3737
title?: string;
3838
description?: string;
3939
};
40+
selectedCalendarsListClassNames?: {
41+
container?: string;
42+
selectedCalendar: {
43+
container?: string;
44+
header?: {
45+
container: string;
46+
title?: string;
47+
description?: string;
48+
};
49+
body?: {
50+
container?: string;
51+
description?: string;
52+
};
53+
};
54+
};
4055
noSelectedCalendarsMessage?: string;
4156
};
4257

@@ -92,7 +107,9 @@ export const SelectedCalendarsSettingsPlatformWrapper = ({
92107
calendarRedirectUrls={calendarRedirectUrls}
93108
isDryRun={isDryRun}
94109
/>
95-
<List noBorderTreatment className="p-6 pt-2">
110+
<List
111+
noBorderTreatment
112+
className={classNamesObject?.selectedCalendarsListClassNames?.container || "p-6 pt-2"}>
96113
{data.connectedCalendars.map((connectedCalendar) => {
97114
if (!!connectedCalendar.calendars && connectedCalendar.calendars.length > 0) {
98115
return (
@@ -105,7 +122,18 @@ export const SelectedCalendarsSettingsPlatformWrapper = ({
105122
description={
106123
connectedCalendar.primary?.email ?? connectedCalendar.integration.description
107124
}
108-
className="border-subtle mt-4 rounded-lg border"
125+
classNameObject={{
126+
container: cn(
127+
"border-subtle mt-4 rounded-lg border",
128+
classNamesObject?.selectedCalendarsListClassNames?.selectedCalendar?.container
129+
),
130+
title:
131+
classNamesObject?.selectedCalendarsListClassNames?.selectedCalendar?.header
132+
?.title,
133+
description:
134+
classNamesObject?.selectedCalendarsListClassNames?.selectedCalendar?.header
135+
?.description,
136+
}}
109137
actions={
110138
<div className="flex w-32 justify-end">
111139
{allowDelete && !connectedCalendar.delegationCredentialId && (
@@ -119,8 +147,20 @@ export const SelectedCalendarsSettingsPlatformWrapper = ({
119147
)}
120148
</div>
121149
}>
122-
<div className="border-subtle border-t">
123-
<p className="text-subtle px-5 pt-4 text-sm">{t("toggle_calendars_conflict")}</p>
150+
<div
151+
className={cn(
152+
"border-subtle border-t",
153+
classNamesObject?.selectedCalendarsListClassNames?.selectedCalendar?.body
154+
?.container
155+
)}>
156+
<p
157+
className={cn(
158+
"text-subtle px-5 pt-4 text-sm",
159+
classNamesObject?.selectedCalendarsListClassNames?.selectedCalendar?.body
160+
?.description
161+
)}>
162+
{t("toggle_calendars_conflict")}
163+
</p>
124164
<ul className="space-y-4 px-5 py-4">
125165
{connectedCalendar.calendars?.map((cal) => {
126166
return (

packages/ui/components/app-list-card/AppListCard.tsx

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ type ShouldHighlight =
2222
slug?: never;
2323
};
2424

25+
export type AppCardClassNames = {
26+
container: string;
27+
title?: string;
28+
description?: string;
29+
};
30+
2531
export type AppListCardProps = {
2632
logo?: string;
2733
title: string;
@@ -33,6 +39,7 @@ export type AppListCardProps = {
3339
children?: ReactNode;
3440
credentialOwner?: CredentialOwner;
3541
className?: string;
42+
classNameObject?: AppCardClassNames;
3643
} & ShouldHighlight;
3744

3845
export const AppListCard = (props: AppListCardProps & { highlight?: boolean }) => {
@@ -48,11 +55,16 @@ export const AppListCard = (props: AppListCardProps & { highlight?: boolean }) =
4855
children,
4956
credentialOwner,
5057
className,
58+
classNameObject,
5159
highlight,
5260
} = props;
5361

5462
return (
55-
<div className={classNames(highlight && "dark:bg-muted bg-yellow-100", className)}>
63+
<div
64+
className={classNames(
65+
highlight && "dark:bg-muted bg-yellow-100",
66+
className || classNameObject?.container
67+
)}>
5668
<div className="flex items-start gap-x-3 px-4 py-4 sm:px-6">
5769
{logo ? (
5870
<img
@@ -63,13 +75,18 @@ export const AppListCard = (props: AppListCardProps & { highlight?: boolean }) =
6375
) : null}
6476
<div className="flex min-w-0 grow flex-col gap-y-1">
6577
<div className="flex items-center gap-x-2">
66-
<h3 className="text-emphasis truncate text-sm font-semibold">{title}</h3>
78+
<h3
79+
className={classNames("text-emphasis truncate text-sm font-semibold", classNameObject?.title)}>
80+
{title}
81+
</h3>
6782
<div className="flex flex-shrink-0 items-center gap-x-2">
6883
{isDefault && <Badge variant="green">{t("default")}</Badge>}
6984
{isTemplate && <Badge variant="red">Template</Badge>}
7085
</div>
7186
</div>
72-
<ListItemText component="p" className="whitespace-normal break-words">
87+
<ListItemText
88+
component="p"
89+
className={classNames("whitespace-normal break-words", classNameObject?.description)}>
7390
{description}
7491
</ListItemText>
7592
{invalidCredential && (

0 commit comments

Comments
 (0)