mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-17 23:16:03 +01:00
refactor(web/notifications): notifications rewrite
This commit is contained in:
@@ -1,30 +1,45 @@
|
||||
import { CustomNotificationProps, NotificationProps } from '../../notifications/NotificationWrapper';
|
||||
import { debugData } from '../../../utils/debugData';
|
||||
|
||||
export const debugNotification = () => {
|
||||
debugData<NotificationProps>([
|
||||
{
|
||||
action: 'notify',
|
||||
data: {
|
||||
description: 'Dunak is nerd',
|
||||
title: 'Dunak',
|
||||
id: 1,
|
||||
},
|
||||
},
|
||||
]);
|
||||
};
|
||||
|
||||
export const debugCustomNotification = () => {
|
||||
debugData<CustomNotificationProps>([
|
||||
{
|
||||
action: 'customNotify',
|
||||
data: {
|
||||
description: 'Dunak is nerd',
|
||||
icon: 'basket-shopping',
|
||||
style: {
|
||||
backgroundColor: '#2D3748',
|
||||
color: 'white',
|
||||
},
|
||||
title: 'Success',
|
||||
description: 'Notification description',
|
||||
type: 'success',
|
||||
},
|
||||
},
|
||||
]);
|
||||
debugData<CustomNotificationProps>([
|
||||
{
|
||||
action: 'customNotify',
|
||||
data: {
|
||||
title: 'Info',
|
||||
description: 'Notification description',
|
||||
type: 'info',
|
||||
},
|
||||
},
|
||||
]);
|
||||
debugData<CustomNotificationProps>([
|
||||
{
|
||||
action: 'customNotify',
|
||||
data: {
|
||||
title: 'Error',
|
||||
description: 'Notification description',
|
||||
type: 'error',
|
||||
},
|
||||
},
|
||||
]);
|
||||
debugData<CustomNotificationProps>([
|
||||
{
|
||||
action: 'customNotify',
|
||||
data: {
|
||||
title: 'Custom icon success',
|
||||
description: 'Notification description',
|
||||
type: 'success',
|
||||
icon: 'microchip',
|
||||
},
|
||||
},
|
||||
]);
|
||||
|
||||
@@ -4,7 +4,7 @@ import { debugAlert } from './debug/alert';
|
||||
import { debugContext } from './debug/context';
|
||||
import { debugInput } from './debug/input';
|
||||
import { debugMenu } from './debug/menu';
|
||||
import { debugCustomNotification, debugNotification } from './debug/notification';
|
||||
import { debugCustomNotification } from './debug/notification';
|
||||
import { debugCircleProgressbar, debugProgressbar } from './debug/progress';
|
||||
import { debugTextUI } from './debug/textui';
|
||||
import { debugSkillCheck } from './debug/skillcheck';
|
||||
@@ -48,10 +48,7 @@ const Dev: React.FC = () => {
|
||||
</Button>
|
||||
<Divider />
|
||||
<Button fullWidth onClick={() => debugCustomNotification()}>
|
||||
Send custom notification
|
||||
</Button>
|
||||
<Button fullWidth onClick={() => debugNotification()}>
|
||||
Send default notification
|
||||
Send notification
|
||||
</Button>
|
||||
<Divider />
|
||||
<Button fullWidth onClick={() => debugProgressbar()}>
|
||||
|
||||
Reference in New Issue
Block a user