Skip to content

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Agreon committed Mar 19, 2023
1 parent efe0266 commit f2187ee
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
12 changes: 5 additions & 7 deletions client/components/GameTile/GameThumbnail.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,23 @@
import { Box, Flex, Skeleton, useColorModeValue } from '@chakra-ui/react';
import { Box, Flex, Skeleton } from '@chakra-ui/react';
import Image, { ImageLoaderProps } from 'next/image';
import React, { useEffect, useState } from 'react';
import Image, { ImageLoaderProps } from 'next/image'

import { useGameContext } from '../../providers/GameProvider';
import { LoadingSpinner } from '../LoadingSpinner';

// Just use the original cdn servers and not ours in between.
const loader = ({ src }: ImageLoaderProps) => src
const loader = ({ src }: ImageLoaderProps) => src;

export const GameThumbnail: React.FC = () => {
const { loading, game, thumbnailUrl } = useGameContext();

const [imageLoading, setImageLoading] = useState(false);
useEffect(() => { setImageLoading(true); }, []);


if (!loading && !game.syncing && !thumbnailUrl) {
return null;
}


const showLoadingSpinner = (loading || game.syncing || (thumbnailUrl !== null && imageLoading));

return (
Expand All @@ -30,14 +28,14 @@ export const GameThumbnail: React.FC = () => {
position="relative"
justify="center"
height="215px"
bg={useColorModeValue('white', 'gray.900')}
bg={'gray.900'}
>
{thumbnailUrl &&
<Image
src={thumbnailUrl}
unoptimized={true}
fill={true}
alt={game.name ?? ""}
alt={game.name ?? ''}
loader={loader}
onError={() => setImageLoading(false)}
onLoad={() => setImageLoading(false)}
Expand Down
2 changes: 0 additions & 2 deletions client/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
IconButton,
Text,
useBreakpointValue,
useColorMode,
useColorModeValue,
useDisclosure,
} from '@chakra-ui/react';
Expand All @@ -27,7 +26,6 @@ export default function Header() {
toggleNotificationSidebar,
notificationSidebarIconRef
} = useNotificationContext();
const { colorMode } = useColorMode();

const {
isOpen: showAuthModal,
Expand Down

0 comments on commit f2187ee

Please sign in to comment.