Fakultas Ilmu Komputer UI

Commit 081b85ca authored by FadhilP's avatar FadhilP
Browse files

[REFACTOR] Reallocate error

parent d1b21d63
import React from "react";
import { css } from "@emotion/core";
import { ErrorDiv } from "../../component/html/html";
import FormKategori from "./FormKategori";
import LinkYellow from "../../component/LinkYellow";
import useSendData from "../../utils/useSendData";
import { Link } from "@reach/router";
import ArrowBackIcon from "@material-ui/icons/ArrowBack";
const TambahKategori = () => {
const url = `${process.env.REACT_APP_BASE_URL}/categories/`;
......@@ -27,30 +27,27 @@ const TambahKategori = () => {
flex-direction: column;
`}
>
<div>
{error && <ErrorDiv>Error !, Data tidak dapat disimpan</ErrorDiv>}
</div>
<div
css={css`
font-size: 35px;
`}
>
TAMBAH KATEGORI
</div>
<div
css={css`
width: 35%;
display: flex;
flex-direction: row;
margin-bottom: 2rem;
margin-top: 1rem;
font-style: normal;
font-weight: 300;
font-size: 2.5rem;
line-height: 3.4rem;
`}
>
<LinkYellow to="/kategori/tambah">TAMBAH</LinkYellow>
<LinkYellow to="/kategori">LIHAT</LinkYellow>
<Link to="/kategori" style={{ color: "#000000" }}>
<ArrowBackIcon fontSize="large" />
</Link>
<div
css={css`
display: inline;
margin-left: 2rem;
`}
>
TAMBAH KATEGORI
</div>
</div>
<FormKategori {...{ onSubmit }} />
<FormKategori {...{ onSubmit, error }} />
</div>
);
};
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment