Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .babelrc

This file was deleted.

1,793 changes: 272 additions & 1,521 deletions package-lock.json

Large diffs are not rendered by default.

17 changes: 7 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,7 @@
],
"dependencies": {
"express": "^4.17.1",
"json-server": "^0.16.0",
"lodash.debounce": "^4.0.8",
"react": "^16.9.0",
"react-dom": "^16.9.0",
"semantic-ui-react": "^1.0.0"
"json-server": "^0.16.0"
},
"devDependencies": {
"@testing-library/jest-dom": "5.11.4",
Expand All @@ -44,14 +40,15 @@
"@types/react": "16.9.49",
"@types/react-dom": "16.9.8",
"coveralls": "3.1.0",
"enzyme": "3.11.0",
"enzyme-adapter-react-16": "1.15.5",
"enzyme-to-json": "3.6.1",
"fetch-mock": "9.10.7",
"isomorphic-fetch": "3.0.0",
"lodash.debounce": "4.0.8",
"node-fetch": "^2.6.1",
"prettier": "2.1.2",
"prop-types": "15.7.2",
"react": "16.13.1",
"react-dom": "16.13.1",
"react-scripts": "3.4.3",
"semantic-ui-css": "2.4.1",
"semantic-ui-react": "1.3.1",
"typescript": "4.0.3"
},
"engines": {
Expand Down
Binary file added public/favicon.ico
Binary file not shown.
10 changes: 8 additions & 2 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,18 @@
<html>
<head>
<meta charset="utf-8">
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
/>
<meta name="google-site-verification" content="z-EYLvuBqfPUwJy99KVRiPvGh4BZ0HyMG_wGH0Bvl9Q" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">

<title>React Semantic UI Sortable Table Example</title>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.4.1/semantic.min.css"/>
</head>
<body>
<div id="contents"></div>
Expand Down
Binary file added public/logo192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/logo512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions public/manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
{
"short_name": "React Semantic UI Sortable Table Example",
"name": "React Semantic UI Sortable Table Example",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
},
{
"src": "logo192.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "logo512.png",
"type": "image/png",
"sizes": "512x512"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
Expand Down
4 changes: 2 additions & 2 deletions server/vehicles.json
Original file line number Diff line number Diff line change
Expand Up @@ -3789,7 +3789,7 @@
"package": "XSE",
"fuelType": "Diesel",
"transmission": "Manual",
"favorite": false
"favorite": true
},
{
"id": 380,
Expand Down Expand Up @@ -6349,7 +6349,7 @@
"package": "SE",
"fuelType": "Gas",
"transmission": "Auto",
"favorite": false
"favorite": true
},
{
"id": 636,
Expand Down
1 change: 1 addition & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from "react";
import { Button, Container, Header, Icon, Menu } from "semantic-ui-react";
import { VehicleList } from "./VehicleList";
import "semantic-ui-css/semantic.min.css";

export const App: React.FC = () => (
<Container style={{ padding: "2em 0em" }}>
Expand Down
2 changes: 1 addition & 1 deletion src/VehicleList.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from "react";
import "isomorphic-fetch";
import fetchMock from "fetch-mock";
import { VehicleList } from "./VehicleList";
import { render, screen, waitFor } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import "node-fetch";

jest.mock("lodash.debounce", () => jest.fn(fn => fn));

Expand Down
5 changes: 4 additions & 1 deletion src/VehicleList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ export const VehicleList: React.FC = () => {
limit: 10
});
const [filter, setFilter] = useState<string>("");
const [sort, setSort] = useState<SortField>({ sortColumn: "id" });
const [sort, setSort] = useState<SortField>({
sortColumn: "id",
sortOrder: "ascending"
});

const loadData = () => {
setLoading(true);
Expand Down
2 changes: 1 addition & 1 deletion src/VehiclePageSizeSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const VehiclePageSizeSelect: React.FC<VehiclePageSizeSelectProps> = ({
<Dropdown
inline={true}
options={limitOptions}
defaultValue={limit}
defaultValue={String(limit)}
onChange={handleChangeLimit}
/>
</React.Fragment>
Expand Down
4 changes: 0 additions & 4 deletions src/setupTests.js
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
import { configure } from "enzyme";
import Adapter from "enzyme-adapter-react-16";
import "@testing-library/jest-dom/extend-expect";

configure({ adapter: new Adapter() });