2021-01-30 20:22:16 +00:00
|
|
|
import React from 'react';
|
|
|
|
import { NavLink } from 'react-router-dom';
|
2021-07-22 17:15:27 +00:00
|
|
|
import tw, { styled } from 'twin.macro';
|
2021-01-30 20:22:16 +00:00
|
|
|
|
|
|
|
export const SubNavigation = styled.div`
|
2021-02-16 20:03:14 +00:00
|
|
|
${tw`flex flex-row items-center flex-shrink-0 h-12 mb-4 border-b border-neutral-700`};
|
2021-01-30 20:22:16 +00:00
|
|
|
|
|
|
|
& > div {
|
2021-02-16 20:03:14 +00:00
|
|
|
${tw`flex flex-col justify-center flex-shrink-0 h-full`};
|
2021-01-30 20:22:16 +00:00
|
|
|
|
|
|
|
& > a {
|
2021-02-16 20:03:14 +00:00
|
|
|
${tw`flex flex-row items-center h-full px-4 border-t text-neutral-300`};
|
2021-01-30 20:22:16 +00:00
|
|
|
border-top-color: transparent !important;
|
|
|
|
|
|
|
|
& > svg {
|
2021-02-16 20:03:14 +00:00
|
|
|
${tw`w-6 h-6 mr-2`};
|
2021-01-30 20:22:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
& > span {
|
|
|
|
${tw`text-base whitespace-nowrap`};
|
|
|
|
}
|
|
|
|
|
|
|
|
&:active, &.active {
|
2021-02-16 20:03:14 +00:00
|
|
|
${tw`border-b text-primary-300 border-primary-300`};
|
2021-01-30 20:22:16 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
export const SubNavigationLink = ({ to, name, children }: { to: string, name: string, children: React.ReactNode }) => {
|
|
|
|
return (
|
|
|
|
<div>
|
|
|
|
<NavLink to={to} exact>
|
|
|
|
{children}
|
|
|
|
<span>{name}</span>
|
|
|
|
</NavLink>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
};
|