Fakultas Ilmu Komputer UI

Commit 4451d5f3 authored by FadhilP's avatar FadhilP
Browse files

[REFACTOR] Reallocate error

parent 99ea7301
......@@ -2,8 +2,9 @@ import React from "react";
import { css } from "@emotion/core";
import { ErrorDiv } from "../../component/html/html";
import FormSubkategori from "./FormSubkategori";
import LinkYellow from "../../component/LinkYellow";
import useSendData from "../../utils/useSendData";
import { Link } from "@reach/router";
import ArrowBackIcon from "@material-ui/icons/ArrowBack";
const TambahSubkategori = () => {
const url = `${process.env.REACT_APP_BASE_URL}/subcategories/`;
......@@ -28,34 +29,27 @@ const TambahSubkategori = () => {
flex-direction: column;
`}
>
<div>
{error && (
<ErrorDiv>
Error !, Data tidak dapat disimpan, pastikan nama subkategori unik.
</ErrorDiv>
)}
</div>
<div
css={css`
font-size: 35px;
`}
>
TAMBAH SUBKATEGORI
</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="/subkategori/tambah">TAMBAH</LinkYellow>
<LinkYellow to="/subkategori">LIHAT</LinkYellow>
<Link to="/subkategori" style={{ color: "#000000" }}>
<ArrowBackIcon fontSize="large" />
</Link>
<div
css={css`
display: inline;
margin-left: 2rem;
`}
>
TAMBAH SUBKATEGORI
</div>
</div>
<FormSubkategori {...{ onSubmit }} />
<FormSubkategori {...{ 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