diff --git a/components/CustomError.tsx b/components/CustomError.tsx index 8849650..a358c97 100644 --- a/components/CustomError.tsx +++ b/components/CustomError.tsx @@ -31,6 +31,7 @@ const CustomError: FC = ({ statusCode }) => (
= (props) => (
© 2021 TheDavidDelta diff --git a/components/Header.tsx b/components/Header.tsx index ea7f0b1..06f7892 100644 --- a/components/Header.tsx +++ b/components/Header.tsx @@ -10,6 +10,7 @@ type Props = { const Header: FC = (props) => ( ) => void, @@ -15,6 +16,7 @@ const LangSelect: FC = ({ value, onChange, langs, ...props }) => ( variant="flushed" px={2} textAlign="center" + style={{ textAlignLast: "center" }} {...props} > {langs.map(([code, name]) => ( diff --git a/components/TranslationArea.tsx b/components/TranslationArea.tsx index 8c37d56..6ee1349 100644 --- a/components/TranslationArea.tsx +++ b/components/TranslationArea.tsx @@ -13,6 +13,8 @@ const TranslationArea: FC = ({ value, onChange, readOnly, ...props }) => value={value} onChange={onChange} readOnly={readOnly} + lang="auto" + dir="auto" resize="none" rows={useBreakpointValue([6, null, 12]) ?? undefined} size="lg" diff --git a/pages/[[...slug]].tsx b/pages/[[...slug]].tsx index 05612a0..9d54e14 100644 --- a/pages/[[...slug]].tsx +++ b/pages/[[...slug]].tsx @@ -2,7 +2,7 @@ import { useState, useEffect, useReducer, FC, ChangeEvent } from "react"; import { GetStaticPaths, GetStaticProps, InferGetStaticPropsType } from "next"; import Head from "next/head"; import Router from "next/router"; -import { Stack, VStack, HStack, IconButton } from "@chakra-ui/react"; +import { Stack, VStack, HStack, IconButton, Button, Link } from "@chakra-ui/react"; import { FaExchangeAlt } from "react-icons/fa"; import { CustomError, Header, Footer, LangSelect, TranslationArea } from "../components"; import { useToastOnLoad } from "../hooks"; @@ -37,7 +37,7 @@ const Page: FC> = ({ translation, const queryIsEmpty = !delayedQuery || delayedQuery === initialState.query; const queryIsInitial = delayedQuery === initial?.query; const sourceIsInitial = source === initialState.source || source === initial?.source; - const targetIsInitial = target === initialState.target || source === initial?.target; + const targetIsInitial = target === initialState.target || target === initial?.target; const allAreInitials = queryIsInitial && sourceIsInitial && targetIsInitial; queryIsEmpty || allAreInitials || Router.push(`/${source}/${target}/${encodeURIComponent(delayedQuery)}`); @@ -63,12 +63,32 @@ const Page: FC> = ({ translation, + +
- + > = ({ translation, /> > = ({ translation,