= ({
if (onChange) onChange(newChecked)
}
+ useEffect(() => {
+ setIsChecked(checked)
+ }, [checked])
+
return (
diff --git a/packages/client/src/layouts/PrivateLayout/PrivateLayout.tsx b/packages/client/src/layouts/PrivateLayout/PrivateLayout.tsx
index 0df66c3..658c10c 100644
--- a/packages/client/src/layouts/PrivateLayout/PrivateLayout.tsx
+++ b/packages/client/src/layouts/PrivateLayout/PrivateLayout.tsx
@@ -24,9 +24,11 @@ export function PrivateLayout() {
.then(data => {
dispatch(actions.setUser(data))
window.sessionStorage.setItem('userIsLogged', '1') // 0
+ window.sessionStorage.setItem('userId', data.id.toString())
})
.catch(() => {
window.sessionStorage.setItem('userIsLogged', '0') // 0
+ window.sessionStorage.setItem('userId', '')
toast.error('Необходимо авторизоваться', {
autoClose: 1500,
diff --git a/packages/client/src/layouts/PublicLayout/PublicLayout.scss b/packages/client/src/layouts/PublicLayout/PublicLayout.scss
index 166c805..4acebe4 100644
--- a/packages/client/src/layouts/PublicLayout/PublicLayout.scss
+++ b/packages/client/src/layouts/PublicLayout/PublicLayout.scss
@@ -10,5 +10,6 @@
&__body {
flex: 1 1 100%;
padding-top: $layout_body-m-top;
+ padding-bottom: calc($layout_body-m-top + $layout_body-m-top);
}
}
diff --git a/packages/client/src/layouts/RootLayout/RootLayout.tsx b/packages/client/src/layouts/RootLayout/RootLayout.tsx
index 186d0e1..27d02a6 100644
--- a/packages/client/src/layouts/RootLayout/RootLayout.tsx
+++ b/packages/client/src/layouts/RootLayout/RootLayout.tsx
@@ -11,7 +11,20 @@ export default function RootLayout() {
)
useEffect(() => {
- document.body.classList.add('custom-theme__' + themeAlias)
+ const bodyEl = document?.body
+ const bodyClassname = bodyEl?.getAttribute('class') || ''
+
+ if (typeof bodyClassname === 'string') {
+ const classListString = bodyClassname
+ .replace(/\bcustom-theme__\S*/g, '')
+ .replace(/\btypescript\b/g, '')
+ .trim()
+
+ bodyEl.setAttribute(
+ 'class',
+ `${classListString} custom-theme__${themeAlias}`
+ )
+ }
})
return (
diff --git a/packages/client/src/pages/Game/Game.scss b/packages/client/src/pages/Game/Game.scss
index 8ce909d..4476290 100644
--- a/packages/client/src/pages/Game/Game.scss
+++ b/packages/client/src/pages/Game/Game.scss
@@ -10,6 +10,8 @@
$border-color: #70842f;
.game-page {
+ padding-bottom: 80px;
+
&__container {
margin: 0 auto;
max-width: 1400px !important;
diff --git a/packages/client/src/pages/Leaderboard/components/User/User.scss b/packages/client/src/pages/Leaderboard/components/User/User.scss
index e0c0435..57d0250 100644
--- a/packages/client/src/pages/Leaderboard/components/User/User.scss
+++ b/packages/client/src/pages/Leaderboard/components/User/User.scss
@@ -2,9 +2,11 @@
// Константы для медалей
$medal-colors: (
- 1: #ffd700, // Gold
- 2: #c0c0c0, // Silver
- 3: #cd7f32 // Bronze
+ 1: #ffd700,
+ // Gold
+ 2: #c0c0c0,
+ // Silver
+ 3: #cd7f32 // Bronze,
);
$c_item-border-main-color: #9d9b9b;
@@ -15,14 +17,22 @@ $c_item-border-secondary-color: #474747;
&__item-wrapper {
position: relative;
border-radius: 16px;
- background: linear-gradient(90deg, $c_item-border-main-color 52.5%, $c_item-border-secondary-color 100%);
+ background: linear-gradient(
+ 90deg,
+ $c_item-border-main-color 52.5%,
+ $c_item-border-secondary-color 100%
+ );
margin: 5px 0;
padding: 2px;
// Медальные рамки
@each $rank, $color in $medal-colors {
&__rank-#{$rank} {
- background: linear-gradient(90deg, $color 52.5%, darken($color, 20%) 100%);
+ background: linear-gradient(
+ 90deg,
+ $color 52.5%,
+ darken($color, 20%) 100%
+ );
}
}
}
@@ -124,4 +134,4 @@ $c_item-border-secondary-color: #474747;
&__load-more {
margin: 48px auto 0 auto;
}
-}
\ No newline at end of file
+}
diff --git a/packages/client/src/pages/Profile/Profile.scss b/packages/client/src/pages/Profile/Profile.scss
index 86a137c..ba61a34 100644
--- a/packages/client/src/pages/Profile/Profile.scss
+++ b/packages/client/src/pages/Profile/Profile.scss
@@ -36,6 +36,7 @@
align-items: center;
min-height: 100vh;
box-sizing: border-box;
+ padding-bottom: 40px;
&__title {
margin-bottom: 48px;
diff --git a/packages/client/src/scss/styles.scss b/packages/client/src/scss/styles.scss
index 5822926..2e86e48 100644
--- a/packages/client/src/scss/styles.scss
+++ b/packages/client/src/scss/styles.scss
@@ -3,4 +3,4 @@
@import './base.scss';
@import './grid-system.scss';
-@import './themes/christmas.scss';
\ No newline at end of file
+@import './themes/christmas.scss';
diff --git a/packages/client/src/scss/themes/christmas.scss b/packages/client/src/scss/themes/christmas.scss
index 2b7afc3..ed8c2f8 100644
--- a/packages/client/src/scss/themes/christmas.scss
+++ b/packages/client/src/scss/themes/christmas.scss
@@ -1,75 +1,75 @@
.custom-theme__christmas {
- .main-nav {
- position: relative;
+ .main-nav {
+ position: relative;
- &:after {
- content: '';
- position: absolute;
- left: 0;
- right: 0;
- bottom: -8px;
- height: 40px;
- background: url('@/assets/images/themes/christmas/garland.png') repeat-x;
- background-size: contain;
- }
+ &:after {
+ content: '';
+ position: absolute;
+ left: 0;
+ right: 0;
+ bottom: -8px;
+ height: 40px;
+ background: url('@/assets/images/themes/christmas/garland.png') repeat-x;
+ background-size: contain;
}
-
- .logo-block {
- position: relative;
+ }
- &__image {
- filter: grayscale(1);
- }
+ .logo-block {
+ position: relative;
- &::before {
- content: '';
- position: absolute;
- z-index: 1;
- left: 16px;
- top: 4px;
- width: 44px;
- height: 32px;
- background: url('@/assets/images/themes/christmas/head.png');
- background-size: contain;
- background-repeat: no-repeat;
- }
+ &__image {
+ filter: grayscale(1);
}
-
- .custom-page-title__content {
- position: relative;
- overflow: hidden;
- z-index: 1;
- background-image: url("@/assets/images/themes/christmas/titlebar__bg.jpg");
- background-size: cover;
- &::before {
- content: '';
- position: absolute;
- inset: 0;
- background: rgba(0, 0, 0, 0.5);
- z-index: -1;
- }
+ &::before {
+ content: '';
+ position: absolute;
+ z-index: 1;
+ left: 16px;
+ top: 4px;
+ width: 44px;
+ height: 32px;
+ background: url('@/assets/images/themes/christmas/head.png');
+ background-size: contain;
+ background-repeat: no-repeat;
}
+ }
- .preloader__road {
- background-image: url("@/assets/images/themes/christmas/christmas-ground.png");
+ .custom-page-title__content {
+ position: relative;
+ overflow: hidden;
+ z-index: 1;
+ background-image: url('@/assets/images/themes/christmas/titlebar__bg.jpg');
+ background-size: cover;
+
+ &::before {
+ content: '';
+ position: absolute;
+ inset: 0;
+ background: rgba(0, 0, 0, 0.5);
+ z-index: -1;
}
+ }
+
+ .preloader__road {
+ background-image: url('@/assets/images/themes/christmas/christmas-ground.png');
+ }
- .custom-button{
- position: relative;
- z-index: 1;
+ .custom-button {
+ position: relative;
+ z-index: 1;
- &::before {
- content: '';
- position: absolute;
- inset: 0;
- background-image: url("@/assets/images/themes/christmas/snow.png");
- background-position: -60% 24%;
- background-size: 60%;
- background-repeat: no-repeat;
- z-index: -1;
- border-radius: 6px;
- opacity: 0.3;
- }
+ &::before {
+ content: '';
+ position: absolute;
+ inset: 0;
+ background-image: url('@/assets/images/themes/christmas/snow.png');
+ background-position: -60% 24%;
+ background-size: 60%;
+ background-repeat: no-repeat;
+ z-index: -1;
+ border-radius: 6px;
+ opacity: 0.3;
}
-}
\ No newline at end of file
+ }
+}
diff --git a/packages/client/src/store/reducers/theme-reducer.ts b/packages/client/src/store/reducers/theme-reducer.ts
index 9c2d305..9a2bef4 100644
--- a/packages/client/src/store/reducers/theme-reducer.ts
+++ b/packages/client/src/store/reducers/theme-reducer.ts
@@ -32,8 +32,6 @@ const slice = createSlice({
initialState,
reducers: {
setTheme(state, action: PayloadAction) {
- console.log('setTheme', action.payload)
-
state.themeAlias = action.payload
},
},
@@ -101,12 +99,11 @@ export const updateTheme = createAsyncThunk<
{ rejectValue: string }
>('UserTheme/updateTheme', async (newThemeAlias: string, thunkAPI) => {
try {
- const state = thunkAPI.getState() as RootState
- const user = state.authReducer.user
+ const userId = window.sessionStorage.getItem('userId')
- if (user && user.id) {
+ if (userId) {
const response = await userThemeApi.setTheme(
- parseFloat(user.id),
+ parseFloat(userId),
newThemeAlias
)
diff --git a/packages/server/tsconfig.server.json b/packages/server/tsconfig.server.json
index 96d7850..56c10ab 100644
--- a/packages/server/tsconfig.server.json
+++ b/packages/server/tsconfig.server.json
@@ -1,13 +1,15 @@
{
"compilerOptions": {
"outDir": "ts-dist",
+ "rootDir": "./",
"composite": true,
"target": "es2019",
"module": "commonjs",
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"lib": ["es2019", "DOM"],
- "skipLibCheck": true
+ "skipLibCheck": true,
+ "types": ["node"]
},
"include": [
"index.ts",
@@ -20,5 +22,6 @@
"routes/**/*.ts",
"utils/**/*.ts",
"types/**/*.ts"
- ]
+ ],
+ "exclude": ["ts-dist"]
}