mirror of
https://github.com/rjNemo/melon_frontend
synced 2026-06-10 04:16:40 +00:00
refactor
This commit is contained in:
parent
7ee04ddef0
commit
735354da72
9 changed files with 31 additions and 38 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -19,3 +19,4 @@ yarn-error.log*
|
|||
|
||||
.vscode/
|
||||
.idea/
|
||||
*.pem
|
||||
|
|
@ -1,20 +1,17 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<meta name="theme-color" content="#000000" />
|
||||
<meta
|
||||
name="description"
|
||||
content="Web site created using create-react-app"
|
||||
/>
|
||||
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
|
||||
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
|
||||
<title>Melon | Property Management</title>
|
||||
</head>
|
||||
<body>
|
||||
<noscript>You need to enable JavaScript to run this app.</noscript>
|
||||
<div id="root"></div>
|
||||
</body>
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<link rel="icon" href="%PUBLIC_URL%/favicon.ico"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<meta name="theme-color" content="#000000"/>
|
||||
<meta name="description" content="Web site created using create-react-app"/>
|
||||
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png"/>
|
||||
<link rel="manifest" href="%PUBLIC_URL%/manifest.json"/>
|
||||
<title>Melon | Property Management</title>
|
||||
</head>
|
||||
<body>
|
||||
<noscript>You need to enable JavaScript to run this app.</noscript>
|
||||
<div id="root"></div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -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(<App />);
|
||||
const linkElement = screen.getByText(/learn react/i);
|
||||
expect(linkElement).toBeInTheDocument();
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import Router from "./Router";
|
||||
import Router from './Router';
|
||||
|
||||
export default function App() {
|
||||
return <Router />;
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ export const createBill = async (data: BillFormType) => {
|
|||
return 0;
|
||||
}
|
||||
};
|
||||
|
||||
export const updateBill = async (id: number, data: BillFormType): Promise<Response<void>> => {
|
||||
try {
|
||||
const { data: response } = await client.put<void>(`${billsURL}/${id}`, data);
|
||||
|
|
@ -21,6 +22,7 @@ export const updateBill = async (id: number, data: BillFormType): Promise<Respon
|
|||
return { error };
|
||||
}
|
||||
};
|
||||
|
||||
export const fetchOneBill = async (id: number): Promise<Response<Bill>> => {
|
||||
try {
|
||||
const { data } = await client.get<Bill>(`${billsURL}/${id}`);
|
||||
|
|
@ -30,6 +32,7 @@ export const fetchOneBill = async (id: number): Promise<Response<Bill>> => {
|
|||
return { error };
|
||||
}
|
||||
};
|
||||
|
||||
export const fetchAllBills = async () => {
|
||||
try {
|
||||
const { data } = await client.get<Bill[]>(billsURL);
|
||||
|
|
|
|||
|
|
@ -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}
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
@import "antd/dist/antd.css";
|
||||
@import 'antd/dist/antd.css';
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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"]
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue