Added styled components

- also removed existing css
  - left the capabilities included
This commit is contained in:
2022-08-08 14:08:16 +02:00
parent e733c4a9f6
commit 4b61b4a370
9 changed files with 382 additions and 504 deletions

View File

@@ -1,3 +0,0 @@
nav a {
padding-right: 10px;
}

View File

@@ -3,18 +3,18 @@ import { DateTime } from "luxon";
import { FunctionComponent } from "react";
import { Trans, useTranslation } from "react-i18next";
import { Link } from "react-router-dom";
import styled from "styled-components";
import { ROUTE_KEYS } from "../../Routes";
import { Config } from "../config";
import "./Navbar.css";
type Props = {};
type Props = { className?: string };
export const Navbar: FunctionComponent<Props> = () => {
const Navbar: FunctionComponent<Props> = ({ className }) => {
const [translate, i18n] = useTranslation();
const { login, logout, isAuthenticated } = useOidc();
const { accessTokenPayload } = useOidcAccessToken();
const { home, about, counter } = ROUTE_KEYS;
return (
<>
<div className={className}>
<h1>{translate("navBar.intro")}</h1>
<p>
{/* trans can also be used to translate */}
@@ -48,6 +48,14 @@ export const Navbar: FunctionComponent<Props> = () => {
<button onClick={() => i18n.changeLanguage("nl")}>nl</button>
<hr />
</nav>
</>
</div>
);
};
const StyledNavBar = styled(Navbar)`
nav a {
padding-right: 10px;
}
`;
export { StyledNavBar as Navbar };

View File

@@ -0,0 +1,12 @@
import { FunctionComponent } from "react";
import styled from "styled-components";
type Props = {};
const TestComponent: FunctionComponent<Props> = () => {
return <h1>TestComponent</h1>;
};
const StyledTestComponent = styled(TestComponent)``;
export { StyledTestComponent as TestComponent };