Skip to content

Commit 2a2edd6

Browse files
fix: correcting responsiveness in the plan list view and removing access to notifications form in account settings
1 parent fc9c9f1 commit 2a2edd6

7 files changed

Lines changed: 29 additions & 49 deletions

File tree

frontend/knip.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ const config = {
88
"src/types/index.ts",
99
"src/robots.ts",
1010
"src/sitemap.ts",
11+
"src/actions/user.ts",
12+
"src/app/plans/_components/notifications-form.tsx",
1113
],
1214
// sharp is used in nextjs image optimization
1315
ignoreDependencies: ["sharp", "eslint"],

frontend/src/app/plans/account/layout.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,6 @@ const sidebarNavItems = [
2424
href: "/plans/account/appearance",
2525
icon: <Icons.Palette className="size-4" />,
2626
},
27-
{
28-
title: "Powiadomienia",
29-
href: "/plans/account/notifications",
30-
icon: <Icons.Bell className="size-4" />,
31-
},
3227
{
3328
title: "Dodawanie do kalendarza",
3429
href: "/plans/account/calendar",

frontend/src/app/plans/account/notifications/page.tsx

Lines changed: 0 additions & 27 deletions
This file was deleted.

frontend/src/app/plans/page.client.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export function PlansPage({
6969

7070
return (
7171
<div className="container mx-auto max-h-full flex-1 flex-grow overflow-y-auto p-4 pt-24">
72-
<div className="grid grid-cols-2 gap-4 sm:justify-start md:grid-cols-3 lg:grid-cols-5 xl:grid-cols-6">
72+
<div className="grid grid-cols-2 gap-4 sm:justify-start md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5">
7373
<button
7474
onClick={addNewPlan}
7575
className="group flex aspect-square items-center justify-center rounded-lg border-2 border-dashed border-gray-400 p-4 shadow-md transition-all hover:border-primary hover:bg-primary/5 hover:shadow-xl dark:border-gray-800"

frontend/src/components/plan-item.tsx

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,8 @@ export function PlanItem({
163163
className="relative flex aspect-square flex-col shadow-sm transition-all hover:shadow-md"
164164
ref={ref}
165165
>
166-
<CardHeader className="space-y-1 p-4">
167-
<CardTitle className="w-5/6 text-balance text-lg leading-4">
166+
<CardHeader className="space-y-1 p-2 min-[520px]:p-4">
167+
<CardTitle className="leading-2 w-5/6 text-balance text-sm min-[520px]:text-lg min-[520px]:leading-4">
168168
{name}
169169
</CardTitle>
170170
<CardDescription>
@@ -176,8 +176,8 @@ export function PlanItem({
176176
)}
177177
</CardDescription>
178178
</CardHeader>
179-
<CardContent className="flex-1 p-4 pt-0">
180-
<p className="text-sm">
179+
<CardContent className="flex-1 p-2 pt-0 text-xs min-[520px]:p-4 min-[520px]:text-sm">
180+
<p>
181181
{registrationsCount || registrationsLength}{" "}
182182
{pluralize(
183183
registrationsCount || registrationsLength,
@@ -186,11 +186,11 @@ export function PlanItem({
186186
"rejestracji",
187187
)}
188188
</p>
189-
<p className="text-sm">
189+
<p>
190190
{coursesCount || coursesLength}{" "}
191191
{pluralize(coursesCount || coursesLength, "kurs", "kursy", "kursów")}
192192
</p>
193-
<p className="text-sm">
193+
<p className="hidden min-[380px]:block">
194194
{groupsCount || groupCountLocal}{" "}
195195
{pluralize(
196196
groupsCount || groupCountLocal,
@@ -200,10 +200,13 @@ export function PlanItem({
200200
)}
201201
</p>
202202
</CardContent>
203-
<CardFooter className="justify-between gap-2 border-t p-3">
203+
<CardFooter className="justify-between gap-2 border-t p-2 min-[520px]:p-3">
204204
<DropdownMenu open={dropdownOpened} onOpenChange={setDropdownOpened}>
205205
<DropdownMenuTrigger asChild={true}>
206-
<Button variant="secondary" size="iconSm">
206+
<Button
207+
variant="secondary"
208+
className="h-7 w-7 px-0 min-[520px]:h-9 min-[520px]:w-9"
209+
>
207210
<Icons.EllipsisVertical className="size-4" />
208211
</Button>
209212
</DropdownMenuTrigger>
@@ -234,12 +237,18 @@ export function PlanItem({
234237
</DropdownMenuContent>
235238
</DropdownMenu>
236239
{onlineOnly ? (
237-
<Button size="sm" onClick={createFromOnlinePlan}>
240+
<Button
241+
className="h-7 px-3 py-1.5 min-[520px]:h-9 min-[520px]:rounded-md min-[520px]:px-3"
242+
onClick={createFromOnlinePlan}
243+
>
238244
<Icons.Pencil className="h-4 w-4" />
239-
Edytuj
245+
<p className="hidden min-[380px]:block">Edytuj</p>
240246
</Button>
241247
) : (
242-
<Button size="sm" asChild={true}>
248+
<Button
249+
className="h-7 px-3 py-1.5 min-[520px]:h-9 min-[520px]:rounded-md min-[520px]:px-3"
250+
asChild={true}
251+
>
243252
<Link href={`/plans/edit/${id}`}>
244253
<Icons.Pencil className="h-4 w-4" />
245254
Edytuj
@@ -251,10 +260,7 @@ export function PlanItem({
251260
<StatusIcon synced={synced} onlineId={onlineId} />
252261

253262
<Dialog open={dialogOpened} onOpenChange={setDialogOpened}>
254-
<DialogContent
255-
className="sm:max-w-[425px]"
256-
aria-describedby={undefined}
257-
>
263+
<DialogContent className="max-w-[425px]" aria-describedby={undefined}>
258264
<DialogHeader>
259265
<DialogTitle>Czy na pewno chcesz usunąć plan?</DialogTitle>
260266
<DialogDescription>Tej akcji nie da się cofnąć!</DialogDescription>

frontend/src/components/ui/button.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ const buttonVariants = cva(
2626
lg: "h-11 rounded-md px-8",
2727
icon: "h-10 w-10",
2828
iconSm: "h-9 w-9",
29+
iconXs: "h-7 w-7",
2930
xs: "h-7 px-3 py-1.5",
3031
},
3132
},

frontend/src/components/ui/card.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,10 @@ const CardDescription = React.forwardRef<
5050
>(({ className, ...props }, ref) => (
5151
<div
5252
ref={ref}
53-
className={cn("text-sm text-muted-foreground", className)}
53+
className={cn(
54+
"text-xs text-muted-foreground min-[520px]:text-sm",
55+
className,
56+
)}
5457
{...props}
5558
/>
5659
));

0 commit comments

Comments
 (0)