From 21504eed5c9cf8aab80b46c45407e1e3591f1ce8 Mon Sep 17 00:00:00 2001 From: Markus Johansen Date: Wed, 19 Jul 2023 15:22:53 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=80=20Deploy=20react=20frontend?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Øydis Kind Refsum Co-authored-by: Christian Bulow Skovborg Co-authored-by: Amalie Mansåker Co-authored-by: Sindre Kjelsrud --- frontend/src/App.css | 42 ------------------ frontend/src/App.tsx | 35 --------------- frontend/src/index.css | 72 ++---------------------------- frontend/src/index.tsx | 53 ++++++++++++++++++++++ frontend/src/main.tsx | 4 +- frontend/src/pages/feil.tsx | 88 +++++++++++++++++++++++++++++++++++++ frontend/tailwind.config.js | 5 +-- 7 files changed, 148 insertions(+), 151 deletions(-) delete mode 100644 frontend/src/App.css delete mode 100644 frontend/src/App.tsx create mode 100644 frontend/src/index.tsx create mode 100644 frontend/src/pages/feil.tsx diff --git a/frontend/src/App.css b/frontend/src/App.css deleted file mode 100644 index b9d355d..0000000 --- a/frontend/src/App.css +++ /dev/null @@ -1,42 +0,0 @@ -#root { - max-width: 1280px; - margin: 0 auto; - padding: 2rem; - text-align: center; -} - -.logo { - height: 6em; - padding: 1.5em; - will-change: filter; - transition: filter 300ms; -} -.logo:hover { - filter: drop-shadow(0 0 2em #646cffaa); -} -.logo.react:hover { - filter: drop-shadow(0 0 2em #61dafbaa); -} - -@keyframes logo-spin { - from { - transform: rotate(0deg); - } - to { - transform: rotate(360deg); - } -} - -@media (prefers-reduced-motion: no-preference) { - a:nth-of-type(2) .logo { - animation: logo-spin infinite 20s linear; - } -} - -.card { - padding: 2em; -} - -.read-the-docs { - color: #888; -} diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx deleted file mode 100644 index afe48ac..0000000 --- a/frontend/src/App.tsx +++ /dev/null @@ -1,35 +0,0 @@ -import { useState } from 'react' -import reactLogo from './assets/react.svg' -import viteLogo from '/vite.svg' -import './App.css' - -function App() { - const [count, setCount] = useState(0) - - return ( - <> - -

Vite + React

-
- -

- Edit src/App.tsx and save to test HMR -

-
-

- Click on the Vite and React logos to learn more -

- - ) -} - -export default App diff --git a/frontend/src/index.css b/frontend/src/index.css index 2c3fac6..bd6213e 100644 --- a/frontend/src/index.css +++ b/frontend/src/index.css @@ -1,69 +1,3 @@ -:root { - font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif; - line-height: 1.5; - font-weight: 400; - - color-scheme: light dark; - color: rgba(255, 255, 255, 0.87); - background-color: #242424; - - font-synthesis: none; - text-rendering: optimizeLegibility; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; - -webkit-text-size-adjust: 100%; -} - -a { - font-weight: 500; - color: #646cff; - text-decoration: inherit; -} -a:hover { - color: #535bf2; -} - -body { - margin: 0; - display: flex; - place-items: center; - min-width: 320px; - min-height: 100vh; -} - -h1 { - font-size: 3.2em; - line-height: 1.1; -} - -button { - border-radius: 8px; - border: 1px solid transparent; - padding: 0.6em 1.2em; - font-size: 1em; - font-weight: 500; - font-family: inherit; - background-color: #1a1a1a; - cursor: pointer; - transition: border-color 0.25s; -} -button:hover { - border-color: #646cff; -} -button:focus, -button:focus-visible { - outline: 4px auto -webkit-focus-ring-color; -} - -@media (prefers-color-scheme: light) { - :root { - color: #213547; - background-color: #ffffff; - } - a:hover { - color: #747bff; - } - button { - background-color: #f9f9f9; - } -} +@tailwind base; +@tailwind components; +@tailwind utilities; \ No newline at end of file diff --git a/frontend/src/index.tsx b/frontend/src/index.tsx new file mode 100644 index 0000000..3ee15e2 --- /dev/null +++ b/frontend/src/index.tsx @@ -0,0 +1,53 @@ +import CardsContainer from "./components/CardsContainer"; +import "@navikt/ds-css"; +import { Button, Heading, Search } from "@navikt/ds-react"; +import Header from "./components/Header"; + + +export default function Home() { + // const handleFeil = () => { + // router.push('/feil') + // } + + return ( +
+
+
+
+
+ + +
+
+ +
+ + + Innmeldte feil (saker, feilmeldinger poster, feil) + + +
+ +
+

Filter to be

+
+
+
+ ) +} diff --git a/frontend/src/main.tsx b/frontend/src/main.tsx index 3d7150d..b51eb0c 100644 --- a/frontend/src/main.tsx +++ b/frontend/src/main.tsx @@ -1,10 +1,10 @@ import React from 'react' import ReactDOM from 'react-dom/client' -import App from './App.tsx' import './index.css' +import Home from './index.tsx' ReactDOM.createRoot(document.getElementById('root')!).render( - + , ) diff --git a/frontend/src/pages/feil.tsx b/frontend/src/pages/feil.tsx new file mode 100644 index 0000000..36d546b --- /dev/null +++ b/frontend/src/pages/feil.tsx @@ -0,0 +1,88 @@ +import "@navikt/ds-css"; + +import { ArrowLeftIcon, BugIcon } from "@navikt/aksel-icons"; +import { Button, Heading, TextField, Textarea } from "@navikt/ds-react"; +import axios from "axios"; +import { useState } from "react"; +import BildeOpplastning from "../components/BildeOpplastning"; +import Header from "../components/Header"; + +export default function Feil() { + const [tittel, setTittel] = useState(""); + const [beskrivelse, setBeskrivelse] = useState(""); + + const handleSubmit = () => { + axios.post("https://helse-sprik.intern.dev.nav.no/nyFeil", + { + "data": { + tittel: tittel, + beskrivelse: beskrivelse, + dato: new Date() + } + }, { + headers: { + 'Content-Type': 'application/json' + } + }).then((response) => { + console.log(response) + }).catch((error) => { + console.log(error); + }) + } + + // TODO: clear data fra felter + + + return ( +
+
+
+
+
+
+ + + Innmelding av feil i speil + +
+
+ setTittel(e.target.value)} + /> +