mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-10-02 08:07:40 -05:00
Move app to apps/web-react in pnpm workspace layout
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
import { ChevronLeft } from "lucide-react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useMatches } from "react-router";
|
||||
import { LinkButton } from "~/components/elements/Button";
|
||||
import type { TeamLoaderData } from "~/features/team/loaders/t.$customUrl.server";
|
||||
import invariant from "~/utils/invariant";
|
||||
import { teamPage } from "~/utils/urls";
|
||||
|
||||
export function TeamGoBackButton() {
|
||||
const { t } = useTranslation(["common"]);
|
||||
|
||||
const [, parentRoute] = useMatches();
|
||||
invariant(parentRoute);
|
||||
const layoutData = parentRoute.loaderData as TeamLoaderData;
|
||||
|
||||
return (
|
||||
<div className="stack">
|
||||
<LinkButton
|
||||
to={teamPage(layoutData.team.customUrl)}
|
||||
icon={<ChevronLeft />}
|
||||
variant="outlined"
|
||||
size="small"
|
||||
className="mr-auto"
|
||||
>
|
||||
{t("common:actions.back")}
|
||||
</LinkButton>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user