From 66b68270cd1861dcc0511c0bddbd6702bb5fab1a Mon Sep 17 00:00:00 2001 From: James Ketrenos Date: Wed, 18 Jun 2025 14:34:52 -0700 Subject: [PATCH] Prettier / eslint reformatting --- frontend/.eslintrc.json | 1 - frontend/{prettier => .prettierrc} | 0 frontend/package.json | 4 +- frontend/src/BackstoryApp.tsx | 102 +-- frontend/src/BackstoryTheme.tsx | 86 +- frontend/src/components/BackstoryQuery.tsx | 10 +- frontend/src/components/BackstoryTab.tsx | 21 +- .../src/components/BackstoryTextField.tsx | 244 +++--- frontend/src/components/Conversation.tsx | 202 ++--- frontend/src/components/CopyBubble.tsx | 22 +- .../src/components/DeleteConfirmation.tsx | 53 +- frontend/src/components/Document.tsx | 14 +- frontend/src/components/DocumentManager.tsx | 270 +++---- .../EmailVerificationComponents.tsx | 222 +++--- frontend/src/components/ExpandMore.tsx | 12 +- frontend/src/components/GenerateImage.tsx | 59 +- frontend/src/components/JobCreator.tsx | 248 +++--- frontend/src/components/JobMatchAnalysis.tsx | 313 ++++---- frontend/src/components/LoadingComponent.tsx | 37 +- frontend/src/components/LocationInput.tsx | 121 +-- frontend/src/components/Mermaid.tsx | 20 +- frontend/src/components/Message.tsx | 368 ++++----- frontend/src/components/Pulse.tsx | 65 +- frontend/src/components/Quote.tsx | 126 ++- frontend/src/components/ResumeGenerator.tsx | 167 ++-- frontend/src/components/Scrollable.tsx | 20 +- frontend/src/components/Snack.tsx | 109 ++- frontend/src/components/StyledMarkdown.tsx | 98 ++- frontend/src/components/VectorVisualizer.tsx | 434 +++++----- .../src/components/layout/BackstoryLayout.tsx | 128 ++- .../src/components/layout/BackstoryRoutes.tsx | 43 +- frontend/src/components/layout/Footer.tsx | 75 +- frontend/src/components/layout/Header.tsx | 284 +++---- frontend/src/components/ui/AIBanner.tsx | 21 +- frontend/src/components/ui/BackstoryLogo.tsx | 24 +- frontend/src/components/ui/Beta.tsx | 25 +- frontend/src/components/ui/CandidateInfo.tsx | 145 ++-- .../src/components/ui/CandidatePicker.tsx | 53 +- frontend/src/components/ui/ComingSoon.tsx | 10 +- frontend/src/components/ui/JobInfo.tsx | 229 +++--- frontend/src/components/ui/JobPicker.tsx | 55 +- frontend/src/components/ui/JobViewer.tsx | 260 +++--- frontend/src/components/ui/LoginRequired.tsx | 10 +- .../src/components/ui/LoginRestricted.tsx | 8 +- frontend/src/components/ui/ResumeInfo.tsx | 256 +++--- frontend/src/components/ui/ResumeViewer.tsx | 309 ++++---- frontend/src/components/ui/StatusIcon.tsx | 32 +- frontend/src/config/navigationConfig.tsx | 242 +++--- frontend/src/declarations.d.ts | 2 +- .../documents/BackstoryAppAnalysisPage.tsx | 175 ++-- .../BackstoryThemeVisualizerPage.tsx | 124 +-- .../src/documents/BackstoryUIOverviewPage.tsx | 373 ++++----- frontend/src/documents/MockupPage.tsx | 340 +++----- frontend/src/documents/UserManagement.tsx | 183 ++--- frontend/src/hooks/AuthContext.tsx | 264 +++--- frontend/src/hooks/GlobalContext.tsx | 131 ++- frontend/src/hooks/useAutoScrollToBottom.tsx | 68 +- frontend/src/index.tsx | 18 +- frontend/src/pages/BetaPage.tsx | 162 ++-- frontend/src/pages/CandidateChatPage.tsx | 185 ++--- frontend/src/pages/DocsPage.tsx | 277 +++---- frontend/src/pages/FindCandidatePage.tsx | 6 +- frontend/src/pages/GenerateCandidate.tsx | 240 +++--- frontend/src/pages/HomePage.tsx | 284 +++---- frontend/src/pages/HowItWorks.tsx | 241 +++--- frontend/src/pages/JobAnalysisPage.tsx | 210 ++--- frontend/src/pages/LoadingPage.tsx | 24 +- frontend/src/pages/LoginPage.tsx | 50 +- frontend/src/pages/OldChatPage.tsx | 43 +- frontend/src/pages/VectorVisualizerPage.tsx | 12 +- frontend/src/pages/candidate/Dashboard.tsx | 103 +-- frontend/src/pages/candidate/Profile.tsx | 493 +++++------- .../src/pages/candidate/ProfileWizard.tsx | 127 ++- .../src/pages/candidate/RegistrationForms.tsx | 373 ++++----- frontend/src/pages/candidate/Settings.tsx | 44 +- frontend/src/routes/CandidateRoute.tsx | 35 +- frontend/src/services/api-client.ts | 750 +++++++----------- frontend/src/types/conversion.ts | 84 +- frontend/src/types/navigation.ts | 6 +- frontend/src/types/theme.d.ts | 4 +- frontend/src/types/types.ts | 608 ++++++-------- 81 files changed, 5003 insertions(+), 6693 deletions(-) rename frontend/{prettier => .prettierrc} (100%) diff --git a/frontend/.eslintrc.json b/frontend/.eslintrc.json index 16aec3f..92d7daf 100644 --- a/frontend/.eslintrc.json +++ b/frontend/.eslintrc.json @@ -1,7 +1,6 @@ { "env": { "browser": true, - "es2021": true, "jest": true }, "extends": [ diff --git a/frontend/prettier b/frontend/.prettierrc similarity index 100% rename from frontend/prettier rename to frontend/.prettierrc diff --git a/frontend/package.json b/frontend/package.json index e1beaca..82b4af4 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -51,8 +51,8 @@ "start": "WDS_SOCKET_HOST=backstory-beta.ketrenos.com WDS_SOCKET_PORT=443 craco start", "build": "craco build", "test": "craco test", - "lint": "eslint src/**/*.{ts,tsx}", - "lint:fix": "eslint src/**/*.{ts,tsx} --fix", + "lint": "eslint src/**/*.{ts,tsx} --no-color", + "lint:fix": "eslint src/**/*.{ts,tsx} --fix --no-color", "format": "prettier --write src/**/*.{ts,tsx}" }, "eslintConfig": { diff --git a/frontend/src/BackstoryApp.tsx b/frontend/src/BackstoryApp.tsx index fc42cfd..2206826 100644 --- a/frontend/src/BackstoryApp.tsx +++ b/frontend/src/BackstoryApp.tsx @@ -1,67 +1,53 @@ -import React, { useEffect, useState, useRef, JSX } from "react"; -import { Route, Routes, useLocation, useNavigate } from "react-router-dom"; -import { ThemeProvider } from "@mui/material/styles"; -import { backstoryTheme } from "./BackstoryTheme"; +import React, { useEffect, useState, useRef, JSX } from 'react'; +import { Route, Routes, useLocation, useNavigate } from 'react-router-dom'; +import { ThemeProvider } from '@mui/material/styles'; +import { backstoryTheme } from './BackstoryTheme'; -import { ConversationHandle } from "components/Conversation"; -import { CandidateRoute } from "routes/CandidateRoute"; -import { BackstoryLayout } from "components/layout/BackstoryLayout"; -import { ChatQuery } from "types/types"; -import { AuthProvider } from "hooks/AuthContext"; -import { AppStateProvider } from "hooks/GlobalContext"; +import { ConversationHandle } from 'components/Conversation'; +import { CandidateRoute } from 'routes/CandidateRoute'; +import { BackstoryLayout } from 'components/layout/BackstoryLayout'; +import { ChatQuery } from 'types/types'; +import { AuthProvider } from 'hooks/AuthContext'; +import { AppStateProvider } from 'hooks/GlobalContext'; -import "./BackstoryApp.css"; -import "@fontsource/roboto/300.css"; -import "@fontsource/roboto/400.css"; -import "@fontsource/roboto/500.css"; -import "@fontsource/roboto/700.css"; +import './BackstoryApp.css'; +import '@fontsource/roboto/300.css'; +import '@fontsource/roboto/400.css'; +import '@fontsource/roboto/500.css'; +import '@fontsource/roboto/700.css'; const BackstoryApp = (): JSX.Element => { - const navigate = useNavigate(); - const location = useLocation(); - const chatRef = useRef(null); - const submitQuery = (query: ChatQuery): void => { - console.log( - `handleSubmitChatQuery:`, - query, - chatRef.current ? " sending" : "no handler" - ); - chatRef.current?.submitQuery(query); - navigate("/chat"); - }; - const [page, setPage] = useState(""); + const navigate = useNavigate(); + const location = useLocation(); + const chatRef = useRef(null); + const submitQuery = (query: ChatQuery): void => { + console.log(`handleSubmitChatQuery:`, query, chatRef.current ? ' sending' : 'no handler'); + chatRef.current?.submitQuery(query); + navigate('/chat'); + }; + const [page, setPage] = useState(''); - useEffect(() => { - const currentRoute = location.pathname.split("/")[1] - ? `/${location.pathname.split("/")[1]}` - : "/"; - setPage(currentRoute); - }, [location.pathname]); + useEffect(() => { + const currentRoute = location.pathname.split('/')[1] + ? `/${location.pathname.split('/')[1]}` + : '/'; + setPage(currentRoute); + }, [location.pathname]); - // Render appropriate routes based on user type - return ( - - - - - } - /> - {/* Static/shared routes */} - - } - /> - - - - - ); + // Render appropriate routes based on user type + return ( + + + + + } /> + {/* Static/shared routes */} + } /> + + + + + ); }; export { BackstoryApp }; diff --git a/frontend/src/BackstoryTheme.tsx b/frontend/src/BackstoryTheme.tsx index cc80def..08a09b8 100644 --- a/frontend/src/BackstoryTheme.tsx +++ b/frontend/src/BackstoryTheme.tsx @@ -1,76 +1,76 @@ -import { createTheme } from "@mui/material/styles"; +import { createTheme } from '@mui/material/styles'; const backstoryTheme = createTheme({ palette: { primary: { - main: "#1A2536", // Midnight Blue - contrastText: "#D3CDBF", // Warm Gray + main: '#1A2536', // Midnight Blue + contrastText: '#D3CDBF', // Warm Gray }, secondary: { - main: "#4A7A7D", // Dusty Teal - contrastText: "#FFFFFF", // White + main: '#4A7A7D', // Dusty Teal + contrastText: '#FFFFFF', // White }, text: { - primary: "#2E2E2E", // Charcoal Black - secondary: "#1A2536", // Midnight Blue + primary: '#2E2E2E', // Charcoal Black + secondary: '#1A2536', // Midnight Blue }, background: { - default: "#D3CDBF", // Warm Gray - paper: "#FFFFFF", // White + default: '#D3CDBF', // Warm Gray + paper: '#FFFFFF', // White }, action: { - active: "#D4A017", // Golden Ochre - hover: "rgba(212, 160, 23, 0.1)", // Golden Ochre with opacity + active: '#D4A017', // Golden Ochre + hover: 'rgba(212, 160, 23, 0.1)', // Golden Ochre with opacity }, custom: { - highlight: "#D4A017", // Golden Ochre - contrast: "#2E2E2E", // Charcoal Black + highlight: '#D4A017', // Golden Ochre + contrast: '#2E2E2E', // Charcoal Black }, }, typography: { fontFamily: "'Roboto', sans-serif", h1: { - fontSize: "2rem", + fontSize: '2rem', fontWeight: 500, - color: "#2E2E2E", // Charcoal Black + color: '#2E2E2E', // Charcoal Black }, h2: { - fontSize: "1.75rem", + fontSize: '1.75rem', fontWeight: 500, - color: "#2E2E2E", // Charcoal Black - marginBottom: "1rem", + color: '#2E2E2E', // Charcoal Black + marginBottom: '1rem', }, h3: { - fontSize: "1.5rem", + fontSize: '1.5rem', fontWeight: 500, - color: "#2E2E2E", // Charcoal Black - marginBottom: "0.75rem", + color: '#2E2E2E', // Charcoal Black + marginBottom: '0.75rem', }, h4: { - fontSize: "1.25rem", + fontSize: '1.25rem', fontWeight: 500, - color: "#2E2E2E", // Charcoal Black - marginBottom: "0.5rem", + color: '#2E2E2E', // Charcoal Black + marginBottom: '0.5rem', }, body1: { - fontSize: "1rem", - color: "#2E2E2E", // Charcoal Black - marginBottom: "0.5rem", + fontSize: '1rem', + color: '#2E2E2E', // Charcoal Black + marginBottom: '0.5rem', }, body2: { - fontSize: "0.875rem", - color: "#2E2E2E", // Charcoal Black + fontSize: '0.875rem', + color: '#2E2E2E', // Charcoal Black }, }, components: { MuiLink: { styleOverrides: { root: { - color: "#4A7A7D", // Dusty Teal (your secondary color) - textDecoration: "none", - "&:hover": { - color: "#D4A017", // Golden Ochre on hover - textDecoration: "underline", + color: '#4A7A7D', // Dusty Teal (your secondary color) + textDecoration: 'none', + '&:hover': { + color: '#D4A017', // Golden Ochre on hover + textDecoration: 'underline', }, }, }, @@ -78,9 +78,9 @@ const backstoryTheme = createTheme({ MuiButton: { styleOverrides: { root: { - textTransform: "none", - "&:hover": { - backgroundColor: "rgba(212, 160, 23, 0.2)", // Golden Ochre hover + textTransform: 'none', + '&:hover': { + backgroundColor: 'rgba(212, 160, 23, 0.2)', // Golden Ochre hover }, }, }, @@ -88,7 +88,7 @@ const backstoryTheme = createTheme({ MuiAppBar: { styleOverrides: { root: { - backgroundColor: "#1A2536", // Midnight Blue + backgroundColor: '#1A2536', // Midnight Blue }, }, }, @@ -96,23 +96,23 @@ const backstoryTheme = createTheme({ styleOverrides: { root: { // padding: '0.5rem', - borderRadius: "4px", + borderRadius: '4px', }, }, }, MuiList: { styleOverrides: { root: { - padding: "0.5rem", + padding: '0.5rem', }, }, }, MuiListItem: { styleOverrides: { root: { - borderRadius: "4px", - "&:hover": { - backgroundColor: "rgba(212, 160, 23, 0.1)", // Golden Ochre with opacity + borderRadius: '4px', + '&:hover': { + backgroundColor: 'rgba(212, 160, 23, 0.1)', // Golden Ochre with opacity }, }, }, diff --git a/frontend/src/components/BackstoryQuery.tsx b/frontend/src/components/BackstoryQuery.tsx index d70453c..b58b65a 100644 --- a/frontend/src/components/BackstoryQuery.tsx +++ b/frontend/src/components/BackstoryQuery.tsx @@ -1,7 +1,7 @@ -import Box from "@mui/material/Box"; -import Button from "@mui/material/Button"; +import Box from '@mui/material/Box'; +import Button from '@mui/material/Button'; -import { CandidateQuestion } from "types/types"; +import { CandidateQuestion } from 'types/types'; type ChatSubmitQueryInterface = (query: CandidateQuestion) => void; @@ -20,8 +20,8 @@ const BackstoryQuery = (props: BackstoryQueryInterface) => {