Skip to content

Commit

Permalink
chore(web): remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
LukeWasTakenn committed Feb 13, 2023
1 parent f166c16 commit 14341a0
Show file tree
Hide file tree
Showing 12 changed files with 7 additions and 26 deletions.
2 changes: 1 addition & 1 deletion web/src/features/dev/debug/notification.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CustomNotificationProps, NotificationProps } from '../../notifications/NotificationWrapper';
import { CustomNotificationProps } from '../../notifications/NotificationWrapper';
import { debugData } from '../../../utils/debugData';

export const debugCustomNotification = () => {
Expand Down
1 change: 0 additions & 1 deletion web/src/features/dialog/components/fields/checkbox.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Checkbox } from '@mantine/core';
import { useEffect } from 'react';
import { ICheckbox } from '../../../../interfaces/dialog';
import { UseFormRegisterReturn } from 'react-hook-form';

Expand Down
2 changes: 1 addition & 1 deletion web/src/features/dialog/components/fields/input.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createStyles, PasswordInput, TextInput } from '@mantine/core';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import React, { useEffect } from 'react';
import React from 'react';
import { IInput } from '../../../../interfaces/dialog';
import { UseFormRegisterReturn } from 'react-hook-form';

Expand Down
3 changes: 1 addition & 2 deletions web/src/features/dialog/components/fields/number.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { NumberInput } from '@mantine/core';
import { useEffect } from 'react';
import { INumber } from '../../../../interfaces/dialog';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { Control, useController, UseFormRegisterReturn } from 'react-hook-form';
import { Control, useController } from 'react-hook-form';
import { FormValues } from '../../InputDialog';

interface Props {
Expand Down
2 changes: 1 addition & 1 deletion web/src/features/dialog/components/fields/select.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { MultiSelect, Select } from '@mantine/core';
import { ISelect } from '../../../../interfaces/dialog';
import { Control, FieldValues, useController, UseFormRegisterReturn, UseFormSetValue } from 'react-hook-form';
import { Control, useController } from 'react-hook-form';
import { FormValues } from '../../InputDialog';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';

Expand Down
3 changes: 1 addition & 2 deletions web/src/features/dialog/components/fields/slider.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Box, Slider, Text } from '@mantine/core';
import { useEffect, useState } from 'react';
import { ISlider } from '../../../../interfaces/dialog';
import { Control, FieldValues, useController, UseFormRegisterReturn, UseFormSetValue } from 'react-hook-form';
import { Control, useController } from 'react-hook-form';
import { FormValues } from '../../InputDialog';

interface Props {
Expand Down
2 changes: 1 addition & 1 deletion web/src/features/menu/context/ContextMenu.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useNuiEvent } from '../../../hooks/useNuiEvent';
import { Box, Stack, Text, Flex, Transition } from '@mantine/core';
import { Box, Stack, Text, Flex } from '@mantine/core';
import { useEffect, useState } from 'react';
import { ContextMenuProps } from '../../../interfaces/context';
import ContextButton from './components/ContextButton';
Expand Down
10 changes: 0 additions & 10 deletions web/src/features/notifications/NotificationWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,6 @@ import ReactMarkdown from 'react-markdown';
import { Avatar, createStyles, Group, Stack, Box, Text, keyframes } from '@mantine/core';
import React from 'react';

export interface NotificationProps {
title?: string;
description?: string;
duration?: number;
position?: ToastPosition | 'top' | 'bottom';
variant?: string;
status?: 'info' | 'warning' | 'success' | 'error';
id?: number;
}

export interface CustomNotificationProps {
style?: React.CSSProperties;
description?: string;
Expand Down
3 changes: 0 additions & 3 deletions web/src/features/progress/Progressbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,22 +55,19 @@ const Progressbar: React.FC = () => {
const [visible, setVisible] = React.useState(false);
const [label, setLabel] = React.useState('');
const [duration, setDuration] = React.useState(0);
const [cancelled, setCancelled] = React.useState(false);

const progressComplete = () => {
setVisible(false);
fetchNui('progressComplete');
};

const progressCancel = () => {
setCancelled(true);
setVisible(false);
};

useNuiEvent('progressCancel', progressCancel);

useNuiEvent<ProgressbarProps>('progress', (data) => {
setCancelled(false);
setVisible(true);
setLabel(data.label);
setDuration(data.duration);
Expand Down
2 changes: 1 addition & 1 deletion web/src/features/skillcheck/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useRef, useState } from 'react';
import { useNuiEvent } from '../../hooks/useNuiEvent';
import Indicator from './indicator';
import { fetchNui } from '../../utils/fetchNui';
import { useMantineTheme, Box, createStyles } from '@mantine/core';
import { Box, createStyles } from '@mantine/core';

interface CustomGameDifficulty {
areaSize: number;
Expand Down
1 change: 0 additions & 1 deletion web/src/features/skillcheck/indicator.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { useCallback, useEffect, useState } from 'react';
import { useKeyPress } from '../../hooks/useKeyPress';
import { SkillCheckProps } from './index';
import { useInterval } from '@mantine/hooks';
import { circleCircumference } from './index';
Expand Down
2 changes: 0 additions & 2 deletions web/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@ import React from 'react';
import ReactDOM from 'react-dom/client';
import './index.css';
import App from './App';
import { theme } from './theme';
import { fas } from '@fortawesome/free-solid-svg-icons';
import { far } from '@fortawesome/free-regular-svg-icons';
import { fab } from '@fortawesome/free-brands-svg-icons';
import { library } from '@fortawesome/fontawesome-svg-core';
import { isEnvBrowser } from './utils/misc';
import LocaleProvider from './providers/LocaleProvider';
import { MantineProvider } from '@mantine/core';
import ConfigProvider from './providers/ConfigProvider';

library.add(fas, far, fab);
Expand Down

0 comments on commit 14341a0

Please sign in to comment.