Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const FormError = styled.p`
font-size: 1rem;
color: ${({ theme }) => theme.color.red};
position: absolute;
top: 100%;
left: 0;
top: 115%;
left: 5px;
white-space: nowrap;
`;
2 changes: 1 addition & 1 deletion src/components/common/header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function Header() {

return (
<S.HeaderContainer>
<Link to={ROUTES.home}>
<Link to={ROUTES.main}>
<img src={Mainlogo} alt='logo' />
</Link>
<nav className='auth'>
Expand Down
34 changes: 0 additions & 34 deletions src/components/common/page/notFoundPage/NotFoundPage.styled.ts

This file was deleted.

17 changes: 0 additions & 17 deletions src/components/common/page/notFoundPage/NotFoundPage.tsx

This file was deleted.

21 changes: 21 additions & 0 deletions src/components/mypage/myProfile/NoMyInfo.styled.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import styled from 'styled-components';

export const Container = styled.div`
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;

svg {
width: 40px;
height: 40px;
color: #ccc;
}

span {
font-size: 1.1rem;
color: $ccc;
margin-top: 1rem;
}
`;
13 changes: 13 additions & 0 deletions src/components/mypage/myProfile/NoMyInfo.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import * as S from './NoMyInfo.styled';
import { IdentificationIcon } from '@heroicons/react/24/outline';

const NoMyInfo = () => {
return (
<S.Container>
<IdentificationIcon />
<span>유저 정보를 불러올 수 없습니다.</span>
</S.Container>
);
};

export default NoMyInfo;
3 changes: 2 additions & 1 deletion src/components/mypage/myProfile/myProfile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import TextareaAutosize from 'react-textarea-autosize';
import Modal from '../../common/modal/Modal';
import { useModal } from '../../../hooks/useModal';
import Spinner from '../Spinner';
import NoMyInfo from './NoMyInfo';

const profileSchema = z.object({
nickname: z
Expand Down Expand Up @@ -147,7 +148,7 @@ const MyProfile = () => {
}

if (!myData) {
return <div>유저 정보를 불러 올 수 없습니다.</div>;
return <NoMyInfo />;
}

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export const InputInfoStyle = styled.input<{ type?: string }>`
height: 15px;
cursor: pointer;
padding-left: 10px;
margin-left: 10px;
margin-left: 5px;
`;
}
}}
Expand All @@ -77,7 +77,7 @@ export const FormError = styled.p`
font-size: 1rem;
color: ${({ theme }) => theme.color.red};
position: absolute;
top: 100%;
left: 0;
top: 115%;
left: 5px;
white-space: nowrap;
`;
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import styled from 'styled-components';
export const InfoRow = styled.div`
align-items: center;
gap: 10px;
margin-bottom: 17px;
margin-bottom: 1.8rem;
display: flex;

label {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ export const CategoryContainer = styled.div`
display: flex;
flex-wrap: wrap;
gap: 5px;
margin-top: 5px;
margin-top: -20px;
padding: 3px 0;
background-color: ${({ theme }) => theme.color.white};
border-radius: ${({ theme }) => theme.borderRadius.primary};
margin-bottom: 3px;
margin-bottom: 20px;
`;

export const CategoryItem = styled.div<{ isSelected: boolean }>`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ export const CategoryContainer = styled.div`
display: flex;
flex-wrap: wrap;
gap: 5px;
margin-top: 5px;
margin-top: -20px;
padding: 3px 0;
background-color: ${({ theme }) => theme.color.white};
border-radius: ${({ theme }) => theme.borderRadius.primary};
margin-bottom: 3px;
margin-bottom: 15px;
`;

export const PositionButtonFeat = styled(PositionButton)<{
Expand Down Expand Up @@ -44,7 +44,8 @@ export const PositionButtonFeat = styled(PositionButton)<{
`;

export const FormError = styled.p`
margin-top: 1px;
margin-top: -15px;
margin-bottom: 20px;
font-size: 0.9rem;
color: ${({ theme }) => theme.color.red};
top: 100%;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,19 @@ export const SectionInput = styled.div`

export const InfoRow = styled.div`
display: flex;
align-items: flex-start;
margin-bottom: 20px;
align-items: center;
margin-bottom: 1rem;

img {
width: 40px;
height: 40px;
width: 30px;
height: 30px;
border: 1px solid ${({ theme }) => theme.color.border};
border-radius: ${({ theme }) => theme.borderRadius.primary};
margin-bottom: 5px;
margin-right: 10px;
}

@media (max-width: 1024px) {
align-items: flex-start;
margin-bottom: 15px;
}
`;
Expand Down Expand Up @@ -113,7 +112,7 @@ export const BeginnerIcon = styled.img`
border-radius: 50%;
border: 1px solid ${({ theme }) => theme.color.border};
background-color: #fff;
padding: 5px;
padding: 3px;
object-fit: contain;
margin-bottom: 15px;

Expand All @@ -127,8 +126,7 @@ export const BeginnerIcon = styled.img`
export const BeginnerText = styled.p`
font-size: 1rem;
font-weight: bold;
color: #000;
color: #3e5879;
flex: 0.8;
text-align: left;
margin-top: 20px;
`;
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ const ProjectInformation = ({ data }: ProjectInformationProps) => {
<S.SectionInput>
<S.InfoRow>
{data.isBeginner && <S.BeginnerIcon src={beginner} alt='초보자 환영' />}
{data.isBeginner && <S.BeginnerText>초보 환영</S.BeginnerText>}
{data.isBeginner && (
<S.BeginnerText>새싹 멤버(초보)도 환영해요!</S.BeginnerText>
)}
</S.InfoRow>

{PROJECT_DATA_GET.map((input, index) => (
Expand Down Expand Up @@ -46,7 +48,7 @@ const ProjectInformation = ({ data }: ProjectInformationProps) => {
<S.InfoLabel>사용 언어</S.InfoLabel>
<S.SkillTagContainer>
{data.ProjectSkillTag.map((skillTag) => (
<S.SkillTagImage>
<S.SkillTagImage key={skillTag.SkillTag.id}>
<img
key={skillTag.SkillTag.id}
src={skillTag.SkillTag.img}
Expand Down
22 changes: 15 additions & 7 deletions src/hooks/useAuth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ export const useAuth = (handleModalOpen: (message: string) => void) => {
},
onSuccess: () => {
handleModalOpen(MODAL_MESSAGE.signUpSuccess);
navigate(ROUTES.login);
setTimeout(() => {
navigate(ROUTES.login);
}, 1000);
},
onError: () => {
handleModalOpen(MODAL_MESSAGE.signUpFail);
Expand All @@ -41,9 +43,11 @@ export const useAuth = (handleModalOpen: (message: string) => void) => {
mutationFn: async ({ email, newPassword }) => {
await postResetPassword({ email, newPassword });
},
onSuccess: () => {
onSuccess: async () => {
handleModalOpen(MODAL_MESSAGE.changePasswordSuccess);
navigate(ROUTES.login);
setTimeout(() => {
navigate(ROUTES.login);
}, 1000);
},
onError: () => {
handleModalOpen(MODAL_MESSAGE.changePasswordFail);
Expand All @@ -61,11 +65,13 @@ export const useAuth = (handleModalOpen: (message: string) => void) => {
const userData = response.user;
return { accessToken, refreshToken, userData };
},
onSuccess: (data) => {
onSuccess: async (data) => {
const { accessToken, refreshToken, userData } = data;
handleModalOpen(MODAL_MESSAGE.loginSuccess);
storeLogin(accessToken, refreshToken, userData);
navigate(ROUTES.home);
setTimeout(() => {
storeLogin(accessToken, refreshToken, userData);
navigate(ROUTES.main);
}, 1000);
},
onError: () => {
handleModalOpen(MODAL_MESSAGE.loginFail);
Expand All @@ -92,7 +98,9 @@ export const useAuth = (handleModalOpen: (message: string) => void) => {
storeLogout();
queryClient.removeQueries({ queryKey: myInfoKey.myProfile });
handleModalOpen(MODAL_MESSAGE.logout);
navigate(ROUTES.home);
setTimeout(() => {
navigate(ROUTES.main);
}, 1000);
};

return { userSignup, resetPassword, userLogin, userLogout };
Expand Down
1 change: 1 addition & 0 deletions src/pages/apply/Apply.styled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export const Section = styled.div`
display: flex;
flex-direction: column;
gap: 8px;
margin-bottom: 1.5rem;
`;

export const Label = styled.label`
Expand Down
2 changes: 1 addition & 1 deletion src/pages/changePassword/ChangePassword.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ const ChangePassword = () => {
return (
<S.Container>
<h1 className='logo'>
<Link to={ROUTES.home}>
<Link to={ROUTES.main}>
<img src={Mainlogo} alt='logo' />
</Link>
</h1>
Expand Down
3 changes: 2 additions & 1 deletion src/pages/createProject/CreateProject.styled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const SectionTitle = styled.label`
`;

export const Section = styled.div`
margin-bottom: 30px;
margin-bottom: 2.7rem;
`;

export const SectionInput = styled.div`
Expand All @@ -60,6 +60,7 @@ export const SubmitButton = styled.button`
font-weight: bold;
border-radius: ${({ theme }) => theme.borderRadius.primary};
cursor: pointer;
margin-top: 3.5rem;

&:hover {
background-color: #0056b3;
Expand Down
2 changes: 1 addition & 1 deletion src/pages/login/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const Login = () => {
return (
<S.Container>
<h1 className='logo'>
<Link to={ROUTES.home}>
<Link to={ROUTES.main}>
<img src={Mainlogo} alt='logo' />
</Link>
</h1>
Expand Down
Loading