mirror of
https://github.com/NebulaServices/Nebula.git
synced 2025-05-17 13:30:00 -04:00
Major header and routing improvments
This commit is contained in:
parent
226560dc52
commit
25c4a1e9ce
5 changed files with 58 additions and 80 deletions
22
src/components/HeaderButton.tsx
Normal file
22
src/components/HeaderButton.tsx
Normal file
|
@ -0,0 +1,22 @@
|
|||
import { useTranslation } from "react-i18next";
|
||||
import { Link } from 'preact-router';
|
||||
|
||||
interface HeaderButtonProps {
|
||||
href: string;
|
||||
Icon: any;
|
||||
translationKey: string;
|
||||
}
|
||||
|
||||
export function HeaderButton(props: HeaderButtonProps) {
|
||||
const { href, Icon, translationKey } = props;
|
||||
const { t } = useTranslation();
|
||||
|
||||
return (
|
||||
<Link href={href}>
|
||||
<div class="p-4 flex flex-row items-center">
|
||||
<Icon class="w-6 h-6"/>
|
||||
<span className="text-text-color text-lg pl-1 font-roboto font-bold">{t(translationKey)}</span>
|
||||
</div>
|
||||
</Link>
|
||||
)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue