Skip to content

Commit ad47bc1

Browse files
committed
Updates
1 parent 134d6d0 commit ad47bc1

37 files changed

+2353
-2221
lines changed

CNAME

Lines changed: 0 additions & 1 deletion
This file was deleted.

assets/AddTaskModal-fGec3Mzu.js

Lines changed: 0 additions & 485 deletions
This file was deleted.

assets/AddTaskModal-nnvXEMH9.js

Lines changed: 485 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/AskPage-CDeNED6x.js renamed to assets/AskPage-Dtmg8DdZ.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
import{a as D,t as M,r as B,j as e,d as t}from"./index-HSlvYZEY.js";import{B as I}from"./blueButton-CEU8-eJw.js";import{u as P,a as E,C as _}from"./useGetInfiniteData-CpjWvf4I.js";import{t as S}from"./Task-C-RTHX55.js";import{C as g}from"./skeleton-B5_-emf1.js";import"./useBaseQuery-Dcs-aCZV.js";const z=t.div`
2+
display: flex;
3+
flex-direction: column;
4+
height: 90%;
5+
width: 90%;
6+
margin-left: 79px;
7+
margin-top: 70px;
8+
gap: 20px;
9+
`,A=t.img`
10+
width: 30px;
11+
height: 30px;
12+
`,F=t.div`
13+
background-color: ${({background:o})=>o};
14+
box-shadow: 0px 3px 10px rgba(0, 0, 0, 0.25);
15+
border-radius: 20px;
16+
width: 100%;
17+
height: 100%;
18+
padding: 34.5px 109px 30.5px 37px;
19+
`,N=t.div`
20+
display: flex;
21+
align-items: center;
22+
gap: 20px;
23+
margin-bottom: 20px;
24+
`,V=t.div`
25+
background-color: white;
26+
border-radius: 20px;
27+
width: 100%;
28+
padding: 20px;
29+
box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.1);
30+
margin-bottom: 1px;
31+
`,W=t.div`
32+
display: flex;
33+
justify-content: space-between;
34+
align-items: center;
35+
padding: 10px 0;
36+
`,G=t.div`
37+
display: flex;
38+
width: 100%;
39+
justify-content: space-between;
40+
align-items: center;
41+
`,L=t.div`
42+
font-weight: bold;
43+
font-size: 28px;
44+
font-family: Pretendard, sans-serif;
45+
`,r=t.div`
46+
color: black;
47+
font-size: 19px;
48+
font-family: Pretendard, sans-serif;
49+
font-weight: 500;
50+
line-height: 26.6px;
51+
word-wrap: break-word;
52+
text-align: left;
53+
54+
&:nth-child(1) {
55+
flex-basis: 10%;
56+
text-align: center;
57+
}
58+
&:nth-child(2) {
59+
flex-basis: 5%;
60+
text-align: center;
61+
}
62+
&:nth-child(3) {
63+
flex-basis: 70%;
64+
text-align: left;
65+
overflow: hidden;
66+
text-overflow: ellipsis;
67+
white-space: nowrap;
68+
}
69+
`,R=t.div`
70+
width: 100%;
71+
text-align: right;
72+
color: ${({isEarly:o})=>o?"#4CAF50":"#EB8A8A"};
73+
font-size: 19px;
74+
font-weight: 500;
75+
margin-top: 5px;
76+
`,q=t.div`
77+
width: 100vw;
78+
height: 50px;
79+
margin-top: 50px;
80+
display: flex;
81+
justify-content: center;
82+
align-items: flex-end;
83+
`,Y=()=>{var x;const{selectedTheme:o}=D(),m=M[o][1],{data:a,isPending:u,isFetching:n,hasNextPage:c,fetchNextPage:l}=P("/api/assignment/complete",5),{ref:w,inView:d}=E({threshold:0});return B.useEffect(()=>{d&&c&&!n&&l()},[d,c,n,l]),u?e.jsx(g,{count:5}):e.jsxs(z,{children:[e.jsxs(N,{children:[e.jsx(A,{src:S,alt:"Task Icon"}),e.jsx(L,{children:"완료한 과제"})]}),e.jsxs(F,{background:m,children:[(x=a==null?void 0:a.pages)==null?void 0:x.flatMap(b=>b.content.map(s=>{console.log("과제 데이터:",s);const j=new Date(`${s.due_date} ${s.due_time}`),k=new Date(s.completion_time),p=j.getTime()-k.getTime(),h=p>0,i=Math.abs(p)/1e3,T=Math.floor(i/86400),y=Math.floor(i%86400/3600),v=Math.floor(i%3600/60),$=Math.floor(i%60),f=`${T}${y}시간 ${v}${$}초`,C=`과제 제출이 ${h?`${f} 빨랐습니다`:`${f} 늦었습니다`}`;return e.jsxs(V,{children:[e.jsxs(W,{children:[e.jsxs(G,{children:[e.jsx(r,{children:s.due_date||"미정"}),e.jsx(r,{children:s.due_time||"미정"}),e.jsx(r,{children:s.title||"과제 없음"})]}),e.jsx(I,{status:"완료",children:"완료"})]}),e.jsx(R,{isEarly:h,children:C})]},s.completionTime)})),n&&e.jsx(g,{count:5}),e.jsx(q,{ref:w,children:n&&e.jsx(_,{color:"black"})})]})]})};export{Y as default};

