mirror of
https://github.com/rjNemo/melon_frontend
synced 2026-06-12 13:26:43 +00:00
refactor: rename type and html tags
This commit is contained in:
parent
2a5f0cbd57
commit
9b418efb77
5 changed files with 15 additions and 13 deletions
|
|
@ -1,10 +1,10 @@
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { Bill, BillForm } from '../types/bill';
|
import { Bill, BillFormType } from '../types/bill';
|
||||||
|
|
||||||
const BASE_URL = process.env.REACT_APP_API_URL;
|
const BASE_URL = process.env.REACT_APP_API_URL;
|
||||||
const client = axios.create({ baseURL: BASE_URL });
|
const client = axios.create({ baseURL: BASE_URL });
|
||||||
|
|
||||||
export const createBill = async (data: BillForm) => {
|
export const createBill = async (data: BillFormType) => {
|
||||||
try {
|
try {
|
||||||
const { data: response } = await client.post<number>('/', data);
|
const { data: response } = await client.post<number>('/', data);
|
||||||
return response;
|
return response;
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,9 @@ export const withLayout =
|
||||||
</Row>
|
</Row>
|
||||||
</Header>
|
</Header>
|
||||||
<Content style={{ padding: '20px 50px' }}>
|
<Content style={{ padding: '20px 50px' }}>
|
||||||
|
<main>
|
||||||
<Component {...props} />
|
<Component {...props} />
|
||||||
|
</main>
|
||||||
</Content>
|
</Content>
|
||||||
<Footer style={{ textAlign: 'center' }}>🍉 Melon - Property Management</Footer>
|
<Footer style={{ textAlign: 'center' }}>🍉 Melon - Property Management</Footer>
|
||||||
</Layout>
|
</Layout>
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ function BillsPage() {
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<section>
|
<>
|
||||||
<h1>All bills</h1>
|
<h1>All bills</h1>
|
||||||
<List
|
<List
|
||||||
grid={{ gutter: 16, column: 4 }}
|
grid={{ gutter: 16, column: 4 }}
|
||||||
|
|
@ -36,7 +36,7 @@ function BillsPage() {
|
||||||
</Link>
|
</Link>
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
</section>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { Button, Col, Image, Row } from 'antd';
|
import { Button, Image, Row } from 'antd';
|
||||||
import { useHistory } from 'react-router-dom';
|
import { useHistory } from 'react-router-dom';
|
||||||
import NotFoundImage from '../assets/notFound/404.png';
|
import NotFoundImage from '../assets/notFound/404.png';
|
||||||
import { withLayout } from '../layouts/main';
|
import { withLayout } from '../layouts/main';
|
||||||
|
|
@ -6,7 +6,7 @@ import { withLayout } from '../layouts/main';
|
||||||
function NotFoundPage() {
|
function NotFoundPage() {
|
||||||
const history = useHistory();
|
const history = useHistory();
|
||||||
return (
|
return (
|
||||||
<Col>
|
<>
|
||||||
<Row justify="center">
|
<Row justify="center">
|
||||||
<Button size="large" type="link" onClick={() => history.push('/')}>
|
<Button size="large" type="link" onClick={() => history.push('/')}>
|
||||||
Go Back to Safety
|
Go Back to Safety
|
||||||
|
|
@ -15,7 +15,7 @@ function NotFoundPage() {
|
||||||
<Row justify="center">
|
<Row justify="center">
|
||||||
<Image src={NotFoundImage} preview={false} width={800} />
|
<Image src={NotFoundImage} preview={false} width={800} />
|
||||||
</Row>
|
</Row>
|
||||||
</Col>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
export type BillForm = {
|
export type BillFormType = {
|
||||||
name: string;
|
name: string;
|
||||||
phoneNumber: string;
|
phoneNumber: string;
|
||||||
price: number;
|
price: number;
|
||||||
|
|
@ -29,7 +29,7 @@ export interface Bill {
|
||||||
|
|
||||||
export enum Room {
|
export enum Room {
|
||||||
t2,
|
t2,
|
||||||
t3,
|
t3
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum Platform {
|
export enum Platform {
|
||||||
|
|
@ -37,19 +37,19 @@ export enum Platform {
|
||||||
booking,
|
booking,
|
||||||
airbnb,
|
airbnb,
|
||||||
tripadvisor,
|
tripadvisor,
|
||||||
perso,
|
perso
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum PaymentMethod {
|
export enum PaymentMethod {
|
||||||
card,
|
card,
|
||||||
cash,
|
cash,
|
||||||
cheque,
|
cheque,
|
||||||
transfer,
|
transfer
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum PaymentStatus {
|
export enum PaymentStatus {
|
||||||
pending,
|
pending,
|
||||||
canceled,
|
canceled,
|
||||||
completed,
|
completed,
|
||||||
refund,
|
refund
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue