Skip to content

Commit

Permalink
chore: Fix warnings in UI
Browse files Browse the repository at this point in the history
  • Loading branch information
LiamDormon committed Oct 17, 2021
1 parent 627245c commit faca642
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions ui/src/components/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ debugData([
const App: React.FC = () => {
const [isVisible, setIsVisible] = useState(false)
const mode = useRecoilValue(GlobalState.theme)
const [buyEnabled, setBuyEnabled] = useRecoilState(GlobalState.canbuy)
const [, setBuyEnabled] = useRecoilState(GlobalState.canbuy)

useEffect(() => {
fetchNui<boolean>("fetch:canbuy").then((data) => {
Expand All @@ -32,7 +32,7 @@ const App: React.FC = () => {
}).catch(() => {
setBuyEnabled(true)
})
}, [])
})

const theme = useMemo(
() =>
Expand Down
4 changes: 2 additions & 2 deletions ui/src/components/CategorySelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import {
} from '@mui/material'
import {useTheme} from "@mui/material/styles";

interface CategorySelect {
interface ICategorySelect {
cat: string;
setCat: Dispatch<SetStateAction<string>>
}

const CategorySelect: React.FC<CategorySelect> = ({cat, setCat}) => {
const CategorySelect: React.FC<ICategorySelect> = ({cat, setCat}) => {
const theme = useTheme()

const handleChange = (event: SelectChangeEvent) => {
Expand Down
4 changes: 2 additions & 2 deletions ui/src/components/Content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ const getVehicleCard = (index: number, obj: Car) => {
)
}

interface Content {
interface IContent {
cat: string;
}

const Content: React.FC<Content> = ({cat}) => {
const Content: React.FC<IContent> = ({cat}) => {
const [data, setData] = useState<Car[]>([])
const [limit, setLimit] = useState<number>(12)
const [maxdepth, setMaxdepth] = useState<boolean>(false)
Expand Down
4 changes: 2 additions & 2 deletions ui/src/components/DialogueBody.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ import {
} from '@mui/material'
import {fetchNui} from "../utils/fetchNui";

interface DialogueBody {
interface IDialogueBody {
spawncode: string;
price: string;
setDialogueOpen: Dispatch<SetStateAction<boolean>>;
setModalOpen: Dispatch<SetStateAction<boolean>>
}

const DialogueBody: React.FC<DialogueBody> = ({spawncode, price, setDialogueOpen, setModalOpen}) => {
const DialogueBody: React.FC<IDialogueBody> = ({spawncode, price, setDialogueOpen, setModalOpen}) => {
const handleClose = () => {
setDialogueOpen(false)
}
Expand Down
6 changes: 3 additions & 3 deletions ui/src/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ import {fetchNui} from "../utils/fetchNui";
import GlobalState from "../state";
import {useRecoilState} from "recoil";

interface Header {
interface IHeader {
cat: string;
setCat: Dispatch<SetStateAction<string>>
}

const Header: React.FC<Header> = (props) => {
const Header: React.FC<IHeader> = (props) => {
const theme = useTheme();
const [colorMode, setColorMode] = useRecoilState(GlobalState.theme)

Expand All @@ -40,7 +40,7 @@ const Header: React.FC<Header> = (props) => {
}

const handleThemeswitch = () => {
colorMode == "light" ? setColorMode("dark") : setColorMode("light")
colorMode === "light" ? setColorMode("dark") : setColorMode("light")
}

return (
Expand Down
4 changes: 2 additions & 2 deletions ui/src/components/VehCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const VehCard: React.FC<Car> = ({
<Tooltip TransitionComponent={Zoom} sx={{maxWidth: 120}} arrow title="Test drive this vehicle">
<Button
size="small"
variant={theme.palette.mode == "dark" ? "contained" : "outlined"}
variant={theme.palette.mode === "dark" ? "contained" : "outlined"}
color="primary"
startIcon={<DirectionsCarIcon/>}
onClick={testDrive}
Expand All @@ -66,7 +66,7 @@ const VehCard: React.FC<Car> = ({
title="View more information about this vehicle">
<Button
size="small"
variant={theme.palette.mode == "dark" ? "contained" : "outlined"}
variant={theme.palette.mode === "dark" ? "contained" : "outlined"}
color="primary"
startIcon={<AssignmentIcon/>}
onClick={handleOpen}
Expand Down

0 comments on commit faca642

Please sign in to comment.