Skip to content

Commit

Permalink
Update to 1.6.1 (#422)
Browse files Browse the repository at this point in the history
* Improve challenges

* Improve challenges

* patch selector

* Fix the key
  • Loading branch information
petrvecera authored Apr 12, 2024
1 parent 8d8826c commit e620cb4
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 32 deletions.
17 changes: 14 additions & 3 deletions config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const getEdgioEnvName = (): string | null => {
};

// This controls the default patch selector in the stats page // this needs to be key statsPatchSelector object
const defaultStatsPatchSelector = "1.6.0";
const defaultStatsPatchSelector = "1.6.1";

// This controls the patch selector in the stats page
const statsPatchSelector: Record<
Expand All @@ -55,9 +55,16 @@ const statsPatchSelector: Record<
group: string;
}
> = {
"1.6.1": {
from: "2024-04-11",
to: "now",
value: "1.6.1",
label: "1.6.1",
group: "Coral Viper",
},
"1.6.0": {
from: "2024-04-02",
to: "now",
to: "2024-04-10",
value: "1.6.0",
label: "1.6.0",
group: "Coral Viper",
Expand Down Expand Up @@ -145,11 +152,15 @@ const statsPatchSelector: Record<
};

// Latest patch needs to be a key to patches object
const latestPatch = "1.6.0";
const latestPatch = "1.6.1";

// Get patchTimeSeconds here https://www.unixtimestamp.com/
const patches: Record<string, { dataTag: string; dataTime: string; patchTimeSeconds?: number }> =
{
"1.6.1": {
dataTag: "v1.6.1-1", // This is the tag of the data repo
dataTime: "01/April/2024", // The date when was the data tag created (the data extracted from game)
},
"1.6.0": {
dataTag: "v1.6.0-1", // This is the tag of the data repo
dataTime: "02/April/2024", // The date when was the data tag created (the data extracted from game)
Expand Down
85 changes: 56 additions & 29 deletions pages/explorer/challenges.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
import { GetStaticProps, NextPage } from "next";
import Head from "next/head";
import { Accordion, Card, Container, Flex, Grid, Group, Stack, Text, Title } from "@mantine/core";
import {
Accordion,
Card,
Container,
Flex,
Grid,
Group,
Space,
Stack,
Text,
Title,
} from "@mantine/core";
import { getMappings } from "../../src/unitStats/mappings";
import { generateKeywordsString } from "../../src/head-utils";
import { ChallengesType, SbpsType, UpgradesType } from "../../src/unitStats";
import { IconMedal } from "@tabler/icons-react";
import ImageWithFallback, { iconPlaceholder } from "../../components/placeholders";
import { useEffect } from "react";
import React, { useEffect } from "react";
import { AnalyticsExplorerChallengesView } from "../../src/firebase/analytics";

interface ResolvedChallenge {
Expand All @@ -23,6 +34,7 @@ interface ChallengesProps {
weeklyChallenges: ResolvedChallenge[];
};
}

const keywords = generateKeywordsString(["coh3 challenges", "challenges"]);

const Challenges: NextPage<ChallengesProps> = ({ calculatedData }) => {
Expand All @@ -46,17 +58,26 @@ const Challenges: NextPage<ChallengesProps> = ({ calculatedData }) => {
}
/>
<meta name="keywords" content={keywords} />
{/*<meta property="og:image" content={"We might prepare a nice image for a preview for this page"} />*/}
{/*we might prepare better image*/}
<meta property="og:image" content={`/logo/android-icon-192x192.png`} />
</Head>
<Container size={"md"}>
<Flex justify="space-between" align={"center"} my={16}>
<Title order={2}>Weekly Challenges</Title>
</Flex>
<Grid columns={1}>
{weeklyChallenges.map(({ challenge, research, spawnee, sources, targets }) => {
return (
<Grid.Col key={challenge.id} span={1}>
<Accordion p={0} chevronPosition="right" variant="separated">
<Container size={"lg"} p={0}>
<Grid>
<Grid.Col md={12} lg={6}>
<Title align={"center"} order={2}>
Weekly Challenges
</Title>
<Space h={"md"} />

{weeklyChallenges.map(({ challenge, research, spawnee, sources, targets }) => {
return (
<Accordion
key={challenge.name}
p={5}
chevronPosition="right"
variant="separated"
radius="md"
>
<Accordion.Item value={challenge.id} key={challenge.name}>
<Accordion.Control>
<AccordionLabel {...challenge} />
Expand All @@ -73,19 +94,25 @@ const Challenges: NextPage<ChallengesProps> = ({ calculatedData }) => {
</Accordion.Panel>
</Accordion.Item>
</Accordion>
</Grid.Col>
);
})}
</Grid>
);
})}
</Grid.Col>

<Grid.Col md={12} lg={6}>
<Title align={"center"} order={2}>
Daily Challenges
</Title>
<Space h={"md"} />

<Flex justify="space-between" align={"center"} my={16}>
<Title order={2}>Daily Challenges</Title>
</Flex>
<Grid columns={1}>
{dailyChallenges.map(({ challenge, research, spawnee, sources, targets }) => {
return (
<Grid.Col key={challenge.id} span={1}>
<Accordion p={0} chevronPosition="right" variant="separated">
{dailyChallenges.map(({ challenge, research, spawnee, sources, targets }) => {
return (
<Accordion
key={challenge.name}
p={5}
chevronPosition="right"
variant="separated"
radius="md"
>
<Accordion.Item value={challenge.id} key={challenge.name}>
<Accordion.Control>
<AccordionLabel {...challenge} />
Expand All @@ -102,9 +129,9 @@ const Challenges: NextPage<ChallengesProps> = ({ calculatedData }) => {
</Accordion.Panel>
</Accordion.Item>
</Accordion>
</Grid.Col>
);
})}
);
})}
</Grid.Col>
</Grid>
</Container>
</>
Expand All @@ -113,12 +140,12 @@ const Challenges: NextPage<ChallengesProps> = ({ calculatedData }) => {

function AccordionLabel({ name, description, reward }: ResolvedChallenge["challenge"]) {
return (
<Card p="lg" radius="md" withBorder>
<Card p="md" radius="md" withBorder>
<Flex direction="column" gap={4}>
<Title order={3} color="orange.5">
{name}
</Title>
<Text size="md">{description}</Text>
<Text style={{ minHeight: "3.2em" }}>{description}</Text>
<Group spacing={"xs"}>
<IconMedal size={16} />
<Text size="sm" color="blue.4">
Expand Down

0 comments on commit e620cb4

Please sign in to comment.