From de17d5443401cfae42453d08db7d258cd8040fe7 Mon Sep 17 00:00:00 2001 From: Darren Clarke Date: Thu, 25 May 2023 08:57:24 +0000 Subject: [PATCH] Metamigo frontend build fixes --- .../components/voice/voicelines/MicInput.tsx | 15 ++++++++------- apps/metamigo-frontend/lib/nextauth-adapter.ts | 3 ++- apps/metamigo-frontend/lib/phone-numbers.ts | 10 +++++----- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/apps/metamigo-frontend/components/voice/voicelines/MicInput.tsx b/apps/metamigo-frontend/components/voice/voicelines/MicInput.tsx index 8e9fcbc..28c9c5b 100644 --- a/apps/metamigo-frontend/components/voice/voicelines/MicInput.tsx +++ b/apps/metamigo-frontend/components/voice/voicelines/MicInput.tsx @@ -4,7 +4,7 @@ import dynamic from "next/dynamic"; import MicIcon from "@mui/icons-material/Mic"; import StopIcon from "@mui/icons-material/Stop"; import Button from "@mui/material/Button"; -import { makeStyles, useTheme } from "@mui/material/styles"; +import { useTheme } from "@mui/material/styles"; // makeStyles, // import AudioPlayer from "material-ui-audio-player"; import { useStopwatch } from "react-timer-hook"; import style from "./MicInput.module.css"; @@ -43,22 +43,22 @@ const blobToResult = async (blob: Blob) => { return result; }; -const resultToDataUri = (result: Record): string => { +/* const resultToDataUri = (result: Record): string => { if (!result || !result["audio/webm"]) return ""; const base64 = result["audio/webm"]; const r = `data:audio/webm;base64,${base64}`; return r; -}; +}; */ const MicInput = (props: any) => { const { seconds, minutes, hours, start, reset, pause } = useStopwatch(); const theme = useTheme(); const { - field: { value, onChange }, + field: { onChange }, // value } = useInput(props); const [record, setRecorder] = useState({ record: false }); - const decodedValue = resultToDataUri(value); + // const decodedValue = resultToDataUri(value); const startRecording = () => { setRecorder({ record: true }); reset(); @@ -80,11 +80,12 @@ const MicInput = (props: any) => { } const isRecording = record.record; - const canPlay = !isRecording && decodedValue; + // const canPlay = !isRecording && decodedValue; const duration = `${hours.toString().padStart(2, "0")}:${minutes .toString() .padStart(2, "0")}:${seconds.toString().padStart(2, "0")}`; + /* const useStyles = makeStyles(() => ({ volumeIcon: { display: "none", @@ -93,7 +94,7 @@ const MicInput = (props: any) => { display: "none", }, })); - +*/ return (
diff --git a/apps/metamigo-frontend/lib/nextauth-adapter.ts b/apps/metamigo-frontend/lib/nextauth-adapter.ts index 3b8c7fa..2a121f2 100644 --- a/apps/metamigo-frontend/lib/nextauth-adapter.ts +++ b/apps/metamigo-frontend/lib/nextauth-adapter.ts @@ -1,4 +1,5 @@ /* eslint-disable unicorn/no-null */ +/* eslint-disable max-params */ import type { Adapter } from "next-auth/adapters"; // @ts-expect-error: Missing export import type { AppOptions } from "next-auth"; @@ -17,7 +18,7 @@ export interface Profile { createdBy: string; } -export type User = Profile & { id: string; createdAt: Date; updatedAt: Date }; +export type User = Profile & { id: string; createdAt: Date; updatedAt: Date; }; export interface Session { userId: string; diff --git a/apps/metamigo-frontend/lib/phone-numbers.ts b/apps/metamigo-frontend/lib/phone-numbers.ts index 566ebe1..bde973b 100644 --- a/apps/metamigo-frontend/lib/phone-numbers.ts +++ b/apps/metamigo-frontend/lib/phone-numbers.ts @@ -13,11 +13,11 @@ export const sanitizeE164Number = (phoneNumber: string) => { if (!phoneNumber) return ""; if (!phoneNumber.trim()) return ""; const sanitized = phoneNumber - .replace(/\s/g, "") - .replace(/\./g, "") - .replace(/-/g, "") - .replace(/\(/g, "") - .replace(/\)/g, ""); + .replaceAll(/\s/g, "") + .replaceAll(".", "") + .replaceAll("-", "") + .replaceAll("(", "") + .replaceAll(")", ""); if (sanitized[0] !== "+") return `+${sanitized}`; return sanitized;