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