Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
989e60f
Merge pull request #83 from Stack-Knowledge/release1.0.2
frorong Oct 30, 2023
424d6c9
Update hidden controller
frorong Oct 31, 2023
5d5e103
Merge pull request #84 from Stack-Knowledge/hotfix/controller
frorong Oct 31, 2023
bb351e9
Update header redirct event
TaerangLee Oct 31, 2023
0a2ac4f
Merge branch 'main' into hotfix/headerRedirect
TaerangLee Oct 31, 2023
4f1200d
Merge pull request #85 from Stack-Knowledge/hotfix/headerRedirect
TaerangLee Oct 31, 2023
dcd0f43
Update section style word-break appoint
TaerangLee Oct 31, 2023
0921f86
Update TaskCard style TaskWrapper
TaerangLee Oct 31, 2023
30d26ad
Update unit change px -> rem | MildegeUnit position fix
TaerangLee Oct 31, 2023
3c8b437
Delete unless the comment
TaerangLee Oct 31, 2023
2c61916
Update list
frorong Nov 2, 2023
bbaef36
Merge pull request #87 from Stack-Knowledge/hotfix/shopController
TaerangLee Nov 2, 2023
2798ebd
Update inputValue length judgment
TaerangLee Nov 2, 2023
0aa2c7c
Update taskCard title center aligned
TaerangLee Nov 5, 2023
22a1f48
Fix header active error conflict
TaerangLee Nov 5, 2023
ee29222
Update axiosError status appoint
TaerangLee Nov 5, 2023
53ffc7e
Update respone status check 409
TaerangLee Nov 6, 2023
07de102
Update mission title center appoint
TaerangLee Nov 6, 2023
fb65b75
Merge pull request #86 from Stack-Knowledge/hotfix/size
TaerangLee Nov 6, 2023
a901c97
Add missionDetail responsive test
Nov 19, 2023
6c23017
Update merge develop
Nov 19, 2023
1f3a8a2
Update missionDetail repsponsive
Nov 19, 2023
f4d49a2
Update breakPoint width change
Nov 19, 2023
d62e614
Update unless the comment delete, unit px -> rem
Nov 19, 2023
40c2bf0
Update media theme use
Nov 19, 2023
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
3 changes: 2 additions & 1 deletion packages/api/client/src/hooks/solve/usePostSolve.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { useMutation } from '@tanstack/react-query';

import { post, solveQueryKeys, solveUrl } from 'api/common';
import { AxiosError } from 'axios';

