Skip to content

Commit

Permalink
코드 오류 수정
Browse files Browse the repository at this point in the history
코드 오류 수정
  • Loading branch information
phyuna0525 authored Mar 30, 2024
2 parents d5ca419 + fcebeee commit f5ccf82
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 57 deletions.
2 changes: 1 addition & 1 deletion src/app/components/common/list/accept/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const AcceptList: React.FC<AcceptProps> = ({ student, time, why, onClick }) => {

return (
<div
className={`flex w-80 flex-col px-3 py-3 rounded-lg group h-13 gap-2 active:bg-primary-800 ${
className={`flex w-80 flex-col px-3 py-3 rounded-lg group h-fit gap-2 active:bg-primary-800 ${
isActive
? "bg-primary-900 h-auto"
: " bg-white hover:h-auto hover:bg-primary-900 h-13"
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/common/list/after/delete/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const AfterDelete: React.FC<AfterdeleteProps> = ({ student, id }) => {
const onDelete = async () => {
try {
await DeleteMutate(
{ id: id },
{ id },
{
onSuccess() {
alert("삭제되었습니다");
Expand Down
4 changes: 2 additions & 2 deletions src/app/components/common/list/before/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ const PreviousList: React.FC<getProp> = ({ id, userName }) => {
}, []);

return (
<div className="flex h-13">
<div className="relative h-5">
<div className="flex h-13 w-29%">
<div className="relative h-5 w-full">
<div
className="group w-77 whitespace-nowrap gap-4 py-4 px-6 rounded-lg cursor-pointer flex items-center justify-between bg-white"
onClick={toggleDropdown}
Expand Down
20 changes: 15 additions & 5 deletions src/app/components/common/list/reason/page.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"use client";
import { getToday } from "@/utils/date";

interface ReasonListProps {
Expand All @@ -13,17 +14,26 @@ const ReasonList: React.FC<ReasonListProps> = ({
why,
endTime,
}) => {
const MAX_WHY_LENGTH = 69;

let whyDisplay = why;
if (why.length > MAX_WHY_LENGTH) {
whyDisplay = why.substring(0, MAX_WHY_LENGTH) + "...";
}

return (
<div className=" flex flex-col bg-white px-5 py-5 gap-3 w-120 rounded-lg">
<div className=" flex gap-4">
<div className="flex flex-col bg-white px-5 py-5 h-fit gap-3 w-120 rounded-lg">
<div className="flex gap-4">
<div className="font-sans text-label1 text-neutral-50">{student}</div>
<div className=" text-neutral-400">
<div className="text-neutral-400">
{getToday()}{time}~{endTime}
</div>
</div>
<div className=" h-11 text-neutral-200 font-sans text-label1">{why}</div>
<div className="h-11 text-neutral-200 font-sans text-label1 text-wrap">
{whyDisplay}
</div>
</div>
);
};

export default ReasonList
export default ReasonList;
2 changes: 2 additions & 0 deletions src/app/outAccept/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,8 @@ const OutAccept = () => {
router.push("/outAccept/previous");
};

const ChangeText = () => {};

return (
<BackGround
linkChildren="외출 수락"
Expand Down
85 changes: 37 additions & 48 deletions src/app/outList/reason/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import Link from "next/link";
import { useEffect, useState } from "react";
import { AlloutList, ReturnHome } from "@/apis/outList/list";
import { getStudentString } from "@/utils/until";
import { BackGround } from "@/app/components/common/background";

interface OutListData {
id: string;
Expand Down Expand Up @@ -94,57 +95,45 @@ const Reason = () => {
}, []);

return (
<div className="h-dvh">
<Header />
<div className="flex flex-col gap-7 px-100 py-16 h-90%">
<div className="text-neutral-200 text-sub-title3-B">
<Link href="/main"></Link> &gt;
<Link href="/outList">외출자 목록</Link> &gt;
{selectedTab ? "외출자 사유" : " 조기 귀가 사유"}
</div>
<div className="flex justify-between">
<div className="flex font-sans text-heading4 text-gray-900 gap-4 items-center">
{selectedTab ? "외출자 사유" : "조기 귀가 사유"}
<div className="text-neutral-200 text-heading5">
{getFullToday()}
</div>
</div>
<div className="flex items-center">
<DoubleTab
firstChildren="외출"
secondChildren="조기귀가"
onClick={onClickTab}
<BackGround
linkChildren={`외출자 목록 > ${
selectedTab ? "외출자 사유" : " 조기 귀가 사유"
} `}
subTitle={selectedTab ? "외출자 사유" : " 조기 귀가 사유"}
secondTitle={getFullToday()}
DropChildren={
<DoubleTab
firstChildren="외출"
secondChildren="조기귀가"
onClick={onClickTab}
/>
}
>
{selectedTab ? (
<div className="flex flex-wrap gap-5 justify-between">
{data.map((item, index) => (
<ReasonList
key={index}
time={item.start_time}
endTime={item.end_time}
student={student(item)}
why={item.reason}
/>
</div>
))}
</div>
<div className="w-auto rounded-xl bg-primary-1200 h-full px-10 py-10 overflow-y-scroll scrollbar-hide">
{selectedTab ? (
<div className="flex flex-wrap gap-5 justify-between">
{data.map((item, index) => (
<ReasonList
key={index}
time={item.start_time}
endTime={item.end_time}
student={student(item)}
why={item.reason}
/>
))}
</div>
) : (
<div className="flex flex-wrap gap-5 justify-between">
{homeData.map((item, index) => (
<ReasonList
key={index}
time={item.start_time}
student={student(item)}
why={item.reason}
/>
))}
</div>
)}
) : (
<div className="flex flex-wrap gap-5 justify-between">
{homeData.map((item, index) => (
<ReasonList
key={index}
time={item.start_time}
student={student(item)}
why={item.reason}
/>
))}
</div>
</div>
</div>
)}
</BackGround>
);
};

Expand Down
1 change: 1 addition & 0 deletions tailwind.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ const config: Config = {
"30": "7.438rem",
"29": "7.25rem",
"25": "6.25rem",
"27%": "27%",
},
height: {
"140": "36.625rem",
Expand Down

0 comments on commit f5ccf82

Please sign in to comment.