Dependencies updated & small enhancements (#27)

* Dependencies updated and imports shortened

* Head tags refactored

* Final tweaks
This commit is contained in:
David
2021-06-12 22:44:56 +02:00
committed by GitHub
parent 030de63b2a
commit bdaced0457
29 changed files with 2523 additions and 3373 deletions

View File

@@ -4,11 +4,11 @@ import Router from "next/router";
import { Stack, VStack, HStack, IconButton } from "@chakra-ui/react";
import { FaExchangeAlt } from "react-icons/fa";
import { useHotkeys } from "react-hotkeys-hook";
import { Layout, LangSelect, TranslationArea } from "../components";
import { useToastOnLoad } from "../hooks";
import { googleScrape, extractSlug, textToSpeechScrape } from "../utils/translate";
import { retrieveFiltered, replaceBoth } from "../utils/language";
import langReducer, { Actions, initialState } from "../utils/reducer";
import { CustomHead, LangSelect, TranslationArea } from "@components";
import { useToastOnLoad } from "@hooks";
import { googleScrape, extractSlug, textToSpeechScrape } from "@utils/translate";
import { retrieveFiltered, replaceBoth } from "@utils/language";
import langReducer, { Actions, initialState } from "@utils/reducer";
const Page: FC<InferGetStaticPropsType<typeof getStaticProps>> = ({ home, translationRes, audio, errorMsg, initial }) => {
const [{ source, target, query, delayedQuery, translation, isLoading }, dispatch] = useReducer(langReducer, initialState);
@@ -79,7 +79,9 @@ const Page: FC<InferGetStaticPropsType<typeof getStaticProps>> = ({ home, transl
), [canSwitch]);
return (
<Layout home={home}>
<>
<CustomHead home={home} />
<VStack px={[8, null, 24, 40]} w="full">
<HStack px={[1, null, 3, 4]} w="full">
<LangSelect
@@ -128,9 +130,9 @@ const Page: FC<InferGetStaticPropsType<typeof getStaticProps>> = ({ home, transl
/>
</Stack>
</VStack>
</Layout>
</>
);
}
};
export default Page;
@@ -186,4 +188,4 @@ export const getStaticProps: GetStaticProps = async ({ params }) => {
? 2 * 30 * 24 * 60 * 60 // 2 months
: 1
};
}
};