export const usePostSolve = (missionId: string) =>
useMutation<
void,
Error,
AxiosError,
{
solvation: string;
}
Expand Down
20 changes: 10 additions & 10 deletions packages/common/src/components/Header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,11 @@ const Header: React.FC<HeaderProps> = ({ role }) => {
<S.Title>Stack Knowledge</S.Title>
</S.LogoContainer>
<S.MenuNav role={role}>

<S.MenuStrokeItemWrapper
href='/'
isActive={getIsActive('/')}
data-isactive={getIsActive('/')}
onClick={handleLinkClick}
>

<HomeIcon />
<S.ItemTitle>홈</S.ItemTitle>
</S.MenuStrokeItemWrapper>
Expand All @@ -52,15 +50,17 @@ const Header: React.FC<HeaderProps> = ({ role }) => {
<>
<S.MenuStrokeItemWrapper
href='/mission/scoring'
isActive={getIsActive('/mission/scoring')}
data-isactive={getIsActive('/mission/scoring')}
onClick={handleLinkClick}
>
<QuestionIcon />
<S.ItemTitle>채점하기</S.ItemTitle>
</S.MenuStrokeItemWrapper>

<S.MenuFillItemWrapper
href='/mission/create'
isActive={getIsActive('/mission/create')}
data-isactive={getIsActive('/mission/create')}
onClick={handleLinkClick}
>
<MadeIcon />
<S.ItemTitle>만들기</S.ItemTitle>
Expand All @@ -70,18 +70,17 @@ const Header: React.FC<HeaderProps> = ({ role }) => {
<>
<S.MenuStrokeItemWrapper
href='/mission/list'
isActive={getIsActive('/mission/list')}
data-isactive={getIsActive('/mission/list')}
onClick={handleLinkClick}
>
<QuestionIcon />
<S.ItemTitle>문제</S.ItemTitle>
</S.MenuStrokeItemWrapper>
</>
)}


<S.MenuFillItemWrapper
href='/shop'
isActive={getIsActive('/shop')}
data-isactive={getIsActive('/shop')}
onClick={handleLinkClick}
>
<ShopIcon />
Expand All @@ -90,7 +89,8 @@ const Header: React.FC<HeaderProps> = ({ role }) => {

<S.MenuFillItemWrapper
href='/ranking'
isActive={getIsActive('/ranking')}
data-isactive={getIsActive('/ranking')}
onClick={handleLinkClick}
>
<RankingIcon />
<S.ItemTitle>랭킹</S.ItemTitle>
Expand Down
12 changes: 6 additions & 6 deletions packages/common/src/components/Header/style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ export const MenuNav = styled.div`
gap: ${({ role }) => (role === 'admin' ? '1.5rem' : '2.25rem')};
`;

export const MenuStrokeItemWrapper = styled(Link)<{ isActive?: boolean }>`
${({ isActive, theme }) => {
const activeColor = isActive ? theme.color.primary : theme.color.black;
export const MenuStrokeItemWrapper = styled(Link)<{ $isActive?: boolean }>`
${({ $isActive, theme }) => {
const activeColor = $isActive ? theme.color.primary : theme.color.black;
const hoverColor = theme.color.primary;
return `
display: flex;
Expand All @@ -63,9 +63,9 @@ export const MenuStrokeItemWrapper = styled(Link)<{ isActive?: boolean }>`
}}
`;

export const MenuFillItemWrapper = styled(Link)<{ isActive?: boolean }>`
${({ isActive, theme }) => {
const activeColor = isActive ? theme.color.primary : theme.color.black;
export const MenuFillItemWrapper = styled(Link)<{ $isActive?: boolean }>`
${({ $isActive, theme }) => {
const activeColor = $isActive ? theme.color.primary : theme.color.black;
const hoverColor = theme.color.primary;
return `
display: flex;
Expand Down
9 changes: 9 additions & 0 deletions packages/common/src/components/MissionDetailInput /style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ export const SubmitContainer = styled.div`
height: 18.75rem;
border-radius: 0.625rem;
box-shadow: 0.1875rem 0.1875rem 0.25rem 0rem rgba(120, 120, 120, 0.25);

@media ${({ theme }) => theme.breakPoint[600]} {
width: calc(100vw - 16rem);
}
`;
export const MissionDetailInputWrapper = styled.div`
display: flex;
Expand All @@ -22,6 +26,11 @@ export const MissionDetailInput = styled.textarea`
resize: none;
border: 0;

@media ${({ theme }) => theme.breakPoint[600]} {
width: calc(100vw - 16rem);
text-indent: 0.5625rem;
}

::placeholder {
color: ${({ theme }) => theme.color.gray['050']};
font-weight: 500;
Expand Down
2 changes: 2 additions & 0 deletions packages/common/src/components/RankingCard/style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,13 @@ export const Point = styled.span`
color: ${({ theme }) => theme.color.black};
font-weight: 500;
margin-right: 0.25rem;
font-family: Roboto;
`;

export const PointUnit = styled.span`
${({ theme }) => theme.typo.body2};
color: ${({ theme }) => theme.color.black};
font-family: Roboto;
font-weight: 500;
`;

Expand Down
4 changes: 3 additions & 1 deletion packages/common/src/components/TaskCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ const TaskCard: React.FC<TaskCardProps> = ({
}) => (
<S.CardWrapper onClick={onClick} isShadow={isShadow}>
<S.UserName>{userName}</S.UserName>
<S.TaskTitle>{taskTitle}</S.TaskTitle>
<S.TaskWrapper>
<S.TaskTitle>{taskTitle}</S.TaskTitle>
</S.TaskWrapper>
<S.MiledgeWrapper>
<S.Mildege>{slicePoint(miledge)}</S.Mildege>
<S.MildegeUnit>M</S.MildegeUnit>
Expand Down
17 changes: 15 additions & 2 deletions packages/common/src/components/TaskCard/style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,30 +22,43 @@ export const UserName = styled.span`
margin: 2.5rem 0 2.25rem;
`;

export const TaskWrapper = styled.div`
width: 100%;
height: 6.25rem;
word-break: break-all;
display: flex;
justify-content: center;
`;

export const TaskTitle = styled.span`
${({ theme }) => theme.typo.body1};
color: ${({ theme }) => theme.color.gray['070']};
font-weight: 500;
text-align: center;
`;

export const MiledgeWrapper = styled.div`
width: 14rem;
height: auto;
display: flex;
gap: 0.25rem;
margin-top: 8rem;
margin-top: 3rem;
align-items: center;
justify-content: center;
`;

export const Mildege = styled.span`
${({ theme }) => theme.typo.button};
${({ theme }) => theme.typo.body2};
color: ${({ theme }) => theme.color.black};
font-weight: 500;
position: relative;
bottom: 2px;
`;

export const MildegeUnit = styled.span`
${({ theme }) => theme.typo.body2};
color: ${({ theme }) => theme.color.black};
font-family: Roboto;
font-weight: 500;
position: relative;
`;
17 changes: 11 additions & 6 deletions projects/admin/src/PageContainer/ShopPage/index.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
'use client';

import { useGetOrderedItemList } from 'api/admin';
import * as S from './style';

import { ShopCarousel } from 'admin/components';

const ShopPage = () => (
<S.PageWrapper>
<S.ShopText>상점</S.ShopText>
<ShopCarousel />
</S.PageWrapper>
);
const ShopPage = () => {
const { data } = useGetOrderedItemList();

return (
<S.PageWrapper>
<S.ShopText>상점</S.ShopText>
{data?.length > 0 ? <ShopCarousel /> : <h1>상품이 없습니다...</h1>}
</S.PageWrapper>
);
};

export default ShopPage;
9 changes: 7 additions & 2 deletions projects/client/src/PageContainer/MissionDetailPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const MissionDetailPage: React.FC<MissionDetailProps> = ({ missionId }) => {
});
};

const { mutate, isSuccess, isError } = usePostSolve(missionId);
const { mutate, isSuccess, isError, error } = usePostSolve(missionId);

useEffect(() => {
setMinutes(Math.floor((data?.timeLimit ?? 0) / 60));
Expand All @@ -78,7 +78,12 @@ const MissionDetailPage: React.FC<MissionDetailProps> = ({ missionId }) => {

if (isError) {
push(`/`);
toast.error('이미 푼 문제입니다.');

if (error.response.status === 400) {
toast.error('시간 제한을 초과하였습니다.');
} else if (error.response.status === 409) {
toast.error('이미 푼 문제입니다.');
}
}

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export const Section = styled.div`
margin-bottom: 1.25rem;
font-weight: 400;
max-width: 55.625rem;
word-break: break-all;
`;

export const MissionWrapper = styled.div`
Expand Down
17 changes: 11 additions & 6 deletions projects/client/src/PageContainer/MissionListPage/index.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
'use client';

import { useGetMissionList } from 'api/common';
import * as S from './style';

import { MissionCarousel } from 'client/components';

const MissionListPage = () => (
<S.PageWrapper>
<S.ScoringText>문제</S.ScoringText>
<MissionCarousel />
</S.PageWrapper>
);
const MissionListPage = () => {
const { data } = useGetMissionList();

return (
<S.PageWrapper>
<S.ScoringText>문제</S.ScoringText>
{data?.length > 0 ? <MissionCarousel /> : <h1>문제가 없습니다...</h1>}
</S.PageWrapper>
);
};

export default MissionListPage;