From b660c11e45a14cfc302f7e7449a380df0c777625 Mon Sep 17 00:00:00 2001 From: Sara Date: Sun, 15 Oct 2023 18:27:48 +0200 Subject: [PATCH] fixed layout --- www/app/styles/form.scss | 37 +++++++ www/app/transcripts/liveTranscription.tsx | 8 +- www/app/transcripts/new/page.tsx | 114 +++++++++++++--------- 3 files changed, 108 insertions(+), 51 deletions(-) create mode 100644 www/app/styles/form.scss diff --git a/www/app/styles/form.scss b/www/app/styles/form.scss new file mode 100644 index 00000000..90eb4a83 --- /dev/null +++ b/www/app/styles/form.scss @@ -0,0 +1,37 @@ +@media (prefers-color-scheme: dark) { + .select-search-container, + .input-container { + --select-search-background: #fff; + --select-search-border: #dce0e8; + --select-search-selected: #1e66f5; + --select-search-text: #000; + --select-search-subtle-text: #6c6f85; + --select-search-highlight: #eff1f5; + } +} + +body.is-dark-mode .select-search-container, +body.is-dark-mode .input-container { + --select-search-background: #fff; + --select-search-border: #dce0e8; + --select-search-selected: #1e66f5; + --select-search-text: #000; + --select-search-subtle-text: #6c6f85; + --select-search-highlight: #eff1f5; +} + +body.is-light-mode .select-search-container, +body.is-light-mode .input-container { + --select-search-background: #fff; + --select-search-border: #dce0e8; + --select-search-selected: #1e66f5; + --select-search-text: #000; + --select-search-subtle-text: #6c6f85; + --select-search-highlight: #eff1f5; +} + +.input-container, +.select-search-container { + max-width: 100%; + width: auto; +} diff --git a/www/app/transcripts/liveTranscription.tsx b/www/app/transcripts/liveTranscription.tsx index 6e40e7a3..12610415 100644 --- a/www/app/transcripts/liveTranscription.tsx +++ b/www/app/transcripts/liveTranscription.tsx @@ -6,12 +6,10 @@ type LiveTranscriptionProps = { export default function LiveTrancription(props: LiveTranscriptionProps) { return (
-

- {props.translateText ? props.translateText : props.text} -

+

{props.text}

{props.translateText && ( -

- {props.text} +

+ {props.translateText}

)}
diff --git a/www/app/transcripts/new/page.tsx b/www/app/transcripts/new/page.tsx index f2b15120..2d84d745 100644 --- a/www/app/transcripts/new/page.tsx +++ b/www/app/transcripts/new/page.tsx @@ -1,7 +1,9 @@ "use client"; import React, { useEffect, useState } from "react"; import useAudioDevice from "../useAudioDevice"; +import "react-select-search/style.css"; import "../../styles/button.css"; +import "../../styles/form.scss"; import getApi from "../../lib/getApi"; import About from "../../(aboutAndPrivacy)/about"; import Privacy from "../../(aboutAndPrivacy)/privacy"; @@ -9,7 +11,6 @@ import { useRouter } from "next/navigation"; import useCreateTranscript from "../createTranscript"; import SelectSearch from "react-select-search"; import { supportedLatinLanguages } from "../../supportedLanguages"; -import "react-select-search/style.css"; const TranscriptCreate = () => { // const transcript = useTranscript(stream, api); @@ -28,83 +29,104 @@ const TranscriptCreate = () => { const createTranscript = useCreateTranscript(); + const [loadingSend, setLoadingSend] = useState(false); + const send = () => { - if (createTranscript.loading || permissionDenied) return; + if (loadingSend || createTranscript.loading || permissionDenied) return; + setLoadingSend(true); createTranscript.create({ name, targetLanguage }); }; + useEffect(() => { createTranscript.response && router.push(`/transcripts/${createTranscript.response.id}/record`); }, [createTranscript.response]); + useEffect(() => { + if (createTranscript.error) setLoadingSend(false); + }, [createTranscript.error]); + const { loading, permissionOk, permissionDenied, requestPermission } = useAudioDevice(); return ( <> -
-
-
+
+
+

Welcome to reflector.media

Reflector is a transcription and summarization pipeline that - transforms audio into knowledge. The output is meeting minutes and - topic summaries enabling topic-specific analyses stored in your - systems of record. This is accomplished on your infrastructure – - without 3rd parties – keeping your data private, secure, and - organized. + transforms audio into knowledge. + + The output is meeting minutes and topic summaries enabling + topic-specific analyses stored in your systems of record. This + is accomplished on your infrastructure – without 3rd parties – + keeping your data private, secure, and organized. +

+

+ In order to use Reflector, we kindly request permission to access + your microphone during meetings and events. +

+
-
-

Try Reflector

- +
+
+

Try Reflector

+ - + - {loading ? ( -

Checking permission...

- ) : permissionOk ? ( - <> Microphone permission granted - ) : ( - <> + {loading ? ( +

Checking permission...

+ ) : permissionOk ? ( +

Microphone permission granted

+ ) : permissionDenied ? (

- In order to use Reflector, we kindly request permission to - access your microphone during meetings and events. -
- -
- {permissionDenied && - "Permission to use your microphone was denied, please change the permission setting in your browser and refresh this page."} + Permission to use your microphone was denied, please change the + permission setting in your browser and refresh this page.

+ ) : ( - - )} - + )} + +