diff --git a/src/App.tsx b/src/App.tsx index 0cf1fc5..c5e9a95 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,15 +1,15 @@ -import * as React from "react"; -import { FC, useEffect, useLayoutEffect } from "react"; -import { useDispatch, useSelector } from "react-redux"; -import FontFaceObserver from "fontfaceobserver"; -import { CSSReset, useToast, Flex } from "@chakra-ui/react"; -import { Switch, Route } from "react-router-dom"; -import { messageHandlerFullInfo } from "redux/messageHandler/selectors"; -import { messageHandlerReset } from "redux/messageHandler/actions"; -import WBHeader from "components/WBHeader"; -import ScrollToTop from "components/ScrollToTopOnMount"; -import Homepage from "pages/Homepage"; -import AnotherPage from "pages/AnotherPage"; +import * as React from 'react'; +import { FC, useEffect, useLayoutEffect } from 'react'; +import { useDispatch, useSelector } from 'react-redux'; +import FontFaceObserver from 'fontfaceobserver'; +import { CSSReset, useToast, Flex } from '@chakra-ui/react'; +import { Switch, Route } from 'react-router-dom'; +import { messageHandlerFullInfo } from 'redux/messageHandler/selectors'; +import { messageHandlerReset } from 'redux/messageHandler/actions'; +import WBHeader from 'components/WBHeader'; +import ScrollToTop from 'components/ScrollToTopOnMount'; +import Homepage from 'pages/Homepage'; +import AnotherPage from 'pages/AnotherPage'; const App: FC = () => { const dispatch = useDispatch(); @@ -17,21 +17,21 @@ const App: FC = () => { const hasGeneralMessage = useSelector(messageHandlerFullInfo); // Remember to change the name of the font based on what you are using - const font = new FontFaceObserver("Nunito+Sans"); + const font = new FontFaceObserver('Nunito+Sans'); const html = document.documentElement; useLayoutEffect(() => { - html.classList.add("fonts-loading"); + html.classList.add('fonts-loading'); font .load() .then(function () { - html.classList.remove("fonts-loading"); - html.classList.add("fonts-loaded"); + html.classList.remove('fonts-loading'); + html.classList.add('fonts-loaded'); }) .catch(function () { - html.classList.remove("fonts-loading"); - html.classList.add("fonts-failed"); + html.classList.remove('fonts-loading'); + html.classList.add('fonts-failed'); }); }); diff --git a/src/redux/ghibli/reducers.ts b/src/redux/ghibli/reducers.ts index 8b91b87..38bd132 100644 --- a/src/redux/ghibli/reducers.ts +++ b/src/redux/ghibli/reducers.ts @@ -1,9 +1,5 @@ -import { createReducer } from "@reduxjs/toolkit"; -import { - getAllFilmsFailed, - getAllFilmsRequest, - getAllFilmsSuccess, -} from "./actions"; +import { createReducer } from '@reduxjs/toolkit'; +import { getAllFilmsFailed, getAllFilmsRequest, getAllFilmsSuccess } from './actions'; export interface IFilmsState { loading: boolean; diff --git a/src/redux/ghibli/selectors.ts b/src/redux/ghibli/selectors.ts index 9a6b018..2f4e244 100644 --- a/src/redux/ghibli/selectors.ts +++ b/src/redux/ghibli/selectors.ts @@ -1,12 +1,7 @@ -import { createSelector } from "@reduxjs/toolkit"; -import { uniqBy } from "lodash"; -import type { RootState } from "redux/reducers"; +import { createSelector } from '@reduxjs/toolkit'; +import { uniqBy } from 'lodash'; +import type { RootState } from 'redux/reducers'; const allFilmsSelector = (state: RootState) => state.films; -export const allFilmsLoading = createSelector( - allFilmsSelector, - (filmsState) => filmsState.loading -); -export const allFilms = createSelector(allFilmsSelector, (filmsState) => - uniqBy(filmsState.films, "id") -); +export const allFilmsLoading = createSelector(allFilmsSelector, (filmsState) => filmsState.loading); +export const allFilms = createSelector(allFilmsSelector, (filmsState) => uniqBy(filmsState.films, 'id'));