Skip to content

Commit

Permalink
Linter staged
Browse files Browse the repository at this point in the history
  • Loading branch information
IronTony committed Oct 19, 2021
1 parent fe09f22 commit 583a9d4
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 34 deletions.
36 changes: 18 additions & 18 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
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();
const toast = useToast();
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');
});
});

Expand Down
8 changes: 2 additions & 6 deletions src/redux/ghibli/reducers.ts
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
15 changes: 5 additions & 10 deletions src/redux/ghibli/selectors.ts
Original file line number Diff line number Diff line change
@@ -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'));

0 comments on commit 583a9d4

Please sign in to comment.