Skip to content

Commit

Permalink
refactor: 626 - remove unnecessary use client directives
Browse files Browse the repository at this point in the history
  • Loading branch information
Quiddlee committed Nov 4, 2024
1 parent b66957f commit 31c91ab
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 103 deletions.
12 changes: 2 additions & 10 deletions src/core/base-layout/base-layout.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
'use client';

import { PropsWithChildren, useEffect } from 'react';
import { Footer, Header, Partnered, ScrollToHashElement } from './components';
import { PropsWithChildren } from 'react';
import { Footer, Header, Partnered } from './components';

export const BaseLayout = ({ children }: PropsWithChildren) => {
useEffect(() => {
if (typeof window !== 'undefined' && window.location.hostname.includes('rollingscopes.com')) {
window.location.href = 'https://rs.school';
}
}, []);
return (
<>
<ScrollToHashElement />
<Header />
{children}
<Partnered />
Expand Down
2 changes: 2 additions & 0 deletions src/core/base-layout/components/header/header.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import { useEffect, useState } from 'react';
import classNames from 'classnames/bind';
import { usePathname } from 'next/navigation';
Expand Down
1 change: 0 additions & 1 deletion src/core/base-layout/components/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
export { Footer } from './footer';
export { Header } from './header';
export { Partnered } from './partnered';
export { ScrollToHashElement } from './scroll-to-hash';
1 change: 0 additions & 1 deletion src/core/base-layout/components/scroll-to-hash/index.ts

This file was deleted.

This file was deleted.

31 changes: 0 additions & 31 deletions src/core/base-layout/components/scroll-to-hash/scroll-to-hash.tsx

This file was deleted.

1 change: 0 additions & 1 deletion src/shared/ui/logo/logo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ export const Logo = ({ type, className }: LogoProps) => {
className,
})}
data-testid="logo"
onClick={() => window.scrollTo({ top: 0 })}
>
<Image src={logo} alt="RSS-logo" />
</Link>
Expand Down

0 comments on commit 31c91ab

Please # to comment.