Skip to content

Commit

Permalink
trads + ts #96
Browse files Browse the repository at this point in the history
  • Loading branch information
djobbo committed Jan 31, 2024
1 parent 7d41081 commit a2d5ad1
Show file tree
Hide file tree
Showing 33 changed files with 615 additions and 514 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import { type BHClan } from "db/generated/client"
import { CLANS_RANKINGS_PER_PAGE } from "./constants"
import { Trans } from "@lingui/macro"
import { cleanString } from "common/helpers/cleanString"
import { cn } from "@/lib/utils"
import { formatUnixTime } from "common/helpers/date"
Expand Down Expand Up @@ -45,9 +46,11 @@ export const ClansTable = ({ clans, page }: ClansTableProps) => {
</Link>
</p>
<div className="w-40 flex items-center justify-center">
{!!clan.created && clan.created > 0
? formatUnixTime(clan.created)
: "N/A"}
{!!clan.created && clan.created > 0 ? (
formatUnixTime(clan.created)
) : (
<Trans>N/A</Trans>
)}
</div>
<p className="w-20 text-center">{clan.xp}</p>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { BracketSelection } from "../../BracketSelection"
import { BracketSelection } from "../../../BracketSelection"
import { Paginator } from "ui/base/Paginator"
import { type ReactNode } from "react"
import { rankedRegionSchema, rankedRegions } from "bhapi/constants"
Expand Down
3 changes: 1 addition & 2 deletions app/app/[locale]/_landing/DiscordCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Trans } from "@lingui/macro"
import { clamp } from "common/helpers/math"
import { useEffect, useRef } from "react"

const DISCORD_MEMBERS = "3.8k+"
const DISCORD_MEMBERS = "4.5k+"

export const DiscordCard = () => {
const containerRef = useRef<HTMLDivElement>(null)
Expand Down Expand Up @@ -73,7 +73,6 @@ export const DiscordCard = () => {
containerClassName="w-20 h-20 rounded-3xl -mt-10 ml-6 border-8 border-bgVar2 overflow-hidden"
/>
<span className="text-sm ml-2 mt-2 text-textVar1 text-center">
{/* {t`${DISCORD_MEMBERS} discord members, and growing!`} */}
<Trans>
{DISCORD_MEMBERS} discord members, and growing!
</Trans>
Expand Down
1 change: 1 addition & 0 deletions app/app/[locale]/_layout/ErrorDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export const ErrorDisplay = ({
error,
}: ErrorDisplayProps) => {
useEffect(() => {
// eslint-disable-next-line no-console
console.log("error", error)
// TODO: Log the error to an error reporting service
}, [error])
Expand Down
14 changes: 8 additions & 6 deletions app/app/[locale]/_layout/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,14 @@ export const Footer = ({ className }: FooterProps) => {
</Link>
.
<br />
Corehalla is neither associated nor endorsed by Blue Mammoth
Games and doesn&apos;t reflect the views or opinions of Blue
Mammoth Games or anyone officially involved in developing
Brawlhalla.
<br />
Brawlhalla and Blue Mammoth Games are trademarks of{" "}
<Trans>
Corehalla is neither associated nor endorsed by Blue
Mammoth Games and doesn&apos;t reflect the views or
opinions of Blue Mammoth Games or anyone officially
involved in developing Brawlhalla.
<br />
Brawlhalla and Blue Mammoth Games are trademarks of{" "}
</Trans>
<a className="p-link" href="https://www.bluemammoth.com">
Blue Mammoth Games
</a>
Expand Down
4 changes: 3 additions & 1 deletion app/app/[locale]/_layout/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ export const Header = ({ className }: HeaderProps) => {
</div>
</>
)}
<Button onClick={signOut}>Sign out</Button>
<Button onClick={signOut}>
<Trans>Sign out</Trans>
</Button>
</>
) : (
<Button onClick={signIn}>
Expand Down
18 changes: 7 additions & 11 deletions app/app/[locale]/_layout/SideNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -173,17 +173,13 @@ export const SideNav = ({ className }: SideNavProps) => {
icon: <HiBookOpen className="w-6 h-6" />,
external: true,
},
...(favorites.length > 0
? [
{
id: "favorites",
name: msg`Favorites`,
icon: <HiHeart className="w-6 h-6" />,
href: "/@me/favorites",
exact: false,
},
]
: []),
{
id: "favorites",
name: msg`Favorites`,
icon: <HiHeart className="w-6 h-6" />,
href: "/me/favorites",
exact: false,
},
]

return (
Expand Down
21 changes: 13 additions & 8 deletions app/app/[locale]/calculator/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import { Card } from "ui/base/Card"
import { SectionTitle } from "@/components/layout/SectionTitle"
import { Trans } from "@lingui/macro"
import { create } from "zustand"
import {
getGloryFromBestRating,
Expand Down Expand Up @@ -67,11 +68,13 @@ export default function CalculatorPage() {
return (
<>
<h1 className="text-3xl font-bold">
New Season Glory / ELO Reset Calculator
<Trans>New Season Glory / ELO Reset Calculator</Trans>
</h1>
<div className="grid grid-cols-1 lg:grid-cols-2 gap-4">
<div className="flex flex-col gap-4 items-center">
<SectionTitle>Glory Calculator</SectionTitle>
<SectionTitle>
<Trans>Glory Calculator</Trans>
</SectionTitle>
<Card>
<label>
<input
Expand All @@ -82,7 +85,9 @@ export default function CalculatorPage() {
setHasPlayed10Games(e.target.checked)
}
/>
I have played 10 ranked games (or more).
<Trans>
I have played 10 ranked games (or more).
</Trans>
</label>
</Card>
{hasPlayed10Games ? (
Expand All @@ -97,7 +102,7 @@ export default function CalculatorPage() {
min={0}
max={10000}
/>
Glory from wins:
<Trans>Glory from wins:</Trans>
<span className={resultClassName}>
{gloryWins}
</span>
Expand All @@ -113,7 +118,7 @@ export default function CalculatorPage() {
min={200}
max={4000}
/>
Glory from best rating:
<Trans>Glory from best rating:</Trans>
<span className={resultClassName}>
{gloryRating}
</span>
Expand All @@ -126,7 +131,7 @@ export default function CalculatorPage() {
</Card>
</>
) : (
<>You gotta play at least 10 ranked games!</>
<Trans>You gotta play at least 10 ranked games!</Trans>
)}
</div>
<div className="flex flex-col gap-4 items-center">
Expand All @@ -141,7 +146,7 @@ export default function CalculatorPage() {
min={200}
max={4000}
/>
Personal Rating Squash:
<Trans>Personal Rating Squash:</Trans>
<span className={resultClassName}>
{squashPersonal} (
{getTierFromRating(squashPersonal)})
Expand All @@ -157,7 +162,7 @@ export default function CalculatorPage() {
min={200}
max={4000}
/>
Legend/Team Rating Squash:
<Trans>Legend/Team Rating Squash:</Trans>
<span className={resultClassName}>
{squashHero} ({getTierFromRating(squashHero)})
</span>
Expand Down
8 changes: 1 addition & 7 deletions app/app/[locale]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,8 @@ import { Suspense } from "react"
import { Trans } from "@lingui/macro"
import { WeeklyRotation } from "./_landing/WeeklyRotation"
import { cn } from "@/lib/utils"
import { css } from "ui/theme"
import Link from "next/link"

const landingClassName = css({
height: "60vh",
minHeight: "400px",
})().className

export const metadata = {
title: "Corehalla - Track your Brawlhalla stats, view rankings, and more!",
description:
Expand All @@ -30,7 +24,7 @@ export default async function Home() {
<div
className={cn(
"relative flex flex-col justify-center items-center lg:items-start",
landingClassName,
"h-[60vh] min-h-[400px]",
'after:content[""] after:absolute after:inset-0 after:bg-accent after:blur-[256px] after:opacity-[0.15] after:-z-10',
)}
>
Expand Down
122 changes: 0 additions & 122 deletions app/components/ui/dialog.tsx

This file was deleted.

Loading

0 comments on commit a2d5ad1

Please sign in to comment.