initial app
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
import styled from "@emotion/styled";
|
||||
import React from "react";
|
||||
import {
|
||||
Link as RouterLink,
|
||||
LinkProps as RouterLinkProps,
|
||||
} from "react-router-dom";
|
||||
|
||||
const Headline = styled("h3")({
|
||||
fontSize: "1.5rem",
|
||||
lineHeight: 1,
|
||||
marginBottom: "0.2rem",
|
||||
});
|
||||
|
||||
const Link = styled(RouterLink)({
|
||||
textDecoration: "none",
|
||||
});
|
||||
|
||||
type NavigationHeadlineProps = Partial<Pick<RouterLinkProps, "to">>;
|
||||
|
||||
const NavigationHeadline: React.FC<
|
||||
React.PropsWithChildren<NavigationHeadlineProps>
|
||||
> = (props) => {
|
||||
const { children, to } = props;
|
||||
|
||||
return (
|
||||
<Headline>
|
||||
{to && <Link to={to}>{children}</Link>}
|
||||
{!to && children}
|
||||
</Headline>
|
||||
);
|
||||
};
|
||||
|
||||
export default NavigationHeadline;
|
||||
Reference in New Issue
Block a user