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

View file

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

View file

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

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

View file

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