Skip to content

Commit

Permalink
chore: prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
steveoh committed Feb 4, 2025
1 parent de46427 commit 912d646
Show file tree
Hide file tree
Showing 76 changed files with 784 additions and 1,622 deletions.
6 changes: 1 addition & 5 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
export default {
stories: ['../src/**/*.stories.@(js|jsx|ts|tsx)'],
addons: [
'@storybook/addon-links',
'@storybook/addon-essentials',
'@storybook/addon-interactions',
],
addons: ['@storybook/addon-links', '@storybook/addon-essentials', '@storybook/addon-interactions'],
framework: {
name: '@storybook/react-vite',
options: {},
Expand Down
2 changes: 1 addition & 1 deletion .storybook/preview-head.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<script>
window.global = window;
</script>
</script>
17 changes: 1 addition & 16 deletions commitlint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,6 @@ export default {
extends: ['@commitlint/config-conventional'],
rules: {
'scope-enum': [2, 'always', ['api', 'app']],
'type-enum': [
2,
'always',
[
'build',
'chore',
'ci',
'docs',
'feat',
'fix',
'refactor',
'deps',
'style',
'test',
],
],
'type-enum': [2, 'always', ['build', 'chore', 'ci', 'docs', 'feat', 'fix', 'refactor', 'deps', 'style', 'test']],
},
};
7 changes: 1 addition & 6 deletions firebase.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,7 @@
"source": "functions",
"runtime": "nodejs20",
"codebase": "default",
"ignore": [
"node_modules",
".git",
"firebase-debug.log",
"firebase-debug.*.log"
]
"ignore": ["node_modules", ".git", "firebase-debug.log", "firebase-debug.*.log"]
}
],
"firestore": {
Expand Down
3 changes: 2 additions & 1 deletion functions/database/submissions/onCreateMonument.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export const createMonumentRecord = async (record, id) => {
} catch (error) {
logger.error(
'error fetching surveyor license. using empty string',
error,
record.submitted_by,
{
structuredData: true,
Expand Down Expand Up @@ -92,7 +93,7 @@ export const createMonumentRecord = async (record, id) => {

await doc.update({ monument: fileName });
} catch (error) {
logger.error('error updating monument record sheet', fileName, {
logger.error('error updating monument record sheet', fileName, error, {
structuredData: true,
});
}
Expand Down
2 changes: 1 addition & 1 deletion functions/emailHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const notify = (key, template) => {
{ nodeEnv: process.env.NODE_ENV },
{
structuredData: true,
}
},
);

return Promise.resolve([
Expand Down
1 change: 1 addition & 0 deletions functions/https/postGeneratePreview.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export const generatePreview = async (data, auth) => {
logger.error(
'error fetching surveyor license. using empty string',
auth.uid,
error,
{
structuredData: true,
},
Expand Down
8 changes: 6 additions & 2 deletions functions/pdfHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,16 @@ export const getPdfAssets = async (bucket, metadata, seal) => {
try {
images = await getBase64Images(bucket, imagePaths);
} catch (error) {
logger.error('could not get binary images');
logger.error('could not get binary images', error, {
structuredData: true,
});
}
try {
pdfs = await getBinaryPdfs(bucket, pdfPaths);
} catch (error) {
logger.error('could not get binary pdfs');
logger.error('could not get binary pdfs', error, {
structuredData: true,
});
}

return { images, pdfs };
Expand Down
36 changes: 18 additions & 18 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="https://gis.utah.gov/images/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Utah PLSS Corner Points: Provided by the UGRC</title>
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta
name="description"
content="View and submit corner monument information for the Utah Public Lands Survey System."
/>
</head>

<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="https://gis.utah.gov/images/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Utah PLSS Corner Points: Provided by the UGRC</title>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="description"
content="View and submit corner monument information for the Utah Public Lands Survey System." />
</head>

<body>
<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>
</body>

<body>
<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>
</body>
</html>
42 changes: 11 additions & 31 deletions src/components/app/App.jsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
import { useImmerReducer } from 'use-immer';
import {
AnalyticsProvider,
AuthProvider,
useFirebaseApp,
FunctionsProvider,
StorageProvider,
} from 'reactfire';
import { getAnalytics } from 'firebase/analytics';
import { getAuth, connectAuthEmulator } from 'firebase/auth';
import { getFunctions, connectFunctionsEmulator } from 'firebase/functions';
import { getStorage, connectStorageEmulator } from 'firebase/storage';
import { getFirestore, connectFirestoreEmulator } from 'firebase/firestore';
import reduce, { defaults } from '../reducers/AppReducer';
import { connectAuthEmulator, getAuth } from 'firebase/auth';
import { connectFirestoreEmulator, getFirestore } from 'firebase/firestore';
import { connectFunctionsEmulator, getFunctions } from 'firebase/functions';
import { connectStorageEmulator, getStorage } from 'firebase/storage';
import { AnalyticsProvider, AuthProvider, FunctionsProvider, StorageProvider, useFirebaseApp } from 'reactfire';
import { useImmerReducer } from 'use-immer';
import Drawer from '../layoutElements/Drawer.jsx';
import Menu from '../layoutElements/Menu.jsx';
import Map from '../pageElements/Map.jsx';
import reduce, { defaults } from '../reducers/AppReducer';

export default function App() {
const [state, dispatch] = useImmerReducer(reduce, defaults);
Expand All @@ -38,10 +32,7 @@ export default function App() {
}
}

if (
typeof window === 'undefined' ||
!window['_firebase_functions_emulator']
) {
if (typeof window === 'undefined' || !window['_firebase_functions_emulator']) {
try {
connectFunctionsEmulator(functions, 'localhost', 5001);
} catch {
Expand All @@ -52,10 +43,7 @@ export default function App() {
}
}

if (
typeof window === 'undefined' ||
!window['_firebase_storage_emulator']
) {
if (typeof window === 'undefined' || !window['_firebase_storage_emulator']) {
try {
connectStorageEmulator(storage, 'localhost', 9199);
} catch {
Expand All @@ -66,10 +54,7 @@ export default function App() {
}
}

if (
typeof window === 'undefined' ||
!window['_firebase_firestore_emulator']
) {
if (typeof window === 'undefined' || !window['_firebase_firestore_emulator']) {
try {
connectFirestoreEmulator(firestore, 'localhost', 8080);
} catch {
Expand All @@ -87,12 +72,7 @@ export default function App() {
<FunctionsProvider sdk={functions}>
<StorageProvider sdk={storage}>
<main className="app grid h-full w-screen">
<Map
state={state.map}
color={state.addPoint.color}
drawerOpen={state.drawerOpen}
dispatch={dispatch}
/>
<Map state={state.map} color={state.addPoint.color} drawerOpen={state.drawerOpen} dispatch={dispatch} />
<Menu drawerOpen={state.drawerOpen} dispatch={dispatch}>
menu
</Menu>
Expand Down
10 changes: 3 additions & 7 deletions src/components/contexts/SubmissionContext.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createContext } from 'react';
import PropTypes from 'prop-types';
import { useMachine } from '@xstate/react';
import PropTypes from 'prop-types';
import { createContext } from 'react';
import { submissionMachine } from '../machines';

export const SubmissionContext = createContext({});
Expand All @@ -10,11 +10,7 @@ export const SubmissionProvider = ({ children, context }) => {
input: { ...context },
});

return (
<SubmissionContext.Provider value={[state, send]}>
{children}
</SubmissionContext.Provider>
);
return <SubmissionContext.Provider value={[state, send]}>{children}</SubmissionContext.Provider>;
};

SubmissionProvider.propTypes = {
Expand Down
26 changes: 5 additions & 21 deletions src/components/formElements/Buttons.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { ExclamationCircleIcon } from '@heroicons/react/20/solid';
import clsx from 'clsx';
import PropTypes from 'prop-types';
import { OAuthProvider, signInWithPopup } from 'firebase/auth';
import PropTypes from 'prop-types';
import { useAuth } from 'reactfire';
import { ExclamationCircleIcon } from '@heroicons/react/20/solid';

export const LogInButton = () => {
const auth = useAuth();
Expand Down Expand Up @@ -154,24 +154,15 @@ export const Button = ({
fill="none"
viewBox="0 0 24 24"
>
<circle
className="opacity-25"
cx="12"
cy="12"
r="10"
stroke="currentColor"
strokeWidth="4"
></circle>
<circle className="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" strokeWidth="4"></circle>
<path
className="opacity-75"
fill="currentColor"
d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
></path>
</svg>
)}
{state === 'error' && (
<ExclamationCircleIcon className="-ml-1 mr-2 h-5 w-5 text-red-500" />
)}
{state === 'error' && <ExclamationCircleIcon className="-ml-1 mr-2 h-5 w-5 text-red-500" />}
{children}
</button>
);
Expand Down Expand Up @@ -210,14 +201,7 @@ Button.propTypes = {
buttonGroup: PropTypes.object,
};

export const Link = ({
href,
children,
target,
rel,
buttonGroup,
style = 'link',
}) => {
export const Link = ({ href, children, target, rel, buttonGroup, style = 'link' }) => {
const attributes = {
target,
rel,
Expand Down
Loading

0 comments on commit 912d646

Please sign in to comment.