refactor: rename type and html tags

This commit is contained in:
Ruidy 2021-07-15 18:36:22 +02:00
parent 2a5f0cbd57
commit 9b418efb77
5 changed files with 15 additions and 13 deletions

View file

@ -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;

View file

@ -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>

View file

@ -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>
</>
);
}

View file

@ -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>
</>
);
}

View file

@ -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
}