From 735354da72bb9421f48ecbacca7c29e1181ba33f Mon Sep 17 00:00:00 2001 From: Ruidy Date: Sat, 10 Sep 2022 13:02:18 +0200 Subject: [PATCH] refactor --- .gitignore | 1 + public/index.html | 31 ++++++++++++++----------------- src/App.test.tsx | 6 +++--- src/App.tsx | 2 +- src/api/bills.ts | 3 +++ src/components/inputSelect.tsx | 6 +++--- src/index.css | 2 +- src/reportWebVitals.ts | 4 ++-- tsconfig.json | 14 +++----------- 9 files changed, 31 insertions(+), 38 deletions(-) diff --git a/.gitignore b/.gitignore index 9a0a561..9bb99fe 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,4 @@ yarn-error.log* .vscode/ .idea/ +*.pem \ No newline at end of file diff --git a/public/index.html b/public/index.html index 18a068c..1797406 100644 --- a/public/index.html +++ b/public/index.html @@ -1,20 +1,17 @@ - - - - - - - - - Melon | Property Management - - - -
- + + + + + + + + + Melon | Property Management + + + +
+ diff --git a/src/App.test.tsx b/src/App.test.tsx index 9382b9a..1f03afe 100644 --- a/src/App.test.tsx +++ b/src/App.test.tsx @@ -1,7 +1,7 @@ -import { render, screen } from "@testing-library/react"; -import App from "./App"; +import { render, screen } from '@testing-library/react'; +import App from './App'; -test("renders learn react link", () => { +test('renders learn react link', () => { render(); const linkElement = screen.getByText(/learn react/i); expect(linkElement).toBeInTheDocument(); diff --git a/src/App.tsx b/src/App.tsx index 596437e..eac5c62 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,4 +1,4 @@ -import Router from "./Router"; +import Router from './Router'; export default function App() { return ; diff --git a/src/api/bills.ts b/src/api/bills.ts index 2a6a603..92fdbda 100644 --- a/src/api/bills.ts +++ b/src/api/bills.ts @@ -12,6 +12,7 @@ export const createBill = async (data: BillFormType) => { return 0; } }; + export const updateBill = async (id: number, data: BillFormType): Promise> => { try { const { data: response } = await client.put(`${billsURL}/${id}`, data); @@ -21,6 +22,7 @@ export const updateBill = async (id: number, data: BillFormType): Promise> => { try { const { data } = await client.get(`${billsURL}/${id}`); @@ -30,6 +32,7 @@ export const fetchOneBill = async (id: number): Promise> => { return { error }; } }; + export const fetchAllBills = async () => { try { const { data } = await client.get(billsURL); diff --git a/src/components/inputSelect.tsx b/src/components/inputSelect.tsx index e908b83..59c63a0 100644 --- a/src/components/inputSelect.tsx +++ b/src/components/inputSelect.tsx @@ -1,5 +1,5 @@ -import { Form, Select } from "antd"; -import { Controller } from "react-hook-form"; +import { Form, Select } from 'antd'; +import { Controller } from 'react-hook-form'; type InputSelectProps = { control: any; @@ -24,7 +24,7 @@ export const InputSelect = ({ control, name, label, placeholder, options }: Inpu } options={options.map((label, value) => ({ value, - label, + label }))} {...field} /> diff --git a/src/index.css b/src/index.css index b7b4adc..75f241a 100644 --- a/src/index.css +++ b/src/index.css @@ -1 +1 @@ -@import "antd/dist/antd.css"; +@import 'antd/dist/antd.css'; diff --git a/src/reportWebVitals.ts b/src/reportWebVitals.ts index cc8381a..cfad7f0 100644 --- a/src/reportWebVitals.ts +++ b/src/reportWebVitals.ts @@ -1,8 +1,8 @@ -import { ReportHandler } from "web-vitals"; +import { ReportHandler } from 'web-vitals'; const reportWebVitals = (onPerfEntry?: ReportHandler) => { if (onPerfEntry) { - import("web-vitals").then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { + import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { getCLS(onPerfEntry); getFID(onPerfEntry); getFCP(onPerfEntry); diff --git a/tsconfig.json b/tsconfig.json index eac4bbd..c105491 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,11 +1,7 @@ { "compilerOptions": { "target": "es5", - "lib": [ - "dom", - "dom.iterable", - "esnext" - ], + "lib": ["dom", "dom.iterable", "esnext"], "allowJs": true, "skipLibCheck": true, "esModuleInterop": true, @@ -23,10 +19,6 @@ "noEmit": true, "jsx": "react-jsx" }, - "include": [ - "src" - ], - "exclude": [ - "node_modules" - ] + "include": ["src"], + "exclude": ["node_modules"] }