mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-18 23:46:03 +01:00
refactor(web/alert): use primary color theme for the button color
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import { Modal, Button, Stack, Group } from '@mantine/core';
|
import { Modal, Button, Stack, Group, useMantineTheme } from '@mantine/core';
|
||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
import ReactMarkdown from 'react-markdown';
|
import ReactMarkdown from 'react-markdown';
|
||||||
import { useNuiEvent } from '../../hooks/useNuiEvent';
|
import { useNuiEvent } from '../../hooks/useNuiEvent';
|
||||||
@@ -18,6 +18,7 @@ export interface AlertProps {
|
|||||||
|
|
||||||
const AlertDialog: React.FC = () => {
|
const AlertDialog: React.FC = () => {
|
||||||
const { locale } = useLocales();
|
const { locale } = useLocales();
|
||||||
|
const theme = useMantineTheme();
|
||||||
const [opened, setOpened] = useState(false);
|
const [opened, setOpened] = useState(false);
|
||||||
const [dialogData, setDialogData] = useState<AlertProps>({
|
const [dialogData, setDialogData] = useState<AlertProps>({
|
||||||
header: '',
|
header: '',
|
||||||
@@ -63,8 +64,8 @@ const AlertDialog: React.FC = () => {
|
|||||||
)}
|
)}
|
||||||
<Button
|
<Button
|
||||||
uppercase
|
uppercase
|
||||||
variant="light"
|
variant={dialogData.cancel ? 'light' : 'default'}
|
||||||
color={dialogData.cancel ? 'blue' : undefined}
|
color={dialogData.cancel ? theme.primaryColor : undefined}
|
||||||
onClick={() => closeAlert('confirm')}
|
onClick={() => closeAlert('confirm')}
|
||||||
>
|
>
|
||||||
{dialogData.labels?.confirm || locale.ui.confirm}
|
{dialogData.labels?.confirm || locale.ui.confirm}
|
||||||
|
|||||||
Reference in New Issue
Block a user