diff --git a/packages/client/src/app/Router.tsx b/packages/client/src/app/Router.tsx
index a83c75d..c71a6ee 100644
--- a/packages/client/src/app/Router.tsx
+++ b/packages/client/src/app/Router.tsx
@@ -3,16 +3,17 @@ import {
createBrowserRouter,
createRoutesFromElements,
} from 'react-router-dom';
-import Home from '../pages/Home';
-import Landing from '../pages/Landing';
-import { WritingModal } from 'features/writingModal';
-import LoginModal from 'widgets/loginModal';
+import Home from '../pages/Home/Home';
+import Landing from '../pages/Landing/Landing';
+import { WritingModal } from 'features/writingModal/WritingModal';
+import LoginModal from 'widgets/loginModal/LoginModal';
import SignUpModal from 'widgets/signupModal/SignUpModal';
import NickNameSetModal from 'widgets/nickNameSetModal/NickNameSetModal';
-import LogoAndStart from 'widgets/logoAndStart';
+import LogoAndStart from 'widgets/logoAndStart/LogoAndStart';
import { PostModal } from 'features/postModal';
import GalaxyCustomModal from 'widgets/galaxyCustomModal/GalaxyCustomModal';
import StarCustomModal from 'widgets/starCustomModal/StarCustomModal';
+import ShareModal from 'widgets/shareModal/ShareModal';
export const router = createBrowserRouter(
createRoutesFromElements(
@@ -33,6 +34,7 @@ export const router = createBrowserRouter(
} />
} />
} />
+ } />
>,
),
diff --git a/packages/client/src/assets/icon-check-purple.svg b/packages/client/src/assets/icon-check-purple.svg
new file mode 100644
index 0000000..022251f
--- /dev/null
+++ b/packages/client/src/assets/icon-check-purple.svg
@@ -0,0 +1,7 @@
+
+
+
+
\ No newline at end of file
diff --git a/packages/client/src/entities/posts/apis/getMyPost.ts b/packages/client/src/entities/posts/apis/getMyPost.ts
new file mode 100644
index 0000000..7a03c92
--- /dev/null
+++ b/packages/client/src/entities/posts/apis/getMyPost.ts
@@ -0,0 +1,9 @@
+import instance from 'shared/apis/AxiosInterceptor';
+
+export const getMyPost = async () => {
+ const { data } = await instance({
+ method: 'GET',
+ url: '/star',
+ });
+ return data;
+};
diff --git a/packages/client/src/entities/posts/ui/Post.tsx b/packages/client/src/entities/posts/ui/Post.tsx
index 17296ab..647590d 100644
--- a/packages/client/src/entities/posts/ui/Post.tsx
+++ b/packages/client/src/entities/posts/ui/Post.tsx
@@ -1,4 +1,3 @@
-import Star from 'features/star';
import { useRef } from 'react';
import { useCameraStore } from 'shared/store/useCameraStore';
import { ThreeEvent } from '@react-three/fiber';
@@ -10,6 +9,7 @@ import { StarType } from 'shared/lib/types/star';
import { useNavigate } from 'react-router-dom';
import { useState } from 'react';
import theme from 'shared/ui/styles/theme';
+import Star from 'features/star/Star';
interface PropsType {
data: StarType;
diff --git a/packages/client/src/entities/posts/ui/Posts.tsx b/packages/client/src/entities/posts/ui/Posts.tsx
index ab686b1..68085e4 100644
--- a/packages/client/src/entities/posts/ui/Posts.tsx
+++ b/packages/client/src/entities/posts/ui/Posts.tsx
@@ -1,4 +1,3 @@
-import { useFetch } from 'shared/hooks';
import Post from './Post';
import { useState } from 'react';
import { StarData } from 'shared/lib/types/star';
@@ -6,6 +5,7 @@ import { useOwnerStore } from 'shared/store/useOwnerStore';
import { getPostListByNickName } from 'shared/apis/star';
import { useEffect } from 'react';
import { useViewStore } from 'shared/store';
+import { getMyPost } from '../apis/getMyPost';
export default function Posts() {
const [postData, setPostData] = useState();
@@ -13,13 +13,14 @@ export default function Posts() {
const { isMyPage, pageOwnerNickName } = useOwnerStore();
const { view } = useViewStore();
- const myPostData = useFetch('star').data;
-
useEffect(() => {
if (view !== 'MAIN') return;
if (isMyPage) {
- setPostData(myPostData);
+ (async () => {
+ const myPostData = await getMyPost();
+ setPostData(myPostData);
+ })();
return;
}
@@ -27,7 +28,7 @@ export default function Posts() {
const otherPostData = await getPostListByNickName(pageOwnerNickName);
setPostData(otherPostData);
})();
- }, [isMyPage, myPostData, view]);
+ }, [isMyPage, view]);
return (
<>
diff --git a/packages/client/src/features/backgroundStars/index.tsx b/packages/client/src/features/backgroundStars/BackgroundStars.tsx
similarity index 100%
rename from packages/client/src/features/backgroundStars/index.tsx
rename to packages/client/src/features/backgroundStars/BackgroundStars.tsx
diff --git a/packages/client/src/features/controls/Controls.tsx b/packages/client/src/features/controls/Controls.tsx
index a56292e..c4f0ef2 100644
--- a/packages/client/src/features/controls/Controls.tsx
+++ b/packages/client/src/features/controls/Controls.tsx
@@ -37,7 +37,7 @@ export default function Controls() {
useFrame((state, delta) => {
const targetPosition = new THREE.Vector3(0, 0, 0);
- const LENGTH_LIMIT = 1000 * delta;
+ const LENGTH_LIMIT = (cameraToCurrentView * delta) / 2;
if (targetView) targetView.getWorldPosition(targetPosition);
if (view === 'POST') {
diff --git a/packages/client/src/features/star/index.tsx b/packages/client/src/features/star/Star.tsx
similarity index 100%
rename from packages/client/src/features/star/index.tsx
rename to packages/client/src/features/star/Star.tsx
diff --git a/packages/client/src/features/star/lib/constants/index.ts b/packages/client/src/features/star/lib/constants/index.ts
index e98a87d..181cea9 100644
--- a/packages/client/src/features/star/lib/constants/index.ts
+++ b/packages/client/src/features/star/lib/constants/index.ts
@@ -1 +1 @@
-export const DISTANCE_LIMIT = 3000;
+export const DISTANCE_LIMIT = 5000;
diff --git a/packages/client/src/features/writingModal/index.tsx b/packages/client/src/features/writingModal/WritingModal.tsx
similarity index 100%
rename from packages/client/src/features/writingModal/index.tsx
rename to packages/client/src/features/writingModal/WritingModal.tsx
diff --git a/packages/client/src/pages/Home/index.tsx b/packages/client/src/pages/Home/Home.tsx
similarity index 88%
rename from packages/client/src/pages/Home/index.tsx
rename to packages/client/src/pages/Home/Home.tsx
index 5e49923..2a0c8ae 100644
--- a/packages/client/src/pages/Home/index.tsx
+++ b/packages/client/src/pages/Home/Home.tsx
@@ -1,8 +1,8 @@
-import Screen from 'widgets/screen';
+import Screen from 'widgets/screen/Screen';
import { useViewStore } from 'shared/store/useViewStore';
import { Outlet, useNavigate } from 'react-router-dom';
-import UnderBar from 'shared/ui/underBar/UnderBar';
-import UpperBar from './ui/UpperBar';
+import UnderBar from 'widgets/underBar/UnderBar';
+import UpperBar from '../../widgets/upperBar/UpperBar';
import WarpScreen from 'widgets/warpScreen/WarpScreen';
import { useEffect, useState } from 'react';
import instance from 'shared/apis/AxiosInterceptor';
@@ -32,21 +32,19 @@ export default function Home() {
const { setSpiral, setStart, setThickness, setZDist } = useGalaxyStore();
useEffect(() => {
- const checkLogin = async () => {
+ (async () => {
try {
const res = await instance({
method: 'GET',
url: `/auth/check-signin`,
});
- if (res.status !== 200) {
- navigate('/login');
- }
+
+ if (res.status !== 200) navigate('/login');
} catch (error) {
- console.error(error);
navigate('/login');
}
- };
- checkLogin();
+ })();
+
getSignInInfo().then((res) => {
Cookies.set('nickname', res.nickname);
setNickname(res.nickname);
diff --git a/packages/client/src/pages/Home/ui/index.ts b/packages/client/src/pages/Home/ui/index.ts
deleted file mode 100644
index 22954c8..0000000
--- a/packages/client/src/pages/Home/ui/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export * from './UpperBar';
diff --git a/packages/client/src/pages/Landing/index.tsx b/packages/client/src/pages/Landing/Landing.tsx
similarity index 89%
rename from packages/client/src/pages/Landing/index.tsx
rename to packages/client/src/pages/Landing/Landing.tsx
index 4943a61..da9bc18 100644
--- a/packages/client/src/pages/Landing/index.tsx
+++ b/packages/client/src/pages/Landing/Landing.tsx
@@ -1,4 +1,4 @@
-import LandingScreen from 'widgets/landingScreen';
+import LandingScreen from 'widgets/landingScreen/LandingScreen';
import { useState } from 'react';
import { useToastStore } from 'shared/store/useToastStore';
import { Toast } from 'shared/ui';
diff --git a/packages/client/src/pages/Landing/ui/styled.ts b/packages/client/src/pages/Landing/ui/styled.ts
deleted file mode 100644
index e69de29..0000000
diff --git a/packages/client/src/shared/apis/login.ts b/packages/client/src/shared/apis/login.ts
index 6bc6ea1..825c52d 100644
--- a/packages/client/src/shared/apis/login.ts
+++ b/packages/client/src/shared/apis/login.ts
@@ -1,7 +1,6 @@
import axios, { AxiosError } from 'axios';
import Cookies from 'js-cookie';
import { NavigateFunction } from 'react-router-dom';
-import { useScreenSwitchStore } from 'shared/store/useScreenSwitchStore';
import instance from './AxiosInterceptor';
axios.defaults.withCredentials = true;
@@ -14,6 +13,7 @@ export const postLogin = async (
setIdState: React.Dispatch>,
setPasswordState: React.Dispatch>,
navigate: NavigateFunction,
+ setIsSwitching: (value: boolean) => void,
) => {
try {
await instance({
@@ -23,7 +23,6 @@ export const postLogin = async (
});
Cookies.set('userId', data.username, { path: '/', expires: 7 });
navigate('/home');
- const { setIsSwitching } = useScreenSwitchStore();
setIsSwitching(true);
} catch (err) {
if (err instanceof AxiosError) {
diff --git a/packages/client/src/shared/apis/share.ts b/packages/client/src/shared/apis/share.ts
new file mode 100644
index 0000000..53a84df
--- /dev/null
+++ b/packages/client/src/shared/apis/share.ts
@@ -0,0 +1,22 @@
+import instance from './AxiosInterceptor';
+
+export const getShareLink = async (nickName: string) => {
+ const { data } = await instance({
+ method: 'GET',
+ url: `/auth/sharelink?nickname=${nickName}`,
+ });
+
+ return data;
+};
+
+export const patchShareStatus = async (status: 'private' | 'public') => {
+ const { data } = await instance({
+ method: 'PATCH',
+ url: `/auth/status`,
+ data: {
+ status,
+ },
+ });
+
+ return data;
+};
diff --git a/packages/client/src/shared/store/useViewStore.ts b/packages/client/src/shared/store/useViewStore.ts
index 2e856b7..c5ffcbd 100644
--- a/packages/client/src/shared/store/useViewStore.ts
+++ b/packages/client/src/shared/store/useViewStore.ts
@@ -1,6 +1,6 @@
import { create } from 'zustand';
-type view = 'MAIN' | 'DETAIL' | 'POST' | 'WRITING' | 'CUSTOM';
+type view = 'MAIN' | 'DETAIL' | 'POST' | 'WRITING' | 'CUSTOM' | 'SHARE';
interface ViewState {
view: view;
diff --git a/packages/client/src/shared/ui/inputBar/index.tsx b/packages/client/src/shared/ui/inputBar/index.tsx
deleted file mode 100644
index bba0db2..0000000
--- a/packages/client/src/shared/ui/inputBar/index.tsx
+++ /dev/null
@@ -1 +0,0 @@
-export { default as Input } from './InputBar';
diff --git a/packages/client/src/widgets/galaxy/lib/constants/index.ts b/packages/client/src/widgets/galaxy/lib/constants/index.ts
index 9c9ae12..8448e22 100644
--- a/packages/client/src/widgets/galaxy/lib/constants/index.ts
+++ b/packages/client/src/widgets/galaxy/lib/constants/index.ts
@@ -1,4 +1,4 @@
-export const STARS_NUM = 10000;
+export const STARS_NUM = 6000;
export const DISTANCE_LIMIT = 3000;
diff --git a/packages/client/src/widgets/galaxyCustomModal/GalaxyCustom.tsx b/packages/client/src/widgets/galaxyCustomModal/GalaxyCustom.tsx
new file mode 100644
index 0000000..a85b098
--- /dev/null
+++ b/packages/client/src/widgets/galaxyCustomModal/GalaxyCustom.tsx
@@ -0,0 +1,48 @@
+import { Modal } from 'shared/ui';
+import { useNavigate } from 'react-router-dom';
+import { RightButton, SampleScreen, Sliders } from './ui';
+import { useViewStore } from 'shared/store';
+import styled from '@emotion/styled';
+import { useGalaxyStore, useCustomStore } from 'shared/store';
+
+export default function GalaxyCustom() {
+ const navigate = useNavigate();
+ const { setView } = useViewStore();
+ const { setSpiral, setStart, setThickness, setZDist } = useGalaxyStore();
+ const { spiral, start, thickness, zDist } = useCustomStore();
+
+ const handleSubmit = () => {
+ setSpiral(spiral);
+ setStart(start);
+ setThickness(thickness);
+ setZDist(zDist);
+ };
+
+ return (
+
+ );
+}
+
+const Container = styled.div`
+ display: flex;
+ gap: 24px;
+`;
diff --git a/packages/client/src/widgets/landingScreen/index.tsx b/packages/client/src/widgets/landingScreen/LandingScreen.tsx
similarity index 88%
rename from packages/client/src/widgets/landingScreen/index.tsx
rename to packages/client/src/widgets/landingScreen/LandingScreen.tsx
index ff389f0..6fa339b 100644
--- a/packages/client/src/widgets/landingScreen/index.tsx
+++ b/packages/client/src/widgets/landingScreen/LandingScreen.tsx
@@ -1,6 +1,6 @@
import { Canvas } from '@react-three/fiber';
-import BackgroundStars from 'features/backgroundStars';
-import { Galaxy } from '../galaxy';
+import BackgroundStars from 'features/backgroundStars/BackgroundStars.tsx';
+import { Galaxy } from '../galaxy/index.ts';
import { EffectComposer, Bloom } from '@react-three/postprocessing';
import { CAMERA_POSITION, CAMERA_UP, CAMERA_FAR } from './lib/camera.ts';
diff --git a/packages/client/src/widgets/loginModal/index.tsx b/packages/client/src/widgets/loginModal/LoginModal.tsx
similarity index 86%
rename from packages/client/src/widgets/loginModal/index.tsx
rename to packages/client/src/widgets/loginModal/LoginModal.tsx
index 7f89480..8394627 100644
--- a/packages/client/src/widgets/loginModal/index.tsx
+++ b/packages/client/src/widgets/loginModal/LoginModal.tsx
@@ -5,6 +5,7 @@ import Cookies from 'js-cookie';
import { useState } from 'react';
import { postLogin } from 'shared/apis';
import { useCheckLogin } from 'shared/hooks';
+import { useScreenSwitchStore } from 'shared/store/useScreenSwitchStore';
export default function LoginModal() {
const [id, setId] = useState(Cookies.get('userId') ?? '');
@@ -12,6 +13,7 @@ export default function LoginModal() {
const [password, setPassword] = useState('');
const [passwordState, setPasswordState] = useState(true);
const navigate = useNavigate();
+ const { setIsSwitching } = useScreenSwitchStore();
const isValid = () => {
return id.length && password.length && idState && passwordState;
@@ -24,7 +26,13 @@ export default function LoginModal() {
password: password,
};
setPassword('');
- await postLogin(data, setIdState, setPasswordState, navigate);
+ await postLogin(
+ data,
+ setIdState,
+ setPasswordState,
+ navigate,
+ setIsSwitching,
+ );
};
useCheckLogin();
diff --git a/packages/client/src/widgets/loginModal/ui/OauthLogin.tsx b/packages/client/src/widgets/loginModal/ui/OauthLogin.tsx
index c207a72..1d9b88a 100644
--- a/packages/client/src/widgets/loginModal/ui/OauthLogin.tsx
+++ b/packages/client/src/widgets/loginModal/ui/OauthLogin.tsx
@@ -8,19 +8,20 @@ export default function OauthLogin() {
return (
-
+
-
+
-
+
);
}
const Container = styled.div`
+ margin: 20px 0 0 0;
display: flex;
justify-content: space-evenly;
diff --git a/packages/client/src/widgets/logoAndStart/index.tsx b/packages/client/src/widgets/logoAndStart/LogoAndStart.tsx
similarity index 100%
rename from packages/client/src/widgets/logoAndStart/index.tsx
rename to packages/client/src/widgets/logoAndStart/LogoAndStart.tsx
diff --git a/packages/client/src/widgets/screen/index.tsx b/packages/client/src/widgets/screen/Screen.tsx
similarity index 87%
rename from packages/client/src/widgets/screen/index.tsx
rename to packages/client/src/widgets/screen/Screen.tsx
index 55b7b9f..203707b 100644
--- a/packages/client/src/widgets/screen/index.tsx
+++ b/packages/client/src/widgets/screen/Screen.tsx
@@ -1,5 +1,5 @@
import { Canvas } from '@react-three/fiber';
-import BackgroundStars from 'features/backgroundStars';
+import BackgroundStars from 'features/backgroundStars/BackgroundStars';
import { Galaxy } from '../galaxy';
import { EffectComposer, Bloom } from '@react-three/postprocessing';
import { Leva, useControls } from 'leva';
@@ -9,6 +9,7 @@ import { useCameraStore } from 'shared/store/useCameraStore.ts';
import { Posts } from 'entities/posts';
import styled from '@emotion/styled';
import { useViewStore } from 'shared/store';
+import { CameraLight } from './ui';
export default function Screen() {
const { view } = useViewStore();
@@ -24,7 +25,7 @@ export default function Screen() {
mipmapBlur: { value: false },
});
const { wheelSpeed } = useControls('Controls', {
- wheelSpeed: { value: 3, min: 0.1, max: 5, step: 0.01 },
+ wheelSpeed: { value: 3, min: 0.1, max: 30, step: 0.1 },
});
return (
@@ -45,11 +46,12 @@ export default function Screen() {
-
+
+
diff --git a/packages/client/src/widgets/screen/ui/CameraLight.tsx b/packages/client/src/widgets/screen/ui/CameraLight.tsx
new file mode 100644
index 0000000..759cfe0
--- /dev/null
+++ b/packages/client/src/widgets/screen/ui/CameraLight.tsx
@@ -0,0 +1,16 @@
+import { useRef } from 'react';
+import { useFrame } from '@react-three/fiber';
+import { Group, Object3DEventMap } from 'three';
+
+export default function CameraLight() {
+ const lightRef = useRef>(null!);
+
+ useFrame((state) => {
+ lightRef.current.position.copy(state.camera.position);
+ });
+ return (
+
+
+
+ );
+}
diff --git a/packages/client/src/widgets/screen/ui/index.ts b/packages/client/src/widgets/screen/ui/index.ts
new file mode 100644
index 0000000..b7d9697
--- /dev/null
+++ b/packages/client/src/widgets/screen/ui/index.ts
@@ -0,0 +1 @@
+export { default as CameraLight } from './CameraLight';
diff --git a/packages/client/src/widgets/shareModal/ShareModal.tsx b/packages/client/src/widgets/shareModal/ShareModal.tsx
new file mode 100644
index 0000000..dbfe6b7
--- /dev/null
+++ b/packages/client/src/widgets/shareModal/ShareModal.tsx
@@ -0,0 +1,74 @@
+import { Button, Modal } from 'shared/ui';
+import LinkContainer from './ui/LinkContainer';
+import SearchSetContainer from './ui/SearchSetContainer';
+import { useState, useEffect } from 'react';
+import { getSignInInfo } from 'shared/apis';
+import { SearchStatusType } from './lib/types';
+import { useToastStore, useViewStore } from 'shared/store';
+import { useNavigate } from 'react-router-dom';
+import { patchShareStatus } from 'shared/apis/share';
+
+export default function ShareModal() {
+ const [originalSearchStatus, setOriginalSearchStatus] =
+ useState('default');
+ const [newSearchStatus, setNewSearchStatus] =
+ useState('default');
+
+ const { setText } = useToastStore();
+ const { setView } = useViewStore();
+
+ const navigate = useNavigate();
+
+ useEffect(() => {
+ (async () => {
+ const userData = await getSignInInfo();
+
+ setOriginalSearchStatus(userData.status);
+ setNewSearchStatus(userData.status);
+ })();
+ }, []);
+
+ const handleSaveButton = async () => {
+ if (newSearchStatus === 'default') return;
+
+ if (originalSearchStatus !== newSearchStatus) {
+ await patchShareStatus(newSearchStatus);
+ }
+
+ setText('공유 설정이 변경되었습니다.');
+ setView('MAIN');
+ navigate('/home');
+ };
+
+ const handleGoBackButton = () => {
+ setNewSearchStatus(originalSearchStatus);
+ setView('MAIN');
+ navigate('/home');
+ };
+
+ const rightButton = (
+
+ );
+
+ return (
+
+
+
+
+ );
+}
diff --git a/packages/client/src/widgets/shareModal/lib/types.ts b/packages/client/src/widgets/shareModal/lib/types.ts
new file mode 100644
index 0000000..3d18ba3
--- /dev/null
+++ b/packages/client/src/widgets/shareModal/lib/types.ts
@@ -0,0 +1 @@
+export type SearchStatusType = 'private' | 'public' | 'default';
diff --git a/packages/client/src/widgets/shareModal/ui/LinkContainer.tsx b/packages/client/src/widgets/shareModal/ui/LinkContainer.tsx
new file mode 100644
index 0000000..c997c86
--- /dev/null
+++ b/packages/client/src/widgets/shareModal/ui/LinkContainer.tsx
@@ -0,0 +1,55 @@
+import styled from '@emotion/styled';
+import { useToastStore } from 'shared/store';
+import { Button, Input } from 'shared/ui';
+import { useState, useEffect } from 'react';
+import { getShareLink } from 'shared/apis/share';
+import Cookies from 'js-cookie';
+
+export default function LinkContainer() {
+ const [shareLink, setShareLink] = useState('');
+
+ const { setText } = useToastStore();
+
+ useEffect(() => {
+ const nickName = Cookies.get('nickname') as string;
+
+ (async () => {
+ const shareLinkData = await getShareLink(nickName);
+ setShareLink(
+ 'https://www.xn--bj0b03z.site/' + 'guest/' + shareLinkData.link,
+ );
+ })();
+ }, []);
+
+ const copyToClipboard = () => {
+ navigator.clipboard.writeText(shareLink);
+ setText('링크가 복사되었습니다.');
+ };
+
+ return (
+
+
+ 링크 복사
+
+
+
+ );
+}
+
+const Layout = styled.div`
+ display: flex;
+ align-items: center;
+ gap: 8px;
+`;
+
+const CopyButton = styled(Button)`
+ white-space: nowrap;
+ height: 43px;
+`;
diff --git a/packages/client/src/widgets/shareModal/ui/SearchSetContainer.tsx b/packages/client/src/widgets/shareModal/ui/SearchSetContainer.tsx
new file mode 100644
index 0000000..192d828
--- /dev/null
+++ b/packages/client/src/widgets/shareModal/ui/SearchSetContainer.tsx
@@ -0,0 +1,80 @@
+import styled from '@emotion/styled';
+import { Body02ME, Body03ME } from 'shared/ui/styles';
+import checkIcon from '@icons/icon-check-purple.svg';
+import { SearchStatusType } from '../lib/types';
+
+interface PropsTypes {
+ searchStatus: SearchStatusType;
+ setSearchStatus: React.Dispatch>;
+}
+
+export default function SearchSetContainer({
+ searchStatus,
+ setSearchStatus,
+}: PropsTypes) {
+ const handleCheckBox = () => {
+ if (searchStatus === 'public') return setSearchStatus('private');
+ return setSearchStatus('public');
+ };
+
+ const getIsSearchable = () => {
+ if (searchStatus === 'public') return true;
+ return false;
+ };
+
+ return (
+
+ 검색 허용
+
+
+ {getIsSearchable()
+ ? '다른 사람이 내 은하를 검색할 수 있습니다.'
+ : '다른 사람이 내 은하를 검색할 수 없습니다.'}
+
+
+ );
+}
+
+const Layout = styled.div`
+ display: flex;
+ align-items: center;
+ margin: 0 0 24px 0;
+`;
+
+const SearchSetLabel = styled.label`
+ font-size: 16px;
+ color: ${({ theme: { colors } }) => colors.text.primary};
+ padding: 0 8px;
+ margin: 0 12px 0 0;
+ ${Body03ME}
+`;
+
+const SearchSetDescription = styled.p`
+ font-size: 14px;
+ color: ${({ theme: { colors } }) => colors.text.secondary};
+ margin: 0 0 0 10px;
+ ${Body02ME}
+`;
+
+const SearchSetCheckBox = styled.input`
+ width: 23px;
+ height: 23px;
+ cursor: pointer;
+ border-radius: 5px;
+ background-color: white;
+ appearance: none;
+ -webkit-appearance: none;
+ -moz-appearance: none;
+
+ &:checked {
+ appearance: none;
+ background-image: url(${checkIcon});
+ background-size: 18px;
+ background-repeat: no-repeat;
+ background-position: center;
+ }
+`;
diff --git a/packages/client/src/widgets/starCustomModal/StarCustomModal.tsx b/packages/client/src/widgets/starCustomModal/StarCustomModal.tsx
index 31d2345..831f3f3 100644
--- a/packages/client/src/widgets/starCustomModal/StarCustomModal.tsx
+++ b/packages/client/src/widgets/starCustomModal/StarCustomModal.tsx
@@ -18,6 +18,7 @@ import SizeSlider from './ui/SizeSlider';
import BrightnessSlider from './ui/BrightnessSlider';
import { getRandomFloat } from '@utils/random';
import { ARMS_X_DIST } from 'widgets/galaxy/lib/constants';
+import { shapeTypes } from '@constants';
export default function StarCustomModal() {
const { setView } = useViewStore();
@@ -38,7 +39,7 @@ export default function StarCustomModal() {
const handleSubmit = async () => {
const starData = {
- shape,
+ shape: shapeTypes[shape],
color,
size,
brightness,
@@ -59,7 +60,7 @@ export default function StarCustomModal() {
}
const res = await sendPost(formData);
- if (res?.status === 200) {
+ if (res?.status === 201) {
setText('별을 생성했습니다.');
setView('MAIN');
navigate('/home');
diff --git a/packages/client/src/widgets/starCustomModal/ui/SampleScreen.tsx b/packages/client/src/widgets/starCustomModal/ui/SampleScreen.tsx
index f6f0c75..0980781 100644
--- a/packages/client/src/widgets/starCustomModal/ui/SampleScreen.tsx
+++ b/packages/client/src/widgets/starCustomModal/ui/SampleScreen.tsx
@@ -1,12 +1,12 @@
import { Canvas } from '@react-three/fiber';
import { EffectComposer, Bloom } from '@react-three/postprocessing';
-import Star from 'features/star';
import * as THREE from 'three';
import { OrbitControls } from '@react-three/drei';
import { shapeTypes } from '@constants';
import leftArrowIcon from '@icons/icon-arrow-left-32-white.svg';
import rightArrowIcon from '@icons/icon-arrow-right-32-white.svg';
import styled from '@emotion/styled';
+import Star from 'features/star/Star';
interface PropsType {
shape: number;
diff --git a/packages/client/src/shared/ui/underBar/UnderBar.tsx b/packages/client/src/widgets/underBar/UnderBar.tsx
similarity index 85%
rename from packages/client/src/shared/ui/underBar/UnderBar.tsx
rename to packages/client/src/widgets/underBar/UnderBar.tsx
index 1a6139b..14310aa 100644
--- a/packages/client/src/shared/ui/underBar/UnderBar.tsx
+++ b/packages/client/src/widgets/underBar/UnderBar.tsx
@@ -1,6 +1,6 @@
import styled from '@emotion/styled';
import { Button } from 'shared/ui';
-import { Title01 } from '../styles';
+import { Title01 } from '../../shared/ui/styles';
import PlanetEditIcon from '@icons/icon-planetedit-24-white.svg';
import PlanetEditIconGray from '@icons/icon-planetedit-24-gray.svg';
import AddIcon from '@icons/icon-add-24-white.svg';
@@ -34,6 +34,21 @@ export default function UnderBar({ nickname }: PropsType) {
navigate('/');
};
+ const handleShareButton = () => {
+ setView('SHARE');
+ navigate('/home/share');
+ };
+
+ const handleWritingButton = () => {
+ setView('WRITING');
+ navigate('/home/writing');
+ };
+
+ const handleGalaxyCustomButton = () => {
+ setView('CUSTOM');
+ navigate('/home/galaxy-custom');
+ };
+
return (
{isMyPage ? nickname : pageOwnerNickName}님의 은하
@@ -44,7 +59,12 @@ export default function UnderBar({ nickname }: PropsType) {
로그아웃
-