Skip to content

Commit

Permalink
lot of setup work
Browse files Browse the repository at this point in the history
  • Loading branch information
yiqu committed Jun 17, 2023
1 parent a1a4a54 commit df197fe
Show file tree
Hide file tree
Showing 23 changed files with 479 additions and 106 deletions.
4 changes: 3 additions & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ VITE_APP_TITLE='Movie Rank'
VITE_APP_VERSION='1.0.0'
VITE_POKEAPI_URL='https://pokeapi.co/api/v2'
VITE_GITHUB_REPO_URL="https://github.com/yiqu/vite-react"
VITE_CIRCLE_CI_URL="https://app.circleci.com/pipelines/github/yiqu/vite-react"
VITE_CIRCLE_CI_URL="https://app.circleci.com/pipelines/github/yiqu/vite-react"
VITE_POKEMON_YELLOW_COLOR="#FFCB05"
VITE_POKEMON_BLUE_COLOR="#3466AF"
164 changes: 164 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"moment": "^2.29.4",
"object-hash": "^3.0.0",
"react": "^18.2.0",
"react-beautiful-dnd": "^13.1.1",
"react-custom-scroll": "^5.0.0",
"react-dnd": "^16.0.1",
"react-dnd-html5-backend": "^16.0.1",
Expand Down
Binary file added public/logo1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/logo2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
12 changes: 0 additions & 12 deletions src/core/all/FilmsAll.tsx

This file was deleted.

55 changes: 55 additions & 0 deletions src/core/all/PokemonsAll.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import { Box, Button, Divider, Skeleton, Stack } from '@mui/material';
import Grid from '@mui/material/Unstable_Grid2'; // Grid version 2
import { pokemonApi, useFetchRegionListQuery } from '../store/pokemon.api';
import Region from '../region/Region';
import RefreshIcon from '@mui/icons-material/Refresh';
import { useAppDispatch } from '../../store/appHook';

function FilmsAll() {
const dispatch = useAppDispatch();
const { data, isFetching, isLoading, refetch } = useFetchRegionListQuery();

const handleRefresh = () => {
//dispatch(pokemonApi.util.invalidateTags([{type: PokemonTag}]));
dispatch(pokemonApi.util.invalidateTags([{type: "Region", id: 'ALL'}]));
//refetch();
};

if (isLoading) {
return (
<Box width="100%">
<Skeleton animation="wave" />
<Skeleton animation="wave" />
</Box>
);
}

if (!data) {
return null;
}

return (
<Box width="100%">
<Stack direction="row" justifyContent="start" alignItems="start" width="100%">
<Button startIcon={ <RefreshIcon /> } variant='text' onClick={ handleRefresh }>
Refresh
</Button>
</Stack>
<Divider flexItem variant='fullWidth' />
<Grid container xs={ 12 } columnSpacing={ 2 }>
{
data.map((res) => {
return (
<Grid xs={ 4 } key={ res }>
<Region regionId={ res } />
</Grid>
);
})
}
</Grid>
<Divider flexItem variant='fullWidth' />
</Box>
);
}

export default FilmsAll;
Loading

0 comments on commit df197fe

Please sign in to comment.