From 49bb2a00a16daf4461f953be219bc3c56e5f239e Mon Sep 17 00:00:00 2001 From: david Date: Thu, 15 Dec 2022 17:43:14 -0500 Subject: [PATCH] feat(web): notify and context markdown wrapper (#174) Co-authored-by: davidxd33 --- web/src/features/menu/context/ContextMenu.tsx | 3 ++- web/src/features/menu/context/Item.tsx | 5 +++-- web/src/features/notifications/NotificationWrapper.tsx | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/web/src/features/menu/context/ContextMenu.tsx b/web/src/features/menu/context/ContextMenu.tsx index 71819ee..aee714f 100644 --- a/web/src/features/menu/context/ContextMenu.tsx +++ b/web/src/features/menu/context/ContextMenu.tsx @@ -5,6 +5,7 @@ import { ContextMenuProps } from '../../../interfaces/context'; import Item from './Item'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { fetchNui } from '../../../utils/fetchNui'; +import ReactMarkdown from 'react-markdown'; const openMenu = (id: string | undefined) => { fetchNui('openContext', { id: id, back: true }); @@ -72,7 +73,7 @@ const ContextMenu: React.FC = () => { )} - {contextMenu.title} + {contextMenu.title} - {button.title ? button.title : buttonKey} + {button.title ? button.title : buttonKey} {button.description && ( - {button.description} + {button.description} )} {button?.progress && ( diff --git a/web/src/features/notifications/NotificationWrapper.tsx b/web/src/features/notifications/NotificationWrapper.tsx index 1adc910..326d0f3 100644 --- a/web/src/features/notifications/NotificationWrapper.tsx +++ b/web/src/features/notifications/NotificationWrapper.tsx @@ -2,6 +2,7 @@ import { useToast, type ToastPosition, Box, HStack, Text } from '@chakra-ui/reac import { useNuiEvent } from '../../hooks/useNuiEvent'; import { IconProp } from '@fortawesome/fontawesome-svg-core'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; +import ReactMarkdown from 'react-markdown'; export interface NotificationProps { title?: string; @@ -53,7 +54,7 @@ const Notifications: React.FC = () => { )} {data.title && {data.title}} - {data.description && {data.description}} + {data.description && {data.description}}