mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-11-12 12:16:11 +01:00
feat: more login progress
This commit is contained in:
1 parent
1e64cb9e7d
commit
513105a624
18 files changed
+290
-295
No files matched your search
+4
-3
@@ -9,11 +9,12 @@ import {
|
||||
Text,
|
||||
} from '@radix-ui/themes';
|
||||
import { useState } from 'react';
|
||||
import { App } from '../../../../../../stores/app';
|
||||
import { Duel } from '../../../../../../stores/duel';
|
||||
import { $wargamingLogin } from '../../../../../../stores/wargamingLogin';
|
||||
import { Stars } from '../../Stars';
|
||||
|
||||
export function VoteCaster() {
|
||||
const appStore = App.useStore();
|
||||
const tank = Duel.use((state) => state.protagonist.tank);
|
||||
const [easiness, setEasiness] = useState<StarsInt | null>(null);
|
||||
const [firepower, setFirepower] = useState<StarsInt | null>(null);
|
||||
@@ -97,9 +98,9 @@ export function VoteCaster() {
|
||||
survivability === null)
|
||||
}
|
||||
onClick={() => {
|
||||
const wargaming = $wargamingLogin.get();
|
||||
const { wargaming } = appStore.getState().logins;
|
||||
|
||||
if (!wargaming.token) {
|
||||
if (!wargaming) {
|
||||
return setShowDialogue(false);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
import { formatCompact } from '@blitzkit/core';
|
||||
import { useStore } from '@nanostores/react';
|
||||
import { Flex, Heading, Skeleton, Text } from '@radix-ui/themes';
|
||||
import { memo } from 'react';
|
||||
import { useTankVotes } from '../../../../../hooks/useTankVotes';
|
||||
import { App } from '../../../../../stores/app';
|
||||
import { Duel } from '../../../../../stores/duel';
|
||||
import { $wargamingLogin } from '../../../../../stores/wargamingLogin';
|
||||
import { WargamingLoginButton } from '../../../../WargamingLoginButton';
|
||||
import { StarRow } from './components/StarRow';
|
||||
import { VoteCaster } from './components/VoteCaster';
|
||||
@@ -13,7 +12,7 @@ export const Votes = memo(
|
||||
() => {
|
||||
const id = Duel.use((state) => state.protagonist.tank.id);
|
||||
const votes = useTankVotes(id);
|
||||
const wargaming = useStore($wargamingLogin);
|
||||
const wargaming = App.use((state) => state.logins.wargaming);
|
||||
|
||||
return (
|
||||
<Flex direction="column" gap="3">
|
||||
|
||||
Reference in new issue
Block a user