Skip to content

Commit

Permalink
fix: rename entities folder and fix all stager errors after rename
Browse files Browse the repository at this point in the history
  • Loading branch information
sanua356 committed Aug 11, 2024
1 parent c44ebb3 commit 7fe40bf
Show file tree
Hide file tree
Showing 54 changed files with 162 additions and 152 deletions.
3 changes: 2 additions & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ module.exports = {
'warn',
{ allowConstantExport: true },
],
'import/order': ['off']
'import/order': ['off'],
'import/no-internal-modules': ['off'],
},
}
2 changes: 1 addition & 1 deletion src/app/App.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ToastContainer } from 'react-toastify';

import '@/shared/fonts/zaychik/Zaychik.css';
import 'react-toastify/dist/ReactToastify.css';
import 'shared/fonts/zaychik/Zaychik.css';

import { MainProviders } from "./providers";
import { AppRouter } from "./routers";
Expand Down
4 changes: 2 additions & 2 deletions src/app/routers/AppRouter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import {
RouterProvider
} from "react-router-dom";

import { GamePage } from "@/pages/game";
import { HomePage } from "@/pages/home";
import { GamePage } from "pages/game";
import { HomePage } from "pages/home";

const router = createHashRouter([
{
Expand Down
5 changes: 3 additions & 2 deletions src/app/stores/mainStore.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import { settingsReducer } from "@/entites/settings";
import { deskReducer } from "@/pages/game";
import { combineReducers, configureStore } from "@reduxjs/toolkit";

import { settingsReducer } from "entities/settings";
import { deskReducer } from "pages/game";

const mainReducer = combineReducers({
"desk": deskReducer as any,
"sound": settingsReducer as any,
Expand Down
4 changes: 2 additions & 2 deletions src/app/styles/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
font-family: 'Zaychik';
}
body {
cursor: url('@/shared/assets/images/cursor.png'), pointer;
cursor: url('shared/assets/images/cursor.png'), pointer;
}
.noevents {
pointer-events: none;
Expand All @@ -15,7 +15,7 @@ body {
}
.Toastify__toast {
background-color: transparent;
background-image: url('@/shared/assets/images/panel.png');
background-image: url('shared/assets/images/panel.png');
background-size: cover;
background-repeat: no-repeat;
background-position: center;
Expand Down
1 change: 0 additions & 1 deletion src/entites/IconButton/index.ts

This file was deleted.

2 changes: 0 additions & 2 deletions src/entites/gameCards/index.ts

This file was deleted.

53 changes: 0 additions & 53 deletions src/entites/gameCards/lib/constants.ts

This file was deleted.

2 changes: 0 additions & 2 deletions src/entites/gameCards/lib/index.ts

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
left: -10%;
width: 140%;
height: 140%;
background-image: url('@/shared/assets/images/plashka.png');
background-image: url('shared/assets/images/plashka.png');
background-position: center;
background-size: contain;
background-repeat: no-repeat;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import clsx from 'clsx';
import { useDispatch, useSelector } from 'react-redux';

import { setActivateSound, TSettingsSliceStore } from '@/entites/settings';
import mutedImage from '@/shared/assets/images/muted.png';
import soundImage from '@/shared/assets/images/sound.png';
import { setActivateSound, TSettingsSliceStore } from 'entities/settings';
import mutedImage from 'shared/assets/images/muted.png';
import soundImage from 'shared/assets/images/sound.png';

import s from './PlaySoundButton.module.css';

Expand Down
53 changes: 53 additions & 0 deletions src/pages/game/lib/cards.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import card10 from 'shared/assets/images/cards/10.jpg';
import card11 from 'shared/assets/images/cards/11.jpg';
import card2 from 'shared/assets/images/cards/2.jpg';
import card3 from 'shared/assets/images/cards/3.jpg';
import card4 from 'shared/assets/images/cards/4.jpg';
import card5 from 'shared/assets/images/cards/5.jpg';
import card6 from 'shared/assets/images/cards/6.jpg';
import card7 from 'shared/assets/images/cards/7.jpg';
import card8 from 'shared/assets/images/cards/8.jpg';
import card9 from 'shared/assets/images/cards/9.jpg';

import { TGameCard } from './types';

export const GAME_CARDS: TGameCard[] = [{
value: 2,
image: card2,
},
{
value: 3,
image: card3,
},
{
value: 4,
image: card4,
},
{
value: 5,
image: card5,
},
{
value: 6,
image: card6,
},
{
value: 7,
image: card7,
},
{
value: 8,
image: card8,
},
{
value: 9,
image: card9,
},
{
value: 10,
image: card10,
},
{
value: 11,
image: card11,
}]
46 changes: 23 additions & 23 deletions src/pages/game/lib/constants.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
import draw1 from '@/shared/assets/images/draw1.png';
import lose1 from '@/shared/assets/images/lose1.png';
import lose2 from '@/shared/assets/images/lose2.png';
import lose3 from '@/shared/assets/images/lose3.png';
import lose4 from '@/shared/assets/images/lose4.png';
import win1 from '@/shared/assets/images/win.png';
import win2 from '@/shared/assets/images/win2.png';
import win3 from '@/shared/assets/images/win3.png';
import win4 from '@/shared/assets/images/win4.png';
import draw1sound from '@/shared/assets/sounds/endVoices/draw1.ogg';
import draw2sound from '@/shared/assets/sounds/endVoices/draw2.ogg';
import draw3sound from '@/shared/assets/sounds/endVoices/draw3.ogg';
import lose1sound from '@/shared/assets/sounds/endVoices/lose1.ogg';
import lose2sound from '@/shared/assets/sounds/endVoices/lose2.ogg';
import lose3sound from '@/shared/assets/sounds/endVoices/lose3.ogg';
import lose4sound from '@/shared/assets/sounds/endVoices/lose4.ogg';
import lose5sound from '@/shared/assets/sounds/endVoices/lose5.ogg';
import lose6sound from '@/shared/assets/sounds/endVoices/lose6.ogg';
import win1sound from '@/shared/assets/sounds/endVoices/win1.ogg';
import win2sound from '@/shared/assets/sounds/endVoices/win2.ogg';
import win3sound from '@/shared/assets/sounds/endVoices/win3.ogg';
import win4sound from '@/shared/assets/sounds/endVoices/win4.ogg';
import win5sound from '@/shared/assets/sounds/endVoices/win5.ogg';
import draw1 from 'shared/assets/images/draw1.png';
import lose1 from 'shared/assets/images/lose1.png';
import lose2 from 'shared/assets/images/lose2.png';
import lose3 from 'shared/assets/images/lose3.png';
import lose4 from 'shared/assets/images/lose4.png';
import win1 from 'shared/assets/images/win.png';
import win2 from 'shared/assets/images/win2.png';
import win3 from 'shared/assets/images/win3.png';
import win4 from 'shared/assets/images/win4.png';
import draw1sound from 'shared/assets/sounds/endVoices/draw1.ogg';
import draw2sound from 'shared/assets/sounds/endVoices/draw2.ogg';
import draw3sound from 'shared/assets/sounds/endVoices/draw3.ogg';
import lose1sound from 'shared/assets/sounds/endVoices/lose1.ogg';
import lose2sound from 'shared/assets/sounds/endVoices/lose2.ogg';
import lose3sound from 'shared/assets/sounds/endVoices/lose3.ogg';
import lose4sound from 'shared/assets/sounds/endVoices/lose4.ogg';
import lose5sound from 'shared/assets/sounds/endVoices/lose5.ogg';
import lose6sound from 'shared/assets/sounds/endVoices/lose6.ogg';
import win1sound from 'shared/assets/sounds/endVoices/win1.ogg';
import win2sound from 'shared/assets/sounds/endVoices/win2.ogg';
import win3sound from 'shared/assets/sounds/endVoices/win3.ogg';
import win4sound from 'shared/assets/sounds/endVoices/win4.ogg';
import win5sound from 'shared/assets/sounds/endVoices/win5.ogg';

export enum GameStatuses {
StepPlayer,
Expand Down
2 changes: 2 additions & 0 deletions src/pages/game/lib/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
export { GAME_CARDS } from './cards';
export { END_GAME_STATE, GameStatuses, GameWinners } from './constants';
export { shuffleArray } from './shuffleArray';
export type { TGameCard } from './types';
File renamed without changes.
4 changes: 1 addition & 3 deletions src/pages/game/model/desk.slice.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { createSlice } from '@reduxjs/toolkit';

import { GAME_CARDS, TGameCard } from '@/entites/gameCards';

import { GameStatuses, GameWinners, shuffleArray } from '../lib';
import { GAME_CARDS, GameStatuses, GameWinners, shuffleArray, TGameCard } from '../lib';
import { TGameStatus, TWinnerGame } from './types';

export const GAME_STEP_TRANSLATE = {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/game/ui/Game.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
width: 100%;
min-height: 100dvh;
overflow: hidden;
background-image: url('@/shared/assets/images/fon.png');
background-image: url('shared/assets/images/fon.png');
background-position: center;
background-repeat: no-repeat;
background-size: cover;
Expand Down
6 changes: 3 additions & 3 deletions src/pages/game/ui/Game.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import { useEffect } from 'react';
import { useDispatch, useSelector } from 'react-redux';
import { useNavigate } from 'react-router-dom';

import { IconButton } from '@/entites/IconButton';
import { PlaySoundButton, TSettingsSliceStore } from '@/entites/settings';
import gameSound from '@/shared/assets/sounds/game.ogg';
import { PlaySoundButton, TSettingsSliceStore } from 'entities/settings';
import gameSound from 'shared/assets/sounds/game.ogg';

import { GameStatuses } from '../lib';
import { startGame, TDeskSliceStore, TGameStatus } from '../model';
import { EndGameModal } from './endGameModal';
import { IconButton } from './iconButton';
import { PlayerActions } from './playerActions';
import { ViewOpponentCardAmount } from './viewOpponentCardAmount';
import { ViewOpponentCards } from './viewOpponentCards';
Expand Down
2 changes: 1 addition & 1 deletion src/pages/game/ui/endGameModal/EndGameModal.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
transform: translate(-50%, -50%);
width: 50vw;
height: auto;
background-image: url('@/shared/assets/images/end.jpg');
background-image: url('shared/assets/images/end.jpg');
background-repeat: no-repeat;
background-size: cover;
background-position: center;
Expand Down
8 changes: 4 additions & 4 deletions src/pages/game/ui/endGameModal/EndGameModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import { useEffect, useState } from 'react';
import { useDispatch, useSelector } from 'react-redux';
import { useNavigate } from 'react-router-dom';

import { HatchButton } from '@/entites/hatchButton';
import { TSettingsSliceStore, useTranslates } from '@/entites/settings';
import endGameSound from '@/shared/assets/sounds/end_game.ogg';
import { Modal } from '@/shared/ui/Modal';
import { HatchButton } from 'entities/hatchButtons';
import { TSettingsSliceStore, useTranslates } from 'entities/settings';
import endGameSound from 'shared/assets/sounds/end_game.ogg';
import { Modal } from 'shared/ui';

import { END_GAME_STATE, GameWinners } from '../../lib';
import { setGameWinner, startGame, TDeskSliceStore, TWinnerGame } from '../../model';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
right: 0;
left: 0;
bottom: 0;
background-image: url('@/shared/assets/images/interactive_button.png');
background-image: url('shared/assets/images/interactive_button.png');
background-repeat: no-repeat;
background-size: cover;
background-position: center;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import clsx from 'clsx';

import backIcon from '@/shared/assets/images/back.png';
import refreshIcon from '@/shared/assets/images/refresh.png';
import backIcon from 'shared/assets/images/back.png';
import refreshIcon from 'shared/assets/images/refresh.png';

import s from './IconButton.module.css';

Expand Down
File renamed without changes.
14 changes: 7 additions & 7 deletions src/pages/game/ui/playerActions/PlayerActions.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { useDispatch, useSelector } from 'react-redux';
import { toast } from 'react-toastify';

import { TGameCard } from '@/entites/gameCards';
import { HatchButton } from '@/entites/hatchButton';
import { TSettingsSliceStore, useTranslates } from '@/entites/settings';
import getCardSound from '@/shared/assets/sounds/get_card.ogg';
import hoverSound from '@/shared/assets/sounds/hover.ogg';
import nextStepSound from '@/shared/assets/sounds/next_step.ogg';
import viewCardsSound from '@/shared/assets/sounds/view_cards.ogg';
import { TGameCard } from 'entities/gameCards';

Check failure on line 4 in src/pages/game/ui/playerActions/PlayerActions.tsx

View workflow job for this annotation

GitHub Actions / Build

Cannot find module 'entities/gameCards' or its corresponding type declarations.
import { HatchButton } from 'entities/hatchButtons';
import { TSettingsSliceStore, useTranslates } from 'entities/settings';
import getCardSound from 'shared/assets/sounds/get_card.ogg';
import hoverSound from 'shared/assets/sounds/hover.ogg';
import nextStepSound from 'shared/assets/sounds/next_step.ogg';
import viewCardsSound from 'shared/assets/sounds/view_cards.ogg';

import { GameStatuses } from '../../lib';
import {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useSelector } from 'react-redux';

import { TGameCard } from '@/entites/gameCards';
import { useTranslates } from '@/entites/settings';
import { TGameCard } from 'entities/gameCards';

Check failure on line 3 in src/pages/game/ui/viewOpponentCardAmount/ViewOpponentCardAmount.tsx

View workflow job for this annotation

GitHub Actions / Build

Cannot find module 'entities/gameCards' or its corresponding type declarations.
import { useTranslates } from 'entities/settings';

import { TDeskSliceStore } from '../../model';
import s from './ViewOpponentCardAmount.module.css';
Expand Down
8 changes: 4 additions & 4 deletions src/pages/game/ui/viewOpponentCards/ViewOpponentCards.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import clsx from 'clsx';
import { ReactNode, useEffect } from 'react';
import { useDispatch, useSelector } from 'react-redux';

import { TGameCard } from '@/entites/gameCards';
import { TSettingsSliceStore } from '@/entites/settings';
import TShirtCard from '@/shared/assets/images/tshirt.png';
import getCardSound from '@/shared/assets/sounds/get_card.ogg';
import { TGameCard } from 'entities/gameCards';

Check failure on line 5 in src/pages/game/ui/viewOpponentCards/ViewOpponentCards.tsx

View workflow job for this annotation

GitHub Actions / Build

Cannot find module 'entities/gameCards' or its corresponding type declarations.
import { TSettingsSliceStore } from 'entities/settings';
import TShirtCard from 'shared/assets/images/tshirt.png';
import getCardSound from 'shared/assets/sounds/get_card.ogg';

import { GameStatuses } from '../../lib';
import {
Expand Down
8 changes: 4 additions & 4 deletions src/pages/game/ui/viewUnusedCards/ViewUnusedCards.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import clsx from 'clsx';
import { useSelector } from 'react-redux';

import { TGameCard } from '@/entites/gameCards';
import { useTranslates } from '@/entites/settings';
import TShirtCard from '@/shared/assets/images/tshirt_h.png';
import useDebounce from '@/shared/lib/useDebounce';
import { useTranslates } from 'entities/settings';
import TShirtCard from 'shared/assets/images/tshirt_h.png';
import { useDebounce } from 'shared/lib';

import { TGameCard } from '../../lib';
import { GAME_STEP_TRANSLATE, TDeskSliceStore, TGameStatus } from '../../model';

import s from './ViewUnusedCards.module.css';
Expand Down
Loading

0 comments on commit 7fe40bf

Please sign in to comment.