Skip to content

Commit

Permalink
minor fixes after code review
Browse files Browse the repository at this point in the history
  • Loading branch information
BartoszButrymSoftwareMill committed Jan 24, 2025
1 parent c73992c commit 1664efe
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 15 deletions.
3 changes: 2 additions & 1 deletion docs/stack.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ Bootzooka's stack consists of the following technologies/tools, on the backend:

And on the frontend:

- [Vite](https://vite.dev/) (build tool)
- [TypeScript](https://www.typescriptlang.org) (JavaScript superset)
- [react](https://react.dev/)
- [Swagger](https://swagger.io) (interactive API docs)
- [yarn](https://yarnpkg.com) (build tool)
- [yarn](https://yarnpkg.com) (package manager)
- [formik](https://formik.org/) (forms)
- [yup](https://www.npmjs.com/package/yup/v/1.3.3) (validation)
- [openapi-codegen](https://github.com/fabien0102/openapi-codegen) (generate ui functions from OpenAPI specifications)
Expand Down
6 changes: 3 additions & 3 deletions ui/src/main/Main/Main.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import { useContext } from 'react';
import { UserContext } from 'contexts/UserContext/User.context';
import useLoginOnApiKey from './useLoginOnApiKey';
import useLocalStoragedApiKey from './useLocalStoragedApiKey';
import { Top } from 'main/Top/Top';
import { Footer } from 'main/Footer/Footer';
import { Loader } from 'main/Loader/Loader';
import { ForkMe } from 'main/ForkMe/ForkMe';
import { Routes } from 'main/Routes/Routes';
import useLoginOnApiKey from './useLoginOnApiKey';
import useLocalStorageApiKey from './useLocalStorageApiKey';

export const Main = () => {
const {
state: { loggedIn },
} = useContext(UserContext);

useLocalStoragedApiKey();
useLocalStorageApiKey();
useLoginOnApiKey();

if (loggedIn === null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ import { render, screen } from '@testing-library/react';
import { userEvent } from '@testing-library/user-event';
import { UserContextProvider, UserAction } from 'contexts';
import { UserContext } from 'contexts/UserContext/User.context';
import useLocalStoragedApiKey from './useLocalStoragedApiKey';
import useLocalStorageApiKey from './useLocalStorageApiKey';

const TestComponent: React.FC<{ actions?: UserAction[]; label?: string }> = ({
actions,
label,
}) => {
const { state, dispatch } = useContext(UserContext);
useLocalStoragedApiKey();
useLocalStorageApiKey();
return (
<>
<div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useContext, useEffect, useRef } from 'react';
import { UserContext } from 'contexts/UserContext/User.context';

const useLocalStoragedApiKey = () => {
const useLocalStorageApiKey = () => {
const {
dispatch,
state: { apiKey, loggedIn },
Expand Down Expand Up @@ -34,4 +34,4 @@ const useLocalStoragedApiKey = () => {
}, [loggedIn]);
};

export default useLocalStoragedApiKey;
export default useLocalStorageApiKey;
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ export const validationSchema = Yup.object({
.min(3, 'At least 3 characters required')
.required('Required'),
email: Yup.string()
.email('Correct email address required')
.email('Valid email address required')
.required('Required'),
});
2 changes: 1 addition & 1 deletion ui/src/pages/Register/Register.validations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export const validationSchema = Yup.object({
.min(3, 'At least 3 characters required')
.required('Required'),
email: Yup.string()
.email('Correct email address required')
.email('Valid email address required')
.required('Required'),
password: Yup.string()
.min(5, 'At least 5 characters required')
Expand Down
3 changes: 0 additions & 3 deletions ui/tsconfig.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,19 @@
"module": "ESNext",
"skipLibCheck": true,

/* Bundler mode */
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"isolatedModules": true,
"moduleDetection": "force",
"noEmit": true,
"jsx": "react-jsx",

/* Linting */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,
"noUncheckedSideEffectImports": true,

/* Path aliasses */
"paths": {
"api/*": ["./src/api/*"],
"assets/*": ["./src/assets/*"],
Expand Down
2 changes: 0 additions & 2 deletions ui/tsconfig.node.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@
"module": "ESNext",
"skipLibCheck": true,

/* Bundler mode */
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"isolatedModules": true,
"moduleDetection": "force",
"noEmit": true,

/* Linting */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
Expand Down

0 comments on commit 1664efe

Please sign in to comment.