diff --git a/www/app/layout.js b/www/app/layout.js index 98f6e772..824a8e16 100644 --- a/www/app/layout.js +++ b/www/app/layout.js @@ -1,4 +1,4 @@ -import "./globals.scss"; +import "./styles/globals.scss"; import { Roboto } from "next/font/google"; import Head from "next/head"; diff --git a/www/app/utils.js b/www/app/lib/random.js similarity index 58% rename from www/app/utils.js rename to www/app/lib/random.js index 79e8ceae..37c4dee7 100644 --- a/www/app/utils.js +++ b/www/app/lib/random.js @@ -17,15 +17,3 @@ export function Mulberry32(seed) { return ((t ^ (t >>> 14)) >>> 0) / 4294967296; }; } - -export const formatTime = (seconds) => { - let hours = Math.floor(seconds / 3600); - let minutes = Math.floor((seconds % 3600) / 60); - let secs = Math.floor(seconds % 60); - - let timeString = `${hours > 0 ? hours + ":" : ""}${minutes - .toString() - .padStart(2, "0")}:${secs.toString().padStart(2, "0")}`; - - return timeString; -}; diff --git a/www/app/lib/time.js b/www/app/lib/time.js new file mode 100644 index 00000000..a6204ade --- /dev/null +++ b/www/app/lib/time.js @@ -0,0 +1,11 @@ +export const formatTime = (seconds) => { + let hours = Math.floor(seconds / 3600); + let minutes = Math.floor((seconds % 3600) / 60); + let secs = Math.floor(seconds % 60); + + let timeString = `${hours > 0 ? hours + ":" : ""}${minutes + .toString() + .padStart(2, "0")}:${secs.toString().padStart(2, "0")}`; + + return timeString; +}; diff --git a/www/app/page.js b/www/app/page.js index 3ebf8e32..d2835cf1 100644 --- a/www/app/page.js +++ b/www/app/page.js @@ -1,53 +1,4 @@ -"use client"; -import React, { useEffect, useState } from "react"; -import Recorder from "./components/record.js"; -import { Dashboard } from "./components/dashboard.js"; -import useWebRTC from "./components/webrtc.js"; -import useTranscript from "./components/transcript.js"; -import { useWebSockets } from "./components/websocket.js"; -import "../public/button.css"; - -const App = () => { - const [stream, setStream] = useState(null); - const [disconnected, setDisconnected] = useState(false); - - useEffect(() => { - if (process.env.NEXT_PUBLIC_ENV === "development") { - document.onkeyup = (e) => { - if (e.key === "d") { - setDisconnected((prev) => !prev); - } - }; - } - }, []); - - const transcript = useTranscript(); - const webRTC = useWebRTC(stream, transcript.response?.id); - const webSockets = useWebSockets(transcript.response?.id); - - return ( -
-
-

Reflector

-

Capture The Signal, Not The Noise

-
- - { - webRTC?.peer?.send(JSON.stringify({ cmd: "STOP" })); - setStream(null); - }} - /> - -
- ); -}; - -export default App; +import { redirect } from "next/navigation"; +export default async function Index({ params }) { + redirect("/transcripts/new"); +} diff --git a/www/app/reach.png b/www/app/reach.png deleted file mode 100644 index e0c07c71..00000000 Binary files a/www/app/reach.png and /dev/null differ diff --git a/www/public/button.css b/www/app/styles/button.css similarity index 100% rename from www/public/button.css rename to www/app/styles/button.css diff --git a/www/app/globals.scss b/www/app/styles/globals.scss similarity index 100% rename from www/app/globals.scss rename to www/app/styles/globals.scss diff --git a/www/app/components/CustomRecordPlugin.js b/www/app/transcripts/CustomRecordPlugin.js similarity index 100% rename from www/app/components/CustomRecordPlugin.js rename to www/app/transcripts/CustomRecordPlugin.js diff --git a/www/app/components/dashboard.js b/www/app/transcripts/dashboard.js similarity index 100% rename from www/app/components/dashboard.js rename to www/app/transcripts/dashboard.js diff --git a/www/app/transcripts/new/page.js b/www/app/transcripts/new/page.js new file mode 100644 index 00000000..60f4642b --- /dev/null +++ b/www/app/transcripts/new/page.js @@ -0,0 +1,56 @@ +"use client"; +import React, { useEffect, useState } from "react"; +import Recorder from "../recorder"; +import { Dashboard } from "../dashboard"; +import useWebRTC from "../useWebRTC"; +import useTranscript from "../useTranscript"; +import { useWebSockets } from "../useWebSockets"; +import "../../styles/button.css"; + +const App = () => { + const [stream, setStream] = useState(null); + const [disconnected, setDisconnected] = useState(false); + + useEffect(() => { + if (process.env.NEXT_PUBLIC_ENV === "development") { + document.onkeyup = (e) => { + if (e.key === "d") { + setDisconnected((prev) => !prev); + } + }; + } + }, []); + + const transcript = useTranscript(); + const webRTC = useWebRTC(stream, transcript.response?.id); + const webSockets = useWebSockets(transcript.response?.id); + + return ( +
+
+

Reflector

+

Capture The Signal, Not The Noise

+
+ + { + webRTC?.peer?.send(JSON.stringify({ cmd: "STOP" })); + setStream(null); + }} + /> + +
+ + +
+ ); +}; + +export default App; diff --git a/www/app/components/record.js b/www/app/transcripts/recorder.js similarity index 99% rename from www/app/components/record.js rename to www/app/transcripts/recorder.js index 445f7e50..41284236 100644 --- a/www/app/components/record.js +++ b/www/app/transcripts/recorder.js @@ -9,7 +9,7 @@ import Dropdown from "react-dropdown"; import "react-dropdown/style.css"; import CustomRecordPlugin from "./CustomRecordPlugin"; -import { formatTime } from "../utils"; +import { formatTime } from "../lib/time"; const AudioInputsDropdown = (props) => { const [ddOptions, setDdOptions] = useState([]); diff --git a/www/app/components/transcript.js b/www/app/transcripts/useTranscript.js similarity index 100% rename from www/app/components/transcript.js rename to www/app/transcripts/useTranscript.js diff --git a/www/app/components/webrtc.js b/www/app/transcripts/useWebRTC.js similarity index 100% rename from www/app/components/webrtc.js rename to www/app/transcripts/useWebRTC.js diff --git a/www/app/components/websocket.js b/www/app/transcripts/useWebSockets.js similarity index 100% rename from www/app/components/websocket.js rename to www/app/transcripts/useWebSockets.js diff --git a/www/pages/api/sentry-example-api.js b/www/pages/api/sentry-example-api.js deleted file mode 100644 index ac07eec0..00000000 --- a/www/pages/api/sentry-example-api.js +++ /dev/null @@ -1,5 +0,0 @@ -// A faulty API route to test Sentry's error monitoring -export default function handler(_req, res) { - throw new Error("Sentry Example API Route Error"); - res.status(200).json({ name: "John Doe" }); -} diff --git a/www/pages/sentry-example-page.js b/www/pages/sentry-example-page.js deleted file mode 100644 index bcace78b..00000000 --- a/www/pages/sentry-example-page.js +++ /dev/null @@ -1,87 +0,0 @@ -import Head from "next/head"; -import * as Sentry from "@sentry/nextjs"; - -export default function Home() { - return ( -
- - Sentry Onboarding - - - -
-

- - - -

- -

Get started by sending us a sample error:

- - -

- Next, look for the error on the{" "} - - Issues Page - - . -

-

- For more information, see{" "} - - https://docs.sentry.io/platforms/javascript/guides/nextjs/ - -

-
-
- ); -}