Skip to content
Snippets Groups Projects
Commit dc447c04 authored by Per 29 mei 2024 gedeeld account, daarvoor marten's avatar Per 29 mei 2024 gedeeld account, daarvoor marten
Browse files

add gitlab

parent c4fee290
No related branches found
No related tags found
No related merge requests found
@import "~antd/dist/antd.css";
.App {
text-align: center;
}
......
import React from "react";
import { BrowserRouter as Router, Switch, Route, Link } from "react-router-dom";
import { Button } from "antd";
import logo from "./logo.svg";
import "./App.css";
import { getToken, setToken } from "./gitlab";
function App() {
return (
......@@ -13,7 +15,7 @@ function App() {
<Link to="/">Home</Link>
</li>
<li>
<Link to="/about">About</Link>
<Link to="/Setup">Setup</Link>
</li>
<li>
<Link to="/users">Users</Link>
......@@ -24,8 +26,8 @@ function App() {
{/* A <Switch> looks through its children <Route>s and
renders the first one that matches the current URL. */}
<Switch>
<Route path="/about">
<About />
<Route path="/setup">
<Setup />
</Route>
<Route path="/users">
<Users />
......@@ -40,12 +42,24 @@ function App() {
}
function Home() {
return <h2>Home</h2>;
return (
<h2>
<Button type="primary">Button</Button>
</h2>
);
}
function About() {
return <h2>About</h2>;
}
const Setup: React.FunctionComponent = () => {
return (
<div>
<h2>Setup</h2>
<input
value={getToken() || ""}
onChange={(e) => setToken(e.target.value)}
/>
</div>
);
};
function Users() {
return <h2>Users</h2>;
......
const GITLAB_TOKEN_LOCATION = "GITLAB_TOKEN";
export function getToken() {
return localStorage.getItem(GITLAB_TOKEN_LOCATION);
}
export function setToken(token: string) {
localStorage.setItem(GITLAB_TOKEN_LOCATION, token);
}
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment