mirror of
https://github.com/Mastermindzh/react-starter-kit.git
synced 2025-08-23 17:44:52 +02:00
Added styled components
- also removed existing css - left the capabilities included
This commit is contained in:
@@ -1,3 +0,0 @@
|
||||
nav a {
|
||||
padding-right: 10px;
|
||||
}
|
@@ -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 };
|
||||
|
12
src/infrastructure/navbar/TestComponent.tsx
Normal file
12
src/infrastructure/navbar/TestComponent.tsx
Normal 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 };
|
Reference in New Issue
Block a user