Skip to content

Commit fe5d348

Browse files
katarina-calakresimir-coko
authored andcommitted
3762-replace buttons in Notifications flow
1 parent f6570f0 commit fe5d348

File tree

4 files changed

+21
-35
lines changed

4 files changed

+21
-35
lines changed

client/src/pages/settings/platform/notifications/Notifications.tsx

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
import Button from '@/components/Button/Button';
12
import EmptyList from '@/components/EmptyList';
23
import PageLoader from '@/components/PageLoader';
3-
import {Button} from '@/components/ui/button';
44
import NotificationDialog from '@/pages/settings/platform/notifications/components/NotificationDialog';
55
import NotificationsTable from '@/pages/settings/platform/notifications/components/NotificationsTable';
66
import Header from '@/shared/layout/Header';
@@ -34,14 +34,7 @@ const Notifications = () => {
3434
<Header
3535
centerTitle
3636
position="main"
37-
right={
38-
<Button
39-
className="bg-surface-brand-primary hover:bg-surface-brand-primary-hover"
40-
onClick={() => openEditDialog()}
41-
>
42-
<PlusIcon /> New Notification
43-
</Button>
44-
}
37+
right={<Button icon={<PlusIcon />} label="New Notification" onClick={() => openEditDialog()} />}
4538
title="Notifications"
4639
/>
4740
}
@@ -53,12 +46,7 @@ const Notifications = () => {
5346
) : (
5447
<EmptyList
5548
button={
56-
<Button
57-
className="bg-surface-brand-primary hover:bg-surface-brand-primary-hover"
58-
onClick={() => openEditDialog()}
59-
>
60-
<PlusIcon /> New Notification
61-
</Button>
49+
<Button icon={<PlusIcon />} label="New Notification" onClick={() => openEditDialog()} />
6250
}
6351
icon={<Link2Icon className="size-12 text-gray-400" />}
6452
message="You do not have any Notifications created yet."

client/src/pages/settings/platform/notifications/components/NotificationDeleteDialog.tsx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import Button from '@/components/Button/Button';
12
import {
23
AlertDialog,
34
AlertDialogAction,
@@ -8,7 +9,6 @@ import {
89
AlertDialogHeader,
910
AlertDialogTitle,
1011
} from '@/components/ui/alert-dialog';
11-
import {Button} from '@/components/ui/button';
1212
import {Notification} from '@/shared/middleware/platform/notification';
1313
import {XIcon} from 'lucide-react';
1414

@@ -32,11 +32,14 @@ const NotificationDeleteDialog = ({
3232

3333
<AlertDialogDescription>This action cannot be undone.</AlertDialogDescription>
3434

35-
<Button className="absolute right-2 top-0" onClick={closeDeleteDialog} size="icon" variant="ghost">
36-
<XIcon />
37-
38-
<span className="sr-only">Close</span>
39-
</Button>
35+
<Button
36+
aria-label="Close"
37+
className="absolute right-2 top-0"
38+
icon={<XIcon />}
39+
onClick={closeDeleteDialog}
40+
size="icon"
41+
variant="ghost"
42+
/>
4043
</AlertDialogHeader>
4144

4245
<AlertDialogFooter>

client/src/pages/settings/platform/notifications/components/NotificationDialog.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
import Button from '@/components/Button/Button';
12
import {MultiSelect} from '@/components/MultiSelect/MultiSelect';
2-
import {Button} from '@/components/ui/button';
33
import {
44
Dialog,
55
DialogClose,
@@ -210,12 +210,10 @@ const NotificationDialog = ({
210210

211211
<DialogFooter>
212212
<DialogClose asChild>
213-
<Button type="button" variant="outline">
214-
Cancel
215-
</Button>
213+
<Button label="Cancel" type="button" variant="outline" />
216214
</DialogClose>
217215

218-
<Button type="submit">Save</Button>
216+
<Button label="Save" type="submit" />
219217
</DialogFooter>
220218
</form>
221219
</Form>

client/src/pages/settings/platform/notifications/components/NotificationTableCell.tsx

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import Badge from '@/components/Badge/Badge';
2-
import {Button} from '@/components/ui/button';
2+
import Button from '@/components/Button/Button';
33
import {Notification, NotificationEvent} from '@/shared/middleware/platform/notification';
44
import {PenIcon, TrashIcon} from 'lucide-react';
55

@@ -29,22 +29,19 @@ export const ActionsCell = ({notification, openDeleteDialog, openEditDialog}: Ac
2929
<div className="flex space-x-1">
3030
<Button
3131
className="text-content-neutral-primary/50 hover:bg-surface-neutral-primary-hover"
32+
icon={<PenIcon />}
3233
onClick={() => openEditDialog(notification)}
3334
size="icon"
3435
title="Edit notification"
3536
variant="ghost"
36-
>
37-
<PenIcon className="size-4 hover:cursor-pointer" />
38-
</Button>
37+
/>
3938

4039
<Button
41-
className="text-content-destructive/50 hover:bg-surface-destructive-secondary hover:text-content-destructive"
40+
icon={<TrashIcon />}
4241
onClick={() => openDeleteDialog(notification)}
4342
size="icon"
4443
title="Delete notification"
45-
variant="ghost"
46-
>
47-
<TrashIcon className="size-4 hover:cursor-pointer" />
48-
</Button>
44+
variant="destructiveGhost"
45+
/>
4946
</div>
5047
);

0 commit comments

Comments
 (0)