diff --git a/website/components/common/footer.tsx b/website/components/common/footer.tsx index 620fb663..6fe41ca6 100644 --- a/website/components/common/footer.tsx +++ b/website/components/common/footer.tsx @@ -1,19 +1,24 @@ import * as localizations from "../../localizations"; +import { IconChevronUp } from "@tabler/icons"; import { useLanguage } from "contexts/language"; +import { useRef } from "react"; export const Footer = () => { const { strings, setLanguage } = useLanguage(); return } diff --git a/website/components/icons/copy.tsx b/website/components/icons/copy.tsx new file mode 100644 index 00000000..4fb7a89d --- /dev/null +++ b/website/components/icons/copy.tsx @@ -0,0 +1,5 @@ +import { IconCopy } from "@tabler/icons"; + +export const CopyIcon = (props: any) => ( + +); \ No newline at end of file diff --git a/website/components/ui/cards/mainResult.tsx b/website/components/ui/cards/mainResult.tsx index 769ddaa3..95819470 100644 --- a/website/components/ui/cards/mainResult.tsx +++ b/website/components/ui/cards/mainResult.tsx @@ -3,6 +3,7 @@ import { TransliterateRequest, TransliterateResult } from "types/transliterate"; import { useEffect, useState } from "react"; import ContentLoader from "react-content-loader"; +import { CopyIcon } from "components/icons/copy"; import { EditIcon } from "components/icons/edit"; import { LanguageDetailsResult } from "types/languageDetails"; import { LanguagePicker } from "../modals/languagePicker"; @@ -43,11 +44,9 @@ export const TTSButton = ({ text, sourceLang, ...props }: { text: string, source setTTS(false); } }, [tts]); - return
- -
+ return } export const MainResultLoader = (props) => { @@ -150,7 +149,7 @@ export const MainResultCard = ({ text, language, service, loading, onNewTranslat : setCurrentText(el.target.value)} /> } -
+
{ transliteration &&
@@ -166,7 +165,14 @@ export const MainResultCard = ({ text, language, service, loading, onNewTranslat
}
- +
+ + { + service + ? {navigator.clipboard.writeText(currentText)}} className="opacity-80 hover:opacity-100 transition active:scale-95 cursor-pointer" /> + : "" + } +
} diff --git a/website/components/ui/cards/subResult.tsx b/website/components/ui/cards/subResult.tsx index baddb1c8..eb6cd856 100644 --- a/website/components/ui/cards/subResult.tsx +++ b/website/components/ui/cards/subResult.tsx @@ -27,7 +27,7 @@ export const SubResult = ({ result, ...props }: { result: TranslateRequest }) => const { strings } = useLanguage(); const service = new Service(result.data.service) return
- + {navigator.clipboard.writeText(result.data.result)}} clickable={result.success} shadow={false} className={result.success ? "opacity-100" : "opacity-50"}> {result.success ? result.data.result : strings.labels.translationFailure} diff --git a/website/pages/translate.tsx b/website/pages/translate.tsx index aedaf492..be900aca 100644 --- a/website/pages/translate.tsx +++ b/website/pages/translate.tsx @@ -1,10 +1,10 @@ import { DefaultTranslateRequest, TranslateRequest } from 'types/translate' -import { MainResult, MainResultCard, MainResultLoader } from 'components/ui/cards/mainResult' import { SubResult, SubResultLoader } from 'components/ui/cards/subResult' import { useEffect, useState } from 'react' import Configuration from 'config' import Head from 'next/head' +import { MainResult } from 'components/ui/cards/mainResult' import type { NextPage } from 'next' import { generateRandomID } from 'utils/random' import { services } from 'lib/services' @@ -96,7 +96,7 @@ const Translate: NextPage = () => { }

{strings.heading.otherTranslations}

-
+
{results.slice(1).map((result, index) => )} { toLoad > 0