From 8abc9dd13e1e42d4a5c88dd05ab668e9e3116000 Mon Sep 17 00:00:00 2001 From: haraldnilsen Date: Wed, 6 Sep 2023 10:50:19 +0200 Subject: [PATCH] :lipstick: added svg to headers and fixed styling of table Co-authored-by: Sindre Kjelsrud --- package.json | 3 ++- public/arrow-down-up-svgrepo-com.svg | 5 +++++ src/App.tsx | 9 +-------- src/components/MovieTable/index.tsx | 25 +++++++++++++++++++++---- src/vite-env.d.ts | 9 +++++++++ tsconfig.json | 2 +- 6 files changed, 39 insertions(+), 14 deletions(-) create mode 100644 public/arrow-down-up-svgrepo-com.svg diff --git a/package.json b/package.json index 338a3ea..81f4f79 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,8 @@ "react-modal": "^3.16.1" }, "devDependencies": { - "@types/react": "^18.2.15", + "@types/node": "^20.5.9", + "@types/react": "^18.2.21", "@types/react-dom": "^18.2.7", "@types/react-modal": "^3.16.0", "@typescript-eslint/eslint-plugin": "^6.0.0", diff --git a/public/arrow-down-up-svgrepo-com.svg b/public/arrow-down-up-svgrepo-com.svg new file mode 100644 index 0000000..4664f59 --- /dev/null +++ b/public/arrow-down-up-svgrepo-com.svg @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/src/App.tsx b/src/App.tsx index dc0fe44..c8a7ec1 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,15 +1,8 @@ import { useEffect, useState } from 'react' import './App.css' import q from 'qjuul' -import { - MovieTableRow, - MovieForm, - Pagination, - MovieTable, - MovieModal, -} from './components' +import { MovieForm, Pagination, MovieTable, MovieModal } from './components' import type { movieObject } from './types/movie' -import Modal from 'react-modal' function App() { const API_MOVIE_KEY = 'd92949d8' diff --git a/src/components/MovieTable/index.tsx b/src/components/MovieTable/index.tsx index e769b5d..132ddc1 100644 --- a/src/components/MovieTable/index.tsx +++ b/src/components/MovieTable/index.tsx @@ -1,6 +1,7 @@ import type { movieObject } from '../../types/movie' import q from 'qjuul' import MovieTableRow from '../MovieTableRow' +import arrow from '../../../public/arrow-down-up-svgrepo-com.svg' interface MovieTableProps { handleModalOpen: (movie: movieObject) => void @@ -16,11 +17,27 @@ const MovieTable: React.FC = ({ return ( - + - Poster - sortHandler('title')}>Title - sortHandler('year')}>Year + + sortHandler('title')} + > + + Title + + + + sortHandler('year')} + > + + Year + + + diff --git a/src/vite-env.d.ts b/src/vite-env.d.ts index 11f02fe..5537e74 100644 --- a/src/vite-env.d.ts +++ b/src/vite-env.d.ts @@ -1 +1,10 @@ /// + +declare module '*.svg' { + import React = require('react') + export const ReactComponent: React.FunctionComponent< + React.SVGProps + > + const src: string + export default src +} diff --git a/tsconfig.json b/tsconfig.json index a7fc6fb..e328d9d 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -20,6 +20,6 @@ "noUnusedParameters": true, "noFallthroughCasesInSwitch": true }, - "include": ["src"], + "include": ["src", "src/vite-env.d.ts"], "references": [{ "path": "./tsconfig.node.json" }] }