Cleans up code

This commit is contained in:
Vazhin Tayeb 2021-01-15 09:43:25 +03:00 committed by Muhammad Azeez
parent 96c8ba64dd
commit 632fc0c166
4 changed files with 5 additions and 15 deletions

View File

@ -1,7 +1,6 @@
import React, { useState, useEffect } from "react"; import React, { useState, useEffect } from "react";
import { useSelector } from "react-redux"; import { useSelector } from "react-redux";
import * as apiService from "../../services/apiService"; import * as apiService from "../../services/apiService";
import { prettifyJson } from "../../utils/jsonUtils";
import Heading1 from "./Heading1"; import Heading1 from "./Heading1";
import Button from "./Button"; import Button from "./Button";
import Table from "./table/Table"; import Table from "./table/Table";
@ -50,6 +49,7 @@ const VehiclesMain = () => {
useEffect(() => { useEffect(() => {
getVehicles(); getVehicles();
// eslint-disable-next-line
}, []); }, []);
async function getVehicles() { async function getVehicles() {
@ -75,14 +75,6 @@ const VehiclesMain = () => {
</h3> </h3>
<Table vehicleData={vehicleData} /> <Table vehicleData={vehicleData} />
{/* <ul>
{vehicleData.map((v) => (
<li key={v.id}>
{v.color} {v.model} ({v.licensePlate}) - {getType(v.type)}
</li>
))}
</ul> */}
</> </>
) : ( ) : (
<h3 className="font-light font-inter text-black-custom my-32 self-center"> <h3 className="font-light font-inter text-black-custom my-32 self-center">

View File

@ -5,9 +5,9 @@ import { BsThreeDots } from "react-icons/bs";
const EditBtns = () => { const EditBtns = () => {
return ( return (
<div className="flex"> <div className="flex">
<FiTrash className="mx-3" /> <FiTrash className="mx-3 cursor-pointer" />
<FiSettings className="mx-3" /> <FiSettings className="mx-3 cursor-pointer" />
<BsThreeDots className="mx-3 text-3xl" /> <BsThreeDots className="mx-3 text-3xl cursor-pointer" />
</div> </div>
); );
}; };

View File

@ -5,6 +5,7 @@ import TableData from "./TableData";
const Table = ({ vehicleData }) => { const Table = ({ vehicleData }) => {
function getType(type) { function getType(type) {
// eslint-disable-next-line
switch (type) { switch (type) {
case 1: case 1:
return "Sedan"; return "Sedan";

View File

@ -1,3 +0,0 @@
export const prettifyJson = (value) => {
return JSON.stringify(value, null, 2);
}