1
0
Fork 0
mirror of https://github.com/sussy-code/smov.git synced 2024-12-20 14:37:43 +01:00

Convet /route#route to the sexier useNavigation

This commit is contained in:
Cooper Ransom 2024-03-17 21:35:16 -04:00
parent beb832a7ec
commit 603b6b4510
2 changed files with 18 additions and 13 deletions

View file

@ -1,5 +1,5 @@
import classNames from "classnames"; import classNames from "classnames";
import { Link } from "react-router-dom"; import { Link, useNavigate } from "react-router-dom";
import { NoUserAvatar, UserAvatar } from "@/components/Avatar"; import { NoUserAvatar, UserAvatar } from "@/components/Avatar";
import { IconPatch } from "@/components/buttons/IconPatch"; import { IconPatch } from "@/components/buttons/IconPatch";
@ -21,6 +21,7 @@ export interface NavigationProps {
export function Navigation(props: NavigationProps) { export function Navigation(props: NavigationProps) {
const bannerHeight = useBannerSize(); const bannerHeight = useBannerSize();
const navigate = useNavigate();
const { loggedIn } = useAuth(); const { loggedIn } = useAuth();
return ( return (
@ -103,7 +104,7 @@ export function Navigation(props: NavigationProps) {
<IconPatch icon={Icons.GITHUB} clickable downsized /> <IconPatch icon={Icons.GITHUB} clickable downsized />
</a> </a>
<a <a
href="/flix#flix" onClick={() => navigate("/flix")}
rel="noreferrer" rel="noreferrer"
className="text-xl text-white tabbable rounded-full" className="text-xl text-white tabbable rounded-full"
> >

View file

@ -1,6 +1,6 @@
import classNames from "classnames"; import classNames from "classnames";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { Link } from "react-router-dom"; import { useNavigate } from "react-router-dom";
import { ThinContainer } from "@/components/layout/ThinContainer"; import { ThinContainer } from "@/components/layout/ThinContainer";
import { Ol } from "@/components/utils/Ol"; import { Ol } from "@/components/utils/Ol";
@ -41,6 +41,8 @@ function Button(props: {
export function AboutPage() { export function AboutPage() {
const { t } = useTranslation(); const { t } = useTranslation();
const navigate = useNavigate();
return ( return (
<SubPageLayout> <SubPageLayout>
<PageTitle subpage k="global.pages.about" /> <PageTitle subpage k="global.pages.about" />
@ -71,16 +73,18 @@ export function AboutPage() {
style={{ display: "flex", justifyContent: "space-between" }} style={{ display: "flex", justifyContent: "space-between" }}
className="w-full" className="w-full"
> >
<Link to="/flix"> <Button
<Button className="py-px mt-8 box-content bg-buttons-secondary hover:bg-buttons-secondaryHover bg-opacity-90 text-buttons-secondaryText justify-center items-center"> className="py-px mt-8 box-content bg-buttons-secondary hover:bg-buttons-secondaryHover bg-opacity-90 text-buttons-secondaryText justify-center items-center"
Top Flix onClick={() => navigate("/flix")}
</Button> >
</Link> Top Flix
<Link to="/support"> </Button>
<Button className="py-px mt-8 box-content bg-buttons-secondary hover:bg-buttons-secondaryHover bg-opacity-90 text-buttons-secondaryText justify-center items-center"> <Button
Support className="py-px mt-8 box-content bg-buttons-secondary hover:bg-buttons-secondaryHover bg-opacity-90 text-buttons-secondaryText justify-center items-center"
</Button> onClick={() => navigate("/support")}
</Link> >
Support
</Button>
</div> </div>
</ThinContainer> </ThinContainer>
</SubPageLayout> </SubPageLayout>