{isLoggedIn ? (
@@ -106,5 +95,3 @@ function Header() {
);
}
-
-export default Header;
diff --git a/apps/client/src/components/Header/LogInButton.tsx b/apps/client/src/widgets/Header/LogInButton.tsx
similarity index 87%
rename from apps/client/src/components/Header/LogInButton.tsx
rename to apps/client/src/widgets/Header/LogInButton.tsx
index 43dc4f40..fd8deae3 100644
--- a/apps/client/src/components/Header/LogInButton.tsx
+++ b/apps/client/src/widgets/Header/LogInButton.tsx
@@ -1,13 +1,12 @@
import { useState } from 'react';
-import WelcomeCharacter from '@components/WelcomeCharacter';
-import { Button } from '@components/ui/button';
import { createPortal } from 'react-dom';
-import Modal from '@components/Modal';
-import { GithubIcon, GoogleIcon } from '@components/Icons';
-import { useAuth } from '@/hooks/useAuth';
-import axiosInstance from '@/services/axios';
+import { WelcomeCharacter } from './WelcomeCharacter';
+import { Button } from '@/shared/ui/shadcn/button';
+import { Modal, GithubIcon, GoogleIcon } from '@/shared/ui';
+import { useAuth } from '@/features/auth';
+import { axiosInstance } from '@/shared/api';
-function LogInButton() {
+export function LogInButton() {
const [showModal, setShowModal] = useState(false);
const { requestLogIn, setLogIn } = useAuth();
@@ -72,5 +71,3 @@ function LogInButton() {
>
);
}
-
-export default LogInButton;
diff --git a/apps/client/src/widgets/Header/LogoButton.tsx b/apps/client/src/widgets/Header/LogoButton.tsx
new file mode 100644
index 00000000..bc833fb4
--- /dev/null
+++ b/apps/client/src/widgets/Header/LogoButton.tsx
@@ -0,0 +1,21 @@
+import { useNavigate } from 'react-router-dom';
+import { Logo } from '@/shared/ui/Icons';
+import { DefaultCharacter } from '@/shared/ui';
+
+export function LogoButton() {
+ const navigate = useNavigate();
+ const handleLogoClick = () => {
+ if (window.location.pathname === '/') {
+ window.location.reload();
+ } else {
+ navigate('/');
+ }
+ };
+
+ return (
+
+ );
+}
diff --git a/apps/client/src/components/WelcomeCharacter/index.tsx b/apps/client/src/widgets/Header/WelcomeCharacter.tsx
similarity index 97%
rename from apps/client/src/components/WelcomeCharacter/index.tsx
rename to apps/client/src/widgets/Header/WelcomeCharacter.tsx
index aa5de154..1864950f 100644
--- a/apps/client/src/components/WelcomeCharacter/index.tsx
+++ b/apps/client/src/widgets/Header/WelcomeCharacter.tsx
@@ -3,7 +3,7 @@ type Props = {
className?: string;
};
-function WelcomeCharacter({ size, className }: Props) {
+export function WelcomeCharacter({ size, className }: Props) {
return (
);
}
-export default WelcomeCharacter;
diff --git a/apps/client/src/widgets/Header/index.tsx b/apps/client/src/widgets/Header/index.tsx
new file mode 100644
index 00000000..29429dc9
--- /dev/null
+++ b/apps/client/src/widgets/Header/index.tsx
@@ -0,0 +1 @@
+export { Header } from './Header';
diff --git a/apps/client/src/pages/Home/FieldFilter.tsx b/apps/client/src/widgets/LiveList/FieldFilter.tsx
similarity index 82%
rename from apps/client/src/pages/Home/FieldFilter.tsx
rename to apps/client/src/widgets/LiveList/FieldFilter.tsx
index 277d8297..8805f377 100644
--- a/apps/client/src/pages/Home/FieldFilter.tsx
+++ b/apps/client/src/widgets/LiveList/FieldFilter.tsx
@@ -1,6 +1,6 @@
import { useState } from 'react';
-import { Button } from '@/components/ui/button';
-import { Field } from '@/types/liveTypes';
+import { Button } from '@/shared/ui/shadcn/button';
+import { Field } from '@/shared/types/sharedTypes';
const fields: Field[] = ['WEB', 'AND', 'IOS'];
@@ -8,7 +8,7 @@ type FieldFilterProps = {
onClickFilterButton: (field: Field) => void;
};
-function FieldFilter({ onClickFilterButton }: FieldFilterProps) {
+export function FieldFilter({ onClickFilterButton }: FieldFilterProps) {
const [selected, setSelected] = useState('');
const handleClick = (field: Field) => {
@@ -35,5 +35,3 @@ function FieldFilter({ onClickFilterButton }: FieldFilterProps) {
);
}
-
-export default FieldFilter;
diff --git a/apps/client/src/pages/Home/LiveCard.tsx b/apps/client/src/widgets/LiveList/LiveCard.tsx
similarity index 93%
rename from apps/client/src/pages/Home/LiveCard.tsx
rename to apps/client/src/widgets/LiveList/LiveCard.tsx
index ba32d2d0..dd9188e6 100644
--- a/apps/client/src/pages/Home/LiveCard.tsx
+++ b/apps/client/src/widgets/LiveList/LiveCard.tsx
@@ -8,7 +8,7 @@ type LiveCardProps = {
thumbnailUrl: string;
};
-function LiveCard({ liveId, title, userId, profileUrl, thumbnailUrl }: LiveCardProps) {
+export function LiveCard({ liveId, title, userId, profileUrl, thumbnailUrl }: LiveCardProps) {
const navigate = useNavigate();
const handleClick = () => {
@@ -46,5 +46,3 @@ function LiveCard({ liveId, title, userId, profileUrl, thumbnailUrl }: LiveCardP
);
}
-
-export default LiveCard;
diff --git a/apps/client/src/pages/Home/LiveList.tsx b/apps/client/src/widgets/LiveList/LiveList.tsx
similarity index 89%
rename from apps/client/src/pages/Home/LiveList.tsx
rename to apps/client/src/widgets/LiveList/LiveList.tsx
index 1f7a22ce..e3cd1894 100644
--- a/apps/client/src/pages/Home/LiveList.tsx
+++ b/apps/client/src/widgets/LiveList/LiveList.tsx
@@ -1,15 +1,15 @@
import { useCallback, useEffect, useState } from 'react';
-import axiosInstance from '@services/axios';
-import FieldFilter from './FieldFilter';
-import LiveCard from './LiveCard';
-import { LivePreviewInfo } from '@/types/homeTypes';
-import Search from './Search';
-import { Field } from '@/types/liveTypes';
-import { useIntersect } from '@/hooks/useIntersect';
+import { axiosInstance } from '@/shared/api';
+import { FieldFilter } from './FieldFilter';
+import { LiveCard } from './LiveCard';
+import { LivePreviewInfo } from '@/pages/Home/model/homeTypes';
+import { Search } from './Search';
+import { Field } from '@/shared/types/sharedTypes';
+import { useIntersect } from '@/pages/Home/model';
const LIMIT = 12;
-function LiveList() {
+export function LiveList() {
const [liveList, setLiveList] = useState
([]);
const [hasNext, setHasNext] = useState(true);
const [cursor, setCursor] = useState(null);
@@ -93,5 +93,3 @@ function LiveList() {
);
}
-
-export default LiveList;
diff --git a/apps/client/src/pages/Home/Search.tsx b/apps/client/src/widgets/LiveList/Search.tsx
similarity index 83%
rename from apps/client/src/pages/Home/Search.tsx
rename to apps/client/src/widgets/LiveList/Search.tsx
index 5b65e95f..5bbee8d9 100644
--- a/apps/client/src/pages/Home/Search.tsx
+++ b/apps/client/src/widgets/LiveList/Search.tsx
@@ -1,6 +1,5 @@
import { useForm } from 'react-hook-form';
-import IconButton from '@/components/IconButton';
-import { SearchIcon } from '@/components/Icons';
+import { IconButton, SearchIcon } from '@/shared/ui';
type SearchProps = {
onSearch: (keyword: string) => void;
@@ -10,7 +9,7 @@ type FormInput = {
keyword: string;
};
-function Search({ onSearch }: SearchProps) {
+export function Search({ onSearch }: SearchProps) {
const { register, handleSubmit } = useForm