fixed layout

This commit is contained in:
Sara
2023-10-15 18:27:48 +02:00
parent 13075784fe
commit b660c11e45
3 changed files with 108 additions and 51 deletions

37
www/app/styles/form.scss Normal file
View File

@@ -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;
}

View File

@@ -6,12 +6,10 @@ type LiveTranscriptionProps = {
export default function LiveTrancription(props: LiveTranscriptionProps) { export default function LiveTrancription(props: LiveTranscriptionProps) {
return ( return (
<div className="text-center p-4"> <div className="text-center p-4">
<p className="text-lg md:text-xl font-bold line-clamp-4"> <p className="text-lg md:text-xl font-bold line-clamp-4">{props.text}</p>
{props.translateText ? props.translateText : props.text}
</p>
{props.translateText && ( {props.translateText && (
<p className="text-base md:textlg font-bold line-clamp-4"> <p className="text-base md:text-lg font-bold line-clamp-4 mt-4">
{props.text} {props.translateText}
</p> </p>
)} )}
</div> </div>

View File

@@ -1,7 +1,9 @@
"use client"; "use client";
import React, { useEffect, useState } from "react"; import React, { useEffect, useState } from "react";
import useAudioDevice from "../useAudioDevice"; import useAudioDevice from "../useAudioDevice";
import "react-select-search/style.css";
import "../../styles/button.css"; import "../../styles/button.css";
import "../../styles/form.scss";
import getApi from "../../lib/getApi"; import getApi from "../../lib/getApi";
import About from "../../(aboutAndPrivacy)/about"; import About from "../../(aboutAndPrivacy)/about";
import Privacy from "../../(aboutAndPrivacy)/privacy"; import Privacy from "../../(aboutAndPrivacy)/privacy";
@@ -9,7 +11,6 @@ import { useRouter } from "next/navigation";
import useCreateTranscript from "../createTranscript"; import useCreateTranscript from "../createTranscript";
import SelectSearch from "react-select-search"; import SelectSearch from "react-select-search";
import { supportedLatinLanguages } from "../../supportedLanguages"; import { supportedLatinLanguages } from "../../supportedLanguages";
import "react-select-search/style.css";
const TranscriptCreate = () => { const TranscriptCreate = () => {
// const transcript = useTranscript(stream, api); // const transcript = useTranscript(stream, api);
@@ -28,47 +29,69 @@ const TranscriptCreate = () => {
const createTranscript = useCreateTranscript(); const createTranscript = useCreateTranscript();
const [loadingSend, setLoadingSend] = useState(false);
const send = () => { const send = () => {
if (createTranscript.loading || permissionDenied) return; if (loadingSend || createTranscript.loading || permissionDenied) return;
setLoadingSend(true);
createTranscript.create({ name, targetLanguage }); createTranscript.create({ name, targetLanguage });
}; };
useEffect(() => { useEffect(() => {
createTranscript.response && createTranscript.response &&
router.push(`/transcripts/${createTranscript.response.id}/record`); router.push(`/transcripts/${createTranscript.response.id}/record`);
}, [createTranscript.response]); }, [createTranscript.response]);
useEffect(() => {
if (createTranscript.error) setLoadingSend(false);
}, [createTranscript.error]);
const { loading, permissionOk, permissionDenied, requestPermission } = const { loading, permissionOk, permissionDenied, requestPermission } =
useAudioDevice(); useAudioDevice();
return ( return (
<> <>
<div></div> <div className="hidden lg:block"></div>
<div className="grid grid-cols-1 lg:grid-cols-2 grid-rows-mobile-inner lg:grid-rows-1 gap-2 lg:gap-4 h-full"> <div className="lg:grid lg:grid-cols-2 lg:grid-rows-1 lg:gap-4 lg:h-full h-auto flex flex-col">
<section className="flex flex-col w-full h-full items-center justify-evenly p-4 md:px-6 md:py-8"> <section className="flex flex-col w-full lg:h-full items-center justify-evenly p-4 md:px-6 md:py-8">
<div className="flex flex-col max-w-xl items-center justify-center"> <div className="flex flex-col max-w-xl items-center justify-center">
<h1 className="text-2xl font-bold mb-2"> <h1 className="text-2xl font-bold mb-2">
Welcome to reflector.media Welcome to reflector.media
</h1> </h1>
<p> <p>
Reflector is a transcription and summarization pipeline that Reflector is a transcription and summarization pipeline that
transforms audio into knowledge. The output is meeting minutes and transforms audio into knowledge.
topic summaries enabling topic-specific analyses stored in your <span className="hidden md:block">
systems of record. This is accomplished on your infrastructure The output is meeting minutes and topic summaries enabling
without 3rd parties keeping your data private, secure, and topic-specific analyses stored in your systems of record. This
organized. is accomplished on your infrastructure without 3rd parties
keeping your data private, secure, and organized.
</span>
</p> </p>
<About buttonText="Learn more" /> <About buttonText="Learn more" />
<p className="mt-6">
In order to use Reflector, we kindly request permission to access
your microphone during meetings and events.
</p>
<Privacy buttonText="Privacy policy" />
</div> </div>
</section> </section>
<section className="rounded-xl md:bg-blue-200 flex flex-col justify-start p-6"> <section className="flex flex-col justify-center items-center w-full h-full">
<h2 className="text-2xl font-bold mt-4 mb-2"> Try Reflector</h2> <div className="rounded-xl md:bg-blue-200 md:w-96 p-4 lg:p-6 flex flex-col mb-4 md:mb-10">
<h2 className="text-2xl font-bold mt-2 mb-2"> Try Reflector</h2>
<label className="mb-3"> <label className="mb-3">
<p>What is this meeting about ?</p> <p>Enter the name of your recording</p>
<input type="text" onChange={nameChange} /> <div className="select-search-container">
<input
className="select-search-input"
type="text"
onChange={nameChange}
/>
</div>
</label> </label>
<label className="mb-3"> <label className="mb-3">
<p>Do you need live translation ?</p> <p>Live translate to </p>
<SelectSearch <SelectSearch
search search
options={supportedLatinLanguages} options={supportedLatinLanguages}
@@ -81,30 +104,29 @@ const TranscriptCreate = () => {
{loading ? ( {loading ? (
<p className="">Checking permission...</p> <p className="">Checking permission...</p>
) : permissionOk ? ( ) : permissionOk ? (
<> Microphone permission granted </> <p className=""> Microphone permission granted </p>
) : ( ) : permissionDenied ? (
<>
<p className=""> <p className="">
In order to use Reflector, we kindly request permission to Permission to use your microphone was denied, please change the
access your microphone during meetings and events. permission setting in your browser and refresh this page.
<br />
<Privacy buttonText="Privacy policy" />
<br />
{permissionDenied &&
"Permission to use your microphone was denied, please change the permission setting in your browser and refresh this page."}
</p> </p>
) : (
<button <button
className="mt-4 bg-blue-400 hover:bg-blue-500 focus-visible:bg-blue-500 text-white font-bold py-2 px-4 rounded m-auto" className="mt-4 bg-blue-400 hover:bg-blue-500 focus-visible:bg-blue-500 text-white font-bold py-2 px-4 rounded"
onClick={requestPermission} onClick={requestPermission}
disabled={permissionDenied} disabled={permissionDenied}
> >
{permissionDenied ? "Access denied" : "Grant Permission"} Request Microphone Permission
</button> </button>
</>
)} )}
<button onClick={send} disabled={!permissionOk}> <button
{createTranscript.loading ? "loading" : "Send"} className="mt-4 bg-blue-400 hover:bg-blue-500 focus-visible:bg-blue-500 text-white font-bold py-2 px-4 rounded"
onClick={send}
disabled={!permissionOk || loadingSend}
>
{loadingSend ? "loading" : "Send"}
</button> </button>
</div>
</section> </section>
</div> </div>
</> </>