mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-11-18 03:14:42 +01:00
feat: upgrade rest of them
This commit is contained in:
1 parent
fe4afdcbf0
commit
30e87743fc
63 files changed
+824
-1123
No files matched your search
@@ -1,24 +1,23 @@
|
||||
import { assertSecret, fetchTankDefinitions } from '@blitzkit/core';
|
||||
import { MinusCircledIcon } from '@radix-ui/react-icons';
|
||||
import { Callout, Flex } from '@radix-ui/themes';
|
||||
import { uniq } from 'lodash-es';
|
||||
import { useEffect } from 'react';
|
||||
import { Duel } from '../../stores/duel';
|
||||
import { TankopediaPersistent } from '../../stores/tankopediaPersistent';
|
||||
import { AesonPlug } from '../AesonPlug';
|
||||
import { ExperimentIcon } from '../ExperimentIcon';
|
||||
import { MAX_RECENTLY_VIEWED } from '../TankSearch/constants';
|
||||
import { assertSecret, fetchTankDefinitions } from "@blitzkit/core";
|
||||
import { MinusCircledIcon } from "@radix-ui/react-icons";
|
||||
import { Callout, Flex } from "@radix-ui/themes";
|
||||
import { uniq } from "lodash-es";
|
||||
import { useEffect } from "react";
|
||||
import { Duel } from "../../stores/duel";
|
||||
import { TankopediaPersistent } from "../../stores/tankopediaPersistent";
|
||||
import { AesonPlug } from "../AesonPlug";
|
||||
import { ExperimentIcon } from "../ExperimentIcon";
|
||||
import { MAX_RECENTLY_VIEWED } from "../TankSearch/constants";
|
||||
|
||||
const tankDefinitions = await fetchTankDefinitions();
|
||||
|
||||
export function CalloutsSection() {
|
||||
const tank = Duel.use((state) => state.protagonist.tank);
|
||||
const mutateTankopediaPersistent = TankopediaPersistent.useMutation();
|
||||
const promoteAeson =
|
||||
assertSecret(import.meta.env.PUBLIC_BRANCH) === 'preview';
|
||||
assertSecret(import.meta.env.PUBLIC_BRANCH) === "preview";
|
||||
|
||||
useEffect(() => {
|
||||
mutateTankopediaPersistent((draft) => {
|
||||
TankopediaPersistent.mutate((draft) => {
|
||||
draft.recentlyViewed = uniq([tank.id, ...draft.recentlyViewed])
|
||||
.filter((id) => id in tankDefinitions.tanks)
|
||||
.slice(0, MAX_RECENTLY_VIEWED);
|
||||
@@ -45,7 +44,7 @@ export function CalloutsSection() {
|
||||
{tank.testing && (
|
||||
<Callout.Root color="red">
|
||||
<Callout.Icon>
|
||||
<ExperimentIcon style={{ width: '1em', height: '1em' }} />
|
||||
<ExperimentIcon style={{ width: "1em", height: "1em" }} />
|
||||
</Callout.Icon>
|
||||
<Callout.Text>
|
||||
Tanks in testing are subject to change and may not represent the
|
||||
|
||||
Reference in new issue
Block a user