Skip to content

Commit

Permalink
add:: main icon
Browse files Browse the repository at this point in the history
add:: main icon
  • Loading branch information
heedda authored Apr 20, 2024
2 parents 682220e + aaf3c70 commit 2b03b3f
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 24 deletions.
1 change: 1 addition & 0 deletions src/api/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export const GetName = () => {
queryKey: ["name"],
queryFn: async () => {
const result = await instance.get("/admin/my-name");
localStorage.setItem("name", result.data);
return result.data.name;
},
});
Expand Down
8 changes: 4 additions & 4 deletions src/app/main/checkPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ const CheckPage = ({ type }: checkPageType) => {
return (
<>
{type === "outGoing" ? (
<div className=" rounded-xl w-full h-62 bg-white flex flex-col items-center gap-3">
<div className=" text-neutral-50 text-sub-title4-M text-center px-4 pt-6">
<div className=" rounded-xl w-full h-62 bg-white flex flex-col items-center gap-3 py-6">
<div className=" text-neutral-50 text-sub-title4-M text-center px-3">
현재 외출 중인 학생은 총{" "}
<span className=" text-primary-500">{list.out}</span>입니다.
</div>
Expand All @@ -45,8 +45,8 @@ const CheckPage = ({ type }: checkPageType) => {
</Button>
</div>
) : (
<div className=" rounded-xl w-full h-62 bg-white flex flex-col items-center gap-3">
<div className=" text-neutral-50 text-sub-title4-M text-center px-2 pt-6">
<div className=" rounded-xl w-full h-62 bg-white flex flex-col items-center gap-3 py-6">
<div className=" text-neutral-50 text-sub-title4-M text-center px-3">
현재 외출/귀가 신청 학생은 총{" "}
<span className=" text-secondary-300">{list.request}</span>입니다.
</div>
Expand Down
24 changes: 10 additions & 14 deletions src/app/main/page.tsx
Original file line number Diff line number Diff line change
@@ -1,36 +1,32 @@
"use client";
import Header from "@/components/header";
import Button from "./button";
import outAcceptImg from "@/assets/svg/outing.svg";
import AfterManageImg from "@/assets/svg/afterManage.svg";
import { useEffect, useState } from "react";
import CheckPage from "./checkPage";
import { GetName, GetTodaydirector } from "@/api/main";
import { getToday, getWeekDay } from "@/util/date";
import AfterManageImg from "@/assets/svg/aferManege.svg";
import attendanceImg from "@/assets/svg/attendance.svg"
import outingImg from "@/assets/svg/outing.svg"
import moveClassImg from "@/assets/svg/moveClass.svg"

const Main = () => {
const [date, setDate] = useState(new Date().toLocaleTimeString());
const [floor, setFloor] = useState<string>();
const [name, setName] = useState<string>("");
const { data: getName } = GetName();
const { data: getDirector } = GetTodaydirector();

useEffect(() => {
if (getName) {
setName(getName);
localStorage.setItem("name", getName);
}
if (getDirector) setFloor(getDirector);
}, [getName, getDirector]);
}, [getDirector]);

return (
<>
<Header />
<div className="bg-primary-1200 flex flex-col gap-9 items-center px-6 h-dvh">
<div className="bg-primary-1200 flex flex-col gap-9 items-center px-6 h-dvh pt-7">
<div className="flex w-full justify-between">
<Button src="/outAccept" name="외출 수락" img={outAcceptImg} />
<Button src="/outAccept" name="외출 수락" img={outingImg} />
<Button src="/afterManage" name="방과후 관리" img={AfterManageImg} />
<Button src="/" name="출석 체크" img={outAcceptImg} />
<Button src="/classChange" name="교실 이동" img={outAcceptImg} />
<Button src="/" name="출석 체크" img={attendanceImg} />
<Button src="/classChange" name="교실 이동" img={moveClassImg} />
</div>
<div className="rounded-xl w-full h-auto bg-white gap-2 flex items-center flex-wrap px-5 py-3">
<div className="text-sub-title4-M text-neutral-300">
Expand Down
5 changes: 5 additions & 0 deletions src/assets/svg/aferManege.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 0 additions & 4 deletions src/assets/svg/afterManage.svg

This file was deleted.

4 changes: 4 additions & 0 deletions src/assets/svg/attendance.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions src/assets/svg/moveClass.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 3 additions & 2 deletions src/assets/svg/outing.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2b03b3f

Please sign in to comment.