assets/CompletedTasksPage-Ck9mNnJx.js

Lines changed: 0 additions & 83 deletions
This file was deleted.

assets/DetailPage-Ba1ngJQ0.js renamed to assets/DetailPage-CKAIbyKN.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/Fakelogin-BEl-Vy47.js renamed to assets/Fakelogin-LsbObrOo.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import{r as c,u as m,g as b,j as o,d as t,S as j}from"./index-CFPyf70Z.js";const w=t.div`
1+
import{r as c,u as m,g as b,j as o,d as t,S as j}from"./index-HSlvYZEY.js";const w=t.div`
22
display: flex;
33
flex-direction: column;
44
align-items: center;

assets/HistoryPage-6zcJtc9l.js

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
import{g as E,u as I,S as u,e as T,a as g,t as h,b as B,c as F,r as C,j as e,d as n}from"./index-HSlvYZEY.js";import{B as w}from"./blueButton-CEU8-eJw.js";import{b as S,a as A,C as M,u as N}from"./useGetInfiniteData-CpjWvf4I.js";import{a as q,A as D}from"./AddTaskModal-nnvXEMH9.js";import{r as R}from"./commuApi-TAvZ0IbL.js";import{b as H,H as P}from"./skeleton-B5_-emf1.js";import{F as z}from"./friendNewsRender-Nw540kIV.js";import{u as V}from"./useDebounce-DGMoi5Um.js";import"./useBaseQuery-Dcs-aCZV.js";function K(t,x=10){const{token:a}=E(),c=I();return S({queryFn:async({pageParam:o=1})=>{var r;if(!a){u.fire({icon:"info",text:"로그인이 필요합니다",showConfirmButton:!1,timer:2e3}).then(()=>{c("/")});return}try{const{data:s}=await T.get(`${t}?page=${o}&size=${x}`);return s}catch(s){if(s.response){const d=((r=s.response.data)==null?void 0:r.error)||`API 오류: ${s.response.status}`;console.error("API 실패 메시지:",d),u.fire({icon:"error",text:d,showConfirmButton:!1,timer:2e3})}else if(s instanceof Error){const d=s.message||"Network/API Error";console.error("네트워크 오류:",d),u.fire({icon:"error",title:"네트워크 오류",text:d,showConfirmButton:!1,timer:2e3})}else console.error("예상치 못한 오류:",s),u.fire({icon:"error",title:"오류",text:"예상치 못한 오류가 발생했습니다.",showConfirmButton:!1,timer:2e3});return[]}},queryKey:[t,x],initialPageParam:1,getNextPageParam:o=>{var r;if(!(!o||o.last))return(((r=o.pageable)==null?void 0:r.pageNumber)??0)+2}})}const Q=n.div`
2+
padding: 34.5px 109px 67.5px 37px;
3+
background: ${({background:t})=>t};
4+
box-shadow: 0px 3px 10px rgba(0, 0, 0, 0.25);
5+
border-radius: 20px;
6+
width: calc(100% - 146px);
7+
display: flex;
8+
flex-direction: column;
9+
height: 100%;
10+
`,G=n.div`
11+
background-color: white;
12+
border-radius: 20px;
13+
padding: 20px;
14+
padding-left: 30px;
15+
padding-right: 30px;
16+
box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.1);
17+
margin-bottom: 1px;
18+
margin-top: 1px;
19+
display: flex;
20+
justify-content: space-between;
21+
align-items: center;
22+
`,L=n.div`
23+
display: flex;
24+
gap: 100px;
25+
font-size: 18px;
26+
font-family: Pretendard, sans-serif;
27+
font-weight: 500;
28+
color: black;
29+
`,k=n.div`
30+
min-width: 100px;
31+
text-align: center;
32+
`,J=n.div`
33+
width: 100vw;
34+
height: 50px;
35+
margin-top: 50px;
36+
display: flex;
37+
justify-content: center;
38+
align-items: flex-end;
39+
`,O=()=>{var j;const{selectedTheme:t}=g(),a=h[t][1],{data:c,isPending:f,isFetching:o,hasNextPage:r,fetchNextPage:s}=K("/api/activity",5),{ref:d,inView:m}=A({threshold:0}),{openModal:y}=B(),b=F(),l=q({mutationFn:({requestId:p,isAccepted:i})=>R({requestId:p,isAccepted:i}),onSuccess:()=>{b.invalidateQueries({queryKey:["/api/activity/friend"]}),u.fire({icon:"success",text:"친구 요청을 수락했습니다",timer:2e3,showConfirmButton:!1})},onError:p=>{u.fire({icon:"error",text:"친구 수락에 실패했습니다.",timer:2e3,showConfirmButton:!1}),console.error(p)}});return C.useEffect(()=>{m&&r&&!o&&s()},[m,r,o,s]),f?e.jsx(H,{count:5}):e.jsxs(e.Fragment,{children:[e.jsxs(Q,{background:a,children:[(j=c==null?void 0:c.pages)==null?void 0:j.flatMap(p=>p.content.map(i=>e.jsxs(G,{children:[e.jsxs(L,{children:[e.jsx(k,{children:i.date}),e.jsx(k,{children:i.time}),e.jsx(k,{children:i.content})]}),i.type==="과제 추가"||i.type==="과제 공유"?i.isRegistered?e.jsx(w,{status:"등록됨",children:"등록됨"}):e.jsx(w,{onClick:()=>y(e.jsx(D,{assId:i.assId,onTaskAdded:()=>console.log("과제가 추가되었습니다.")})),children:"내 일정에 등록"}):i.type==="친구 요청"?i.check==="CHECK"?e.jsx(w,{status:"등록됨",children:"수락됨"}):e.jsx(w,{onClick:()=>l.mutate({requestId:i.friendRequestId,isAccepted:!0}),children:"수락"}):null," "]},i.createdAt))),o&&e.jsx(H,{count:5})]}),e.jsx(J,{ref:d,children:o&&e.jsx(M,{color:"black"})})]})},U=n.div`
40+
padding: 34.5px 109px 67.5px 37px;
41+
background: ${({background:t})=>t};
42+
box-shadow: 0px 3px 10px rgba(0, 0, 0, 0.25);
43+
border-radius: 20px;
44+
width: calc(100% - 146px);
45+
display: flex;
46+
flex-direction: column;
47+
height: 100%;
48+
`,W=()=>{const{selectedTheme:t}=g(),a=h[t][1];return e.jsxs(U,{background:a,children:[e.jsx(z,{})," "]})},$=n.div`
49+
padding: 34.5px 109px 67.5px 37px;
50+
background: ${({background:t})=>t};
51+
box-shadow: 0px 3px 10px rgba(0, 0, 0, 0.25);
52+
border-radius: 20px;
53+
width: calc(100% - 146px);
54+
display: flex;
55+
flex-direction: column;
56+
height: 100%;
57+
`,X=n.div`
58+
background-color: white;
59+
border-radius: 20px;
60+
padding: 20px;
61+
padding-left: 30px;
62+
padding-right: 30px;
63+
box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.1);
64+
margin-bottom: 1px;
65+
margin-top: 1px;
66+
display: flex;
67+
justify-content: space-between;
68+
align-items: center;
69+
`,Y=n.div`
70+
display: flex;
71+
gap: 100px;
72+
font-size: 18px;
73+
font-family: Pretendard, sans-serif;
74+
font-weight: 500;
75+
color: black;
76+
`,v=n.div`
77+
min-width: 100px;
78+
text-align: center;
79+
`,Z=n.div`
80+
width: 100vw;
81+
height: 50px;
82+
margin-top: 50px;
83+
display: flex;
84+
justify-content: center;
85+
align-items: flex-end;
86+
`,_=n.div`
87+
text-align: center;
88+
font-size: 18px;
89+
font-family: Pretendard, sans-serif;
90+
font-weight: 500;
91+
color: gray;
92+
margin-top: 20px;
93+
`,ee=()=>{const{selectedTheme:t}=g(),a=h[t][1],{data:c,isPending:f,isFetching:o,hasNextPage:r,fetchNextPage:s}=N("/api/activity/assignment/notify",5),{ref:d,inView:m}=A({threshold:0}),y=V(m,300);C.useEffect(()=>{y&&r&&!o&&s()},[y,r,o,s]);const b=C.useMemo(()=>{var l;return((l=c==null?void 0:c.pages)==null?void 0:l.flatMap(j=>j.content.filter(p=>p.type==="과제 시간 알림")))||[]},[c]);return f?e.jsx($,{background:a,children:e.jsx(P,{count:3})}):e.jsxs(e.Fragment,{children:[e.jsxs($,{background:a,children:[b.length===0?e.jsx(_,{children:"과제 알림 항목이 없습니다."}):b.map(l=>e.jsx(X,{children:e.jsxs(Y,{children:[e.jsx(v,{children:l.date}),e.jsx(v,{children:l.time}),e.jsx(v,{children:l.content})]})},l.createdAt)),o&&e.jsx(P,{count:3})]}),e.jsx(Z,{ref:d,children:o&&e.jsx(M,{color:"black"})})]})},te=n.div`
94+
padding: 34.5px 109px 67.5px 37px;
95+
background: ${({background:t})=>t};
96+
box-shadow: 0px 3px 10px rgba(0, 0, 0, 0.25);
97+
border-radius: 20px;
98+
width: calc(100% - 146px);
99+
display: flex;
100+
flex-direction: column;
101+
height: 100%;
102+
align-items: center;
103+
justify-content: flex-start;
104+
position: relative;
105+
`,ne=n.div`
106+
align-self: center;
107+
text-align: center;
108+
font-size: 18px;
109+
font-family: Pretendard, sans-serif;
110+
font-weight: 500;
111+
color: gray;
112+
margin-top: 20px;
113+
`,oe=()=>{const{selectedTheme:t}=g(),a=h[t][1];return e.jsx(te,{background:a,children:e.jsx(ne,{children:"기타 항목이 없습니다."})})},re=n.div`
114+
width: 100%;
115+
height: 100%;
116+
display: flex;
117+
flex-direction: column;
118+
justify-content: flex-start;
119+
align-items: flex-start;
120+
gap: 30px;
121+
margin-top: 70px;
122+
margin-left: 79px;
123+
`,se=n.div`
124+
font-size: 28px;
125+
font-family: Pretendard, sans-serif;
126+
font-weight: 700;
127+
color: black;
128+
`,ie=n.div`
129+
display: flex;
130+
gap: 10px;
131+
`,ae=n.button`
132+
height: 38px;
133+
width: 135px;
134+
padding: 8px 8px;
135+
background-color: ${t=>t.active?t.background:"#E8E8E8"};
136+
border-radius: 50px;
137+
border: none;
138+
color: ${t=>t.active?"white":"#666666"};
139+
font-size: 16px;
140+
font-family: Pretendard, sans-serif;
141+
font-weight: 500;
142+
cursor: pointer;
143+
&:hover {
144+
background-color: ${({background:t})=>t};
145+
color: white;
146+
}
147+
`,me=()=>{const[t,x]=C.useState("전체"),{selectedTheme:a}=g(),f=h[a][0],o=()=>{switch(t){case"친구소식":return e.jsx(W,{});case"과제알림":return e.jsx(ee,{});case"기타":return e.jsx(oe,{});default:return e.jsx(O,{})}};return e.jsxs(re,{children:[e.jsx(se,{children:"히스토리"}),e.jsx(ie,{children:["전체","친구소식","과제알림","기타"].map(r=>e.jsx(ae,{background:f,active:t===r,onClick:()=>x(r),children:r},r))}),o()]})};export{me as default};

0 commit comments

Comments
 (0)