mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-04-26 09:20:24 -05:00
* Kysely initial * Badges initial * Badge routes migrated * Badges migrated * Calendar work * Fix one type problem * Calendar work * findResultsByUserId work * Calendar reworking finished * PlusSuggestions work * Migrated suggestions * Builds progress * Migrated builds * Admin migrated * Migrate articles * User search * Faster getUser * Selectable/insertable as global * Refresh prod db script + patronTier index * identifierToUserId * updateProfile * findByIdentifier * More indexes * User upsert * upsertLite * findAllPlusMembers * updateResultHighlights * updateMany * User finished migration * Fix types * Fix PlusVotingResult typing * PlusVotingRepository WIP * Migrated resultsByMonthYear * Migrated plusVotes (done with db. related migrations) * Plus code to features folder * Fix TODOs * Export * Fix range * Migrate some user pages * Move rest user routes * Move /play * Map list generator * Front page * Move map list generation logic * Move plus voting logic * Info * API * Adjust TODOs * theme * Auth * Remove TODO
72 lines
1.9 KiB
TypeScript
72 lines
1.9 KiB
TypeScript
import type { LinksFunction, SerializeFrom } from "@remix-run/node";
|
|
import { Link, NavLink, Outlet, useLoaderData } from "@remix-run/react";
|
|
import { Badge } from "~/components/Badge";
|
|
import { Main } from "~/components/Main";
|
|
import styles from "~/styles/badges.css";
|
|
import {
|
|
BADGES_PAGE,
|
|
BORZOIC_TWITTER,
|
|
FAQ_PAGE,
|
|
navIconUrl,
|
|
} from "~/utils/urls";
|
|
import { Trans } from "react-i18next";
|
|
import { useTranslation } from "~/hooks/useTranslation";
|
|
import { type SendouRouteHandle } from "~/utils/remix";
|
|
import * as BadgeRepository from "../BadgeRepository.server";
|
|
|
|
export const links: LinksFunction = () => {
|
|
return [{ rel: "stylesheet", href: styles }];
|
|
};
|
|
|
|
export const handle: SendouRouteHandle = {
|
|
i18n: "badges",
|
|
breadcrumb: () => ({
|
|
imgPath: navIconUrl("badges"),
|
|
href: BADGES_PAGE,
|
|
type: "IMAGE",
|
|
}),
|
|
};
|
|
|
|
export type BadgesLoaderData = SerializeFrom<typeof loader>;
|
|
|
|
export const loader = async () => {
|
|
return { badges: await BadgeRepository.all() };
|
|
};
|
|
|
|
export default function BadgesPageLayout() {
|
|
const { t } = useTranslation("badges");
|
|
const data = useLoaderData<typeof loader>();
|
|
|
|
return (
|
|
<Main>
|
|
<div className="badges__container">
|
|
<Outlet />
|
|
<div className="badges__small-badges">
|
|
{data.badges.map((badge) => (
|
|
<NavLink
|
|
className="badges__nav-link"
|
|
key={badge.id}
|
|
to={String(badge.id)}
|
|
>
|
|
<Badge badge={badge} size={64} isAnimated={false} />
|
|
</NavLink>
|
|
))}
|
|
</div>
|
|
</div>
|
|
<div className="badges__general-info-texts">
|
|
<p>
|
|
<Trans i18nKey="madeBy" t={t}>
|
|
Badges by{" "}
|
|
<a href={BORZOIC_TWITTER} target="_blank" rel="noreferrer">
|
|
borzoic
|
|
</a>
|
|
</Trans>
|
|
</p>
|
|
<p>
|
|
<Link to={FAQ_PAGE}>{t("forYourEvent")}</Link>
|
|
</p>
|
|
</div>
|
|
</Main>
|
|
);
|
|
}
|