From b5474eae310b5dae690e3cea3c3e3ffc70d84484 Mon Sep 17 00:00:00 2001 From: MaryWylde Date: Fri, 19 Dec 2025 18:12:03 +0400 Subject: [PATCH] chore: add snowfall to Core View --- package.json | 1 + src/layouts/Layout.tsx | 5 +++-- src/layouts/UXCoreLayout/UXCoreLayout.tsx | 8 +++++++- yarn.lock | 9 ++++++++- 4 files changed, 19 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index f7a170d..dba43e9 100644 --- a/package.json +++ b/package.json @@ -56,6 +56,7 @@ "react-minimal-pie-chart": "9.1.2", "react-simple-player": "1.1.0", "react-slick": "0.29.0", + "react-snowfall": "^2.4.0", "react-to-pdf": "1.0.1", "react-toastify": "8.0.3", "react-tooltip": "5.27.1", diff --git a/src/layouts/Layout.tsx b/src/layouts/Layout.tsx index 3d5bc7c..33967fc 100644 --- a/src/layouts/Layout.tsx +++ b/src/layouts/Layout.tsx @@ -36,10 +36,11 @@ export default function Layout({ children }: { children: React.ReactNode }) { const { isUxcoreMobile } = useUCoreMobile()[1]; const pathName = usePathname() ?? ''; + const normalizedPath = pathName.replace(/\/+$/, ''); - const pathnameWithBypass = /^\/uxcp\/+$/i.test(pathName) + const pathnameWithBypass = /^\/uxcp$/i.test(normalizedPath) ? '/uxcp/' - : pathName.replace(/\/+$/, ''); + : normalizedPath; const path = pathnameWithBypass.replace(/\/+$/, ''); const isUXCoreRoot = path === '/uxcore'; diff --git a/src/layouts/UXCoreLayout/UXCoreLayout.tsx b/src/layouts/UXCoreLayout/UXCoreLayout.tsx index ac1cec8..0dcf649 100644 --- a/src/layouts/UXCoreLayout/UXCoreLayout.tsx +++ b/src/layouts/UXCoreLayout/UXCoreLayout.tsx @@ -2,6 +2,7 @@ import React, { FC, useEffect, useState } from 'react'; import { useRouter } from 'next/router'; import cn from 'classnames'; import dynamic from 'next/dynamic'; +import Snowfall from 'react-snowfall'; import type { TRouter } from '@local-types/global'; import type { UXCoreLayoutProps } from './UXCoreLayout.types'; @@ -131,7 +132,6 @@ const UXCoreLayout: FC = ({ if (!isLoaded) { return ; } - return ( <>
= ({ {isCoreView && } {isCoreView && ( <> + {locale !== 'hy' && openPodcast && (