Initial commit: Tapalka monorepo (bot, front, strapi)
This commit is contained in:
11
CMyTapper/robucks-front/store/button.state.ts
Normal file
11
CMyTapper/robucks-front/store/button.state.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { create } from 'zustand';
|
||||
|
||||
interface IUseButtonStore {
|
||||
typeButton: 'pending' | 'farming' | 'claim_reward';
|
||||
setTypeButton: (typeButton: 'pending' | 'farming' | 'claim_reward') => void;
|
||||
}
|
||||
|
||||
export const useButtonStore = create<IUseButtonStore>((set) => ({
|
||||
typeButton: 'pending',
|
||||
setTypeButton: (typeButton) => set(() => ({ typeButton })),
|
||||
}));
|
||||
11
CMyTapper/robucks-front/store/config-bot.state.ts
Normal file
11
CMyTapper/robucks-front/store/config-bot.state.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { create } from 'zustand';
|
||||
|
||||
interface IUseConfigBot {
|
||||
token: string;
|
||||
setToken: (token: string) => void;
|
||||
}
|
||||
|
||||
export const useConfigBotStore = create<IUseConfigBot>(set => ({
|
||||
token: '',
|
||||
setToken: token => set(() => ({ token })),
|
||||
}));
|
||||
12
CMyTapper/robucks-front/store/config.state.ts
Normal file
12
CMyTapper/robucks-front/store/config.state.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { create } from 'zustand';
|
||||
import { IConfig } from '@/api/config.api';
|
||||
|
||||
interface IUseConfig {
|
||||
config: IConfig | null;
|
||||
setConfig: (config: IConfig | null) => void;
|
||||
}
|
||||
|
||||
export const useConfigStore = create<IUseConfig>(set => ({
|
||||
config: null,
|
||||
setConfig: config => set(() => ({ config })),
|
||||
}));
|
||||
23
CMyTapper/robucks-front/store/modal.state.ts
Normal file
23
CMyTapper/robucks-front/store/modal.state.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import { create } from 'zustand';
|
||||
|
||||
interface IUseModal {
|
||||
isDecimal: boolean;
|
||||
shopItemId: number | null;
|
||||
priceItem: number;
|
||||
image: string;
|
||||
setIsDecimal: (isDecimal: boolean) => void;
|
||||
setPriceItem: (priceItem: number) => void;
|
||||
setImage: (image: string) => void;
|
||||
setShopItemId: (shopItemId: number | null) => void;
|
||||
}
|
||||
|
||||
export const useModalStore = create<IUseModal>((set) => ({
|
||||
isDecimal: true,
|
||||
priceItem: 0,
|
||||
shopItemId: null,
|
||||
image: '/icons/small-coin-icon.svg',
|
||||
setShopItemId: (shopItemId) => set(() => ({ shopItemId })),
|
||||
setIsDecimal: (isDecimal) => set(() => ({ isDecimal })),
|
||||
setPriceItem: (priceItem) => set(() => ({ priceItem })),
|
||||
setImage: (image) => set(() => ({ image })),
|
||||
}));
|
||||
16
CMyTapper/robucks-front/store/player.state.ts
Normal file
16
CMyTapper/robucks-front/store/player.state.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { create } from 'zustand';
|
||||
import { IPlayer } from '@/interfaces/player.type';
|
||||
|
||||
interface IUserPlayer {
|
||||
player: IPlayer | null;
|
||||
isLoading: boolean;
|
||||
setPlayer: (player: IPlayer | null) => void;
|
||||
stopLoading: () => void;
|
||||
}
|
||||
|
||||
export const usePlayerStore = create<IUserPlayer>(set => ({
|
||||
player: null,
|
||||
isLoading: true,
|
||||
setPlayer: player => set(() => ({ player })),
|
||||
stopLoading: () => set(() => ({ isLoading: false })),
|
||||
}));
|
||||
13
CMyTapper/robucks-front/store/shopItems.state.ts
Normal file
13
CMyTapper/robucks-front/store/shopItems.state.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { create } from 'zustand';
|
||||
import { ITask } from '@/api/tasks.api';
|
||||
import { IShopItem } from '@/api/shop-item.api';
|
||||
|
||||
interface IUseTasks {
|
||||
shopItems: IShopItem[];
|
||||
setShopItems(tasks: IShopItem[]): void;
|
||||
}
|
||||
|
||||
export const useShopItemsStore = create<IUseTasks>(set => ({
|
||||
shopItems: [],
|
||||
setShopItems: shopItems => set(() => ({ shopItems })),
|
||||
}));
|
||||
12
CMyTapper/robucks-front/store/tasks.state.ts
Normal file
12
CMyTapper/robucks-front/store/tasks.state.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { create } from 'zustand';
|
||||
import { ITask } from '@/api/tasks.api';
|
||||
|
||||
interface IUseTasks {
|
||||
tasks: ITask[];
|
||||
setTasks(tasks: ITask[]): void;
|
||||
}
|
||||
|
||||
export const useTasksStore = create<IUseTasks>(set => ({
|
||||
tasks: [],
|
||||
setTasks: tasks => set(() => ({ tasks })),
|
||||
}));
|
||||
11
CMyTapper/robucks-front/store/token.state.ts
Normal file
11
CMyTapper/robucks-front/store/token.state.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { create } from 'zustand';
|
||||
|
||||
interface IUseToken {
|
||||
token: string | null;
|
||||
setToken: (token: string) => void;
|
||||
}
|
||||
|
||||
export const useTokenStore = create<IUseToken>(set => ({
|
||||
token: null,
|
||||
setToken: token => set(() => ({ token })),
|
||||
}));
|
||||
Reference in New Issue
Block a user