-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #89 from chchaeun/fix/bug
사이트 버그를 수정했습니다.
- Loading branch information
Showing
163 changed files
with
5,170 additions
and
1,304 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file added
BIN
+9.05 KB
.yarn/cache/@babel-helper-function-name-npm-7.19.0-5bcf55236f-eac1f5db42.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+16.6 KB
.yarn/cache/@emotion-is-prop-valid-npm-1.2.0-332d343e3d-cc7a19850a.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+25.7 KB
.yarn/cache/@firebase-analytics-compat-npm-0.1.13-bfdc6bfb48-05893b4492.zip
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+5.11 KB
.yarn/cache/@firebase-analytics-types-npm-0.7.0-d023648814-aa118f1816.zip
Binary file not shown.
Binary file added
BIN
+23 KB
.yarn/cache/@firebase-app-check-compat-npm-0.2.12-e1de98a2eb-7e7ae94798.zip
Binary file not shown.
Binary file added
BIN
+2.64 KB
.yarn/cache/@firebase-app-check-interop-types-npm-0.1.0-b0b1f827b5-20bf685e8b.zip
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+3.76 KB
.yarn/cache/@firebase-app-check-types-npm-0.4.0-b51c976b4c-b3011d5332.zip
Binary file not shown.
Binary file added
BIN
+87.5 KB
.yarn/cache/@firebase-app-compat-npm-0.1.34-92d6a9149e-959a14358b.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+342 KB
.yarn/cache/@firebase-auth-compat-npm-0.2.20-2689534a73-68c75946d2.zip
Binary file not shown.
Binary file added
BIN
+2.34 KB
.yarn/cache/@firebase-auth-interop-types-npm-0.1.6-2557bd0647-25db353581.zip
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+4.95 KB
.yarn/cache/@firebase-auth-types-npm-0.11.0-8855a50f7e-69fa441bd8.zip
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+480 KB
.yarn/cache/@firebase-database-compat-npm-0.2.6-fd28684be5-217aa9b058.zip
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+4.65 KB
.yarn/cache/@firebase-database-types-npm-0.9.13-3aad1d4a21-7970b74cd4.zip
Binary file not shown.
Binary file added
BIN
+179 KB
.yarn/cache/@firebase-firestore-compat-npm-0.1.25-2d0fd2fcc5-8a56e16cf6.zip
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+6.07 KB
.yarn/cache/@firebase-firestore-types-npm-2.5.0-d22d548604-4125e9df39.zip
Binary file not shown.
Binary file added
BIN
+28.1 KB
.yarn/cache/@firebase-functions-compat-npm-0.2.4-f7e7d52919-d874e092ec.zip
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+3.96 KB
.yarn/cache/@firebase-functions-types-npm-0.5.0-7b57cefc3f-adf03a655f.zip
Binary file not shown.
Binary file added
BIN
+19.6 KB
.yarn/cache/@firebase-installations-compat-npm-0.1.12-d2c7b3f161-bdb5472314.zip
Binary file not shown.
Binary file added
BIN
+147 KB
.yarn/cache/@firebase-installations-npm-0.5.12-9d7712c42d-94b56cdf3d.zip
Binary file not shown.
Binary file added
BIN
+2.2 KB
.yarn/cache/@firebase-installations-types-npm-0.4.0-62636a4f28-c241937024.zip
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+24.3 KB
.yarn/cache/@firebase-messaging-compat-npm-0.1.16-0146668860-8608b3674a.zip
Binary file not shown.
Binary file added
BIN
+2.34 KB
.yarn/cache/@firebase-messaging-interop-types-npm-0.1.0-363c27d0b9-7772eeda00.zip
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+19.9 KB
.yarn/cache/@firebase-performance-compat-npm-0.1.12-d6d1f63725-c672b7be63.zip
Binary file not shown.
Binary file added
BIN
+171 KB
.yarn/cache/@firebase-performance-npm-0.5.12-aaab43b01a-c6b9058182.zip
Binary file not shown.
Binary file added
BIN
+2.78 KB
.yarn/cache/@firebase-performance-types-npm-0.1.0-4d82ea50b8-c443b2494b.zip
Binary file not shown.
Binary file added
BIN
+24.3 KB
.yarn/cache/@firebase-remote-config-compat-npm-0.1.12-c95c08bd29-578fe2327d.zip
Binary file not shown.
Binary file added
BIN
+150 KB
.yarn/cache/@firebase-remote-config-npm-0.3.11-8bed204b10-236e3bf66f.zip
Binary file not shown.
Binary file added
BIN
+3.48 KB
.yarn/cache/@firebase-remote-config-types-npm-0.2.0-87512f450f-3d0c4df9c9.zip
Binary file not shown.
Binary file added
BIN
+59.3 KB
.yarn/cache/@firebase-storage-compat-npm-0.1.17-206ebbc47b-8c5506f9cd.zip
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+3.54 KB
.yarn/cache/@firebase-storage-types-npm-0.6.0-c63d9659ce-c49de571a1.zip
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+852 KB
.yarn/cache/@firebase-webchannel-wrapper-npm-0.7.0-f337d288b2-927d744a8e.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file renamed
BIN
+14.9 MB
...-darwin-arm64-npm-12.2.2-7c98b4962a-8.zip → ...-darwin-arm64-npm-12.3.0-2b93f6942b-8.zip
Binary file not shown.
Binary file added
BIN
+4.13 KB
.yarn/cache/@protobufjs-aspromise-npm-1.1.2-71d00b938f-011fe7ef08.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+4.51 KB
.yarn/cache/@protobufjs-eventemitter-npm-1.1.0-029cc7d431-0369163a3d.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+3.09 KB
.yarn/cache/@types-hoist-non-react-statics-npm-3.3.1-c0081332b2-2c0778570d.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+8.46 KB
.yarn/cache/@types-styled-components-npm-5.1.26-aabda06611-84f53b3101.zip
Binary file not shown.
Binary file added
BIN
+18.6 KB
.yarn/cache/babel-plugin-styled-components-npm-2.0.7-543710bd48-80b06b10db.zip
Binary file not shown.
Binary file added
BIN
+1.67 KB
.yarn/cache/babel-plugin-syntax-jsx-npm-6.18.0-fcf0a98a71-0c7ce5b81d.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+13.4 KB
.yarn/cache/hoist-non-react-statics-npm-3.3.2-e7b709e6c1-b153827042.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file renamed
BIN
+6.78 MB
...next-npm-12.2.2-692dd744d3-fb8ced6fb5.zip → ...next-npm-12.3.0-ef197d93b5-eafed4732d.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+11.2 KB
.yarn/cache/react-loading-skeleton-npm-3.1.0-1d9cc9a93a-53d257c88e.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed
BIN
-19.8 KB
.yarn/cache/use-sync-external-store-npm-1.1.0-dcd59c7439-8993a0b642.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import api from "../my-api"; | ||
import { getCode } from "../session-code"; | ||
|
||
interface Props { | ||
challengeId: string; | ||
} | ||
|
||
export const fetchLikedQuizzes = async ({ challengeId }: Props) => { | ||
api.defaults.headers.common["code"] = getCode(); | ||
|
||
const { data } = await api.get(`/challenges/${challengeId}/my-good-quizzes`); | ||
return data; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import React from "react"; | ||
import styled from "styled-components"; | ||
|
||
function ChallengeMissionCompleted() { | ||
return ( | ||
<div> | ||
<Title>주차별 미션</Title> | ||
</div> | ||
); | ||
} | ||
|
||
export default ChallengeMissionCompleted; | ||
const Title = styled.h2` | ||
width: 100%; | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
import React from "react"; | ||
import styled from "styled-components"; | ||
import { classNames } from "../../../styles/classname-maker"; | ||
import { media } from "../../../styles/media"; | ||
import { OpenWeeksSelect } from "../../../types/Challenge"; | ||
interface Props { | ||
openWeeks: OpenWeeksSelect; | ||
} | ||
function OpenWeekList({ openWeeks }: Props) { | ||
return ( | ||
<Block> | ||
{openWeeks.weeks.map((week) => ( | ||
<WeekBox | ||
status={week.status} | ||
key={week.week} | ||
className={classNames( | ||
week.status === "CLOSED" || week.status === "UNREADABLE" | ||
? "bg-[#ebebeb]" | ||
: "bg-[#b2a4e5] text-white", | ||
"flex justify-center items-center w-7 h-7 rounded font-semibold cursor-default" | ||
)} | ||
> | ||
{week.week} | ||
</WeekBox> | ||
))} | ||
</Block> | ||
); | ||
} | ||
|
||
export default OpenWeekList; | ||
|
||
const Block = styled.div` | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
gap: 10px; | ||
width: 100%; | ||
${media.medium` | ||
display:grid; | ||
grid-template-columns: repeat(5, minmax(0, 1fr)); | ||
gap: 8px; | ||
`}; | ||
`; | ||
|
||
const WeekBox = styled.span<{ | ||
status: "READABLE" | "READABLE_CLOSED" | "CLOSED" | "UNREADABLE"; | ||
}>` | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
align-items: center; | ||
padding: 0px; | ||
gap: 10px; | ||
width: 42px; | ||
height: 40px; | ||
background: ${(p) => | ||
p.status === "CLOSED" | ||
? "#F3F4F6" | ||
: p.status === "UNREADABLE" | ||
? "#FEF2F2" | ||
: "#ecfdf5"}; | ||
border-radius: 8px; | ||
font-size: 16px; | ||
color: ${(p) => | ||
p.status === "CLOSED" | ||
? "#374151" | ||
: p.status === "UNREADABLE" | ||
? "#EF4444" | ||
: "#047857"}; | ||
${media.medium` | ||
width: 32px; | ||
height: 32px; | ||
border-radius: 6px; | ||
font-size: 14px; | ||
`} | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,154 @@ | ||
import Link from "next/link"; | ||
import React from "react"; | ||
import styled from "styled-components"; | ||
import useQuizzesQuery from "../../../hooks/quizzes-query"; | ||
|
||
interface Props { | ||
title: string; | ||
page: "READABLE" | "MY" | "LIKED"; | ||
week?: string; | ||
challengeId: string; | ||
} | ||
function QuizSummary({ title, page, week, challengeId }: Props) { | ||
const { data: quizzes } = useQuizzesQuery({ challengeId, page, week }); | ||
|
||
const getLinkByPage = (quizId?: number) => { | ||
const BASE_LINK = `/challenges/${challengeId}/quizzes`; | ||
switch (page) { | ||
case "READABLE": | ||
return BASE_LINK + `${quizId ? `/${quizId}` : ""}?week=${week}`; | ||
case "MY": | ||
return BASE_LINK + `${quizId ? `/${quizId}` : ""}/my`; | ||
case "LIKED": | ||
return BASE_LINK + `${quizId ? `/${quizId}` : ""}/like`; | ||
} | ||
}; | ||
|
||
const getDateFormatted = (createdDate: string) => { | ||
const date_object = new Date(createdDate); | ||
const month = date_object.toLocaleString("en-US", { month: "short" }); | ||
const date = date_object.getDate(); | ||
const year = date_object.getFullYear(); | ||
const hours = date_object.getHours(); | ||
const minutes = date_object.getMinutes(); | ||
return `${month} ${date}, ${year} ${hours}:${minutes}`; | ||
}; | ||
|
||
return ( | ||
<Container> | ||
<Title> {title}</Title> | ||
<ul> | ||
{quizzes?.slice(0, 5).map((quiz) => ( | ||
<Li key={quiz.quizId}> | ||
<Link href={getLinkByPage(quiz.quizId)}> | ||
<a>{quiz.quizTitle}</a> | ||
</Link> | ||
<div> | ||
<span>{quiz.writerName}</span> | ||
<span>{getDateFormatted(quiz.quizCreatedDate)}</span> | ||
</div> | ||
</Li> | ||
))} | ||
</ul> | ||
<Link href={getLinkByPage()}> | ||
<Button type="button">더보기</Button> | ||
</Link> | ||
</Container> | ||
); | ||
} | ||
|
||
export default QuizSummary; | ||
|
||
const Container = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
gap: 20px; | ||
padding: 20px 24px; | ||
height: 530px; | ||
background: #ffffff; | ||
box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.05); | ||
border-radius: 8px; | ||
`; | ||
|
||
const Title = styled.h2` | ||
position: relative; | ||
width: 100%; | ||
font-weight: 700; | ||
font-size: 20px; | ||
line-height: 24px; | ||
color: #111827; | ||
`; | ||
|
||
const Li = styled.li` | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
align-items: flex-start; | ||
padding: 8px 0px; | ||
gap: 8px; | ||
width: 100%; | ||
height: 79px; | ||
border-top: 1px solid #f4f4f5; | ||
a { | ||
font-weight: 600; | ||
font-size: 14px; | ||
line-height: 17px; | ||
color: #111827; | ||
&:hover { | ||
text-decoration: underline; | ||
} | ||
} | ||
div { | ||
display: flex; | ||
flex-direction: row; | ||
gap: 12px; | ||
span { | ||
font-weight: 400; | ||
font-size: 12px; | ||
line-height: 14px; | ||
&:first-child { | ||
color: #374151; | ||
} | ||
&:last-child { | ||
color: #9ca3af; | ||
} | ||
} | ||
} | ||
`; | ||
|
||
const Button = styled.button` | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: center; | ||
align-items: center; | ||
padding: 10px 24px; | ||
gap: 10px; | ||
width: 100%; | ||
height: 36px; | ||
background: #f3f4f6; | ||
border-radius: 8px; | ||
font-weight: 600; | ||
font-size: 12px; | ||
line-height: 16px; | ||
color: #4b5563; | ||
cursor: pointer; | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
import React, { useEffect, useState } from "react"; | ||
import styled from "styled-components"; | ||
import useChallengeDetailQuery from "../../../hooks/challenge-detail-query"; | ||
import { media } from "../../../styles/media"; | ||
interface Props { | ||
challengeId: string; | ||
} | ||
interface FixItem { | ||
fixItem: boolean; | ||
} | ||
|
||
function ChallengeSuccessPeople({ challengeId }: Props) { | ||
const [scrollY, setScrollY] = useState(0); | ||
const [fixItem, setFixItem] = useState(false); | ||
|
||
const { data: challengeDetail } = useChallengeDetailQuery({ challengeId }); | ||
|
||
useEffect(() => { | ||
(() => { | ||
window.addEventListener("scroll", () => setScrollY(window.pageYOffset)); | ||
if (scrollY > 150) { | ||
setFixItem(true); | ||
} else { | ||
setFixItem(false); | ||
} | ||
})(); | ||
return () => { | ||
window.removeEventListener("scroll", () => | ||
setScrollY(window.pageYOffset) | ||
); | ||
}; | ||
}); | ||
|
||
return ( | ||
<Container fixItem={fixItem}> | ||
🔥 이번주 {challengeDetail?.numberOfChallengerWhoCompleted}명 챌린지 미션 | ||
완료! | ||
</Container> | ||
); | ||
} | ||
|
||
export default ChallengeSuccessPeople; | ||
|
||
const Container = styled.div<FixItem>` | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: center; | ||
align-items: center; | ||
padding: 11px 10px; | ||
gap: 10px; | ||
position: ${(p) => (p.fixItem ? "fixed" : "relative")}; | ||
width: ${(p: FixItem) => (p.fixItem ? "100vw" : "100%")}; | ||
height: 41px; | ||
top: ${(p) => (p.fixItem ? "60px" : "0px")}; | ||
background: #000000; | ||
border-radius: ${(p: FixItem) => (p.fixItem ? "0px" : "8px")}; | ||
color: #ffffff; | ||
font-weight: 400; | ||
font-size: 16px; | ||
line-height: 19px; | ||
z-index: 10; | ||
${media.medium` | ||
width: ${(p: FixItem) => (p.fixItem ? "100vw" : "100%")}; | ||
top: ${(p: FixItem) => (p.fixItem ? "51px" : "0px")}; | ||
font-size: 14px; | ||
`}; | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import Link from "next/link"; | ||
import React from "react"; | ||
import useOpenWeeksQuery from "../../hooks/open-weeks"; | ||
interface Props { | ||
challengeId: string; | ||
} | ||
function ChallengeMenu({ challengeId }: Props) { | ||
const { data: openWeeks } = useOpenWeeksQuery(); | ||
return ( | ||
<div className="col-start-1 col-span-2 m-10 border-r-[1px] sm:w-5/6 sm:m-auto sm:border-none"> | ||
<h3 className="py-3 text-sm font-semibold text-gray-500">문제</h3> | ||
<ul className="menu bg-base-100 pr-5"> | ||
{openWeeks && ( | ||
<li> | ||
<Link | ||
href={`/challenges/${challengeId}/quizzes?week=${openWeeks?.weeks | ||
.filter((week) => week.status === "READABLE") | ||
.map((week) => week.week) | ||
.join(",")}`} | ||
> | ||
열람 가능한 문제 | ||
</Link> | ||
</li> | ||
)} | ||
<li> | ||
<Link href={`/challenges/${challengeId}/quizzes/my`} className=""> | ||
내가 낸 문제 | ||
</Link> | ||
</li> | ||
<li> | ||
<Link href={`/challenges/${challengeId}/quizzes/like`}> | ||
좋아요한 문제 | ||
</Link> | ||
</li> | ||
</ul> | ||
</div> | ||
); | ||
} | ||
|
||
export default ChallengeMenu; |
Oops, something went wrong.