Skip to content

Commit

Permalink
Merge pull request #328 from cohstats/ingame-challenges-section
Browse files Browse the repository at this point in the history
Make challenges section.
  • Loading branch information
KingDarBoja authored Apr 3, 2024
2 parents 2fe770b + 60f2be0 commit 863ba63
Show file tree
Hide file tree
Showing 7 changed files with 735 additions and 10 deletions.
23 changes: 22 additions & 1 deletion components/Header/components/ExplorerMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ import {
Stack,
Text,
} from "@mantine/core";
import { IconChevronDown } from "@tabler/icons-react";
import { IconChevronDown, IconMedal } from "@tabler/icons-react";
import React from "react";
import { raceType } from "../../../src/coh3/coh3-types";
import FactionIcon from "../../faction-icon";
import {
getChallengesRoute,
getDPSCalculatorRoute,
getExplorerFactionRoute,
getExplorerFactionUnitsRoute,
Expand Down Expand Up @@ -135,6 +136,24 @@ const UnitBrowserLink = ({ close }: { close: () => void }) => {
);
};

const ChallengesLink = ({ close }: { close: () => void }) => {
return (
<Group spacing={4}>
<IconMedal size={20} />
<Text weight={500}>
<Anchor
color="orange"
component={LinkWithOutPrefetch}
href={getChallengesRoute()}
onClick={close}
>
Challenges
</Anchor>
</Text>
</Group>
);
};

const ExplorerMenu = ({
cx,
classes,
Expand Down Expand Up @@ -163,6 +182,7 @@ const ExplorerMenu = ({
<Text weight={700}>Tools</Text>
<DPSLink close={close} />
<UnitBrowserLink close={close} />
<ChallengesLink close={close} />
</Stack>
</Accordion.Panel>
</Accordion.Item>
Expand Down Expand Up @@ -197,6 +217,7 @@ const ExplorerMenu = ({
<Divider />
<DPSLink close={() => null} />
<UnitBrowserLink close={() => null} />
<ChallengesLink close={() => null} />
</Stack>
</Grid.Col>
</Grid>
Expand Down
1 change: 1 addition & 0 deletions config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ const patches: Record<string, { dataTag: string; dataTime: string; patchTimeSeco
},
};

// eslint-disable-next-line @typescript-eslint/no-unused-vars
const getPatchDataUrl = (dataFile = "", patch = "latest") => {
const dataTag = patch === "latest" ? patches[latestPatch].dataTag : patches[patch].dataTag;
return `https://data.coh3stats.com/cohstats/coh3-data/${dataTag}/data/${dataFile}`;
Expand Down
Loading

0 comments on commit 863ba63

Please sign in to comment.