Skip to content

Commit

Permalink
Merge pull request #1 from DEVROOM-OFFICIAL/develop
Browse files Browse the repository at this point in the history
💄 프론트엔드 UI 수정
  • Loading branch information
Yanghyeondong authored Sep 13, 2024
2 parents 363e3ce + 34d7971 commit 74fa70c
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 28 deletions.
4 changes: 2 additions & 2 deletions src/api/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import Cookies from "js-cookie";
const apiUrl = process.env.NEXT_PUBLIC_API_URL;

const apiClient = axios.create({
baseURL: apiUrl,
// baseURL: "/api",
// baseURL: apiUrl,
baseURL: "/api",
headers: {
"Content-Type": "application/json",
},
Expand Down
2 changes: 1 addition & 1 deletion src/app/(main)/container/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default function Home() {
const [filterOption, setFilterOption] = useState("");

const titles = {
recent: "최근 실행 컨테이너",
// recent: "최근 실행 컨테이너",
semester: "이번 학기 컨테이너",
all: "전체 학기 컨테이너",
};
Expand Down
4 changes: 2 additions & 2 deletions src/app/(main)/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,15 @@ export default function Layout({ children }: LayoutProps) {
<div>전체 학기 컨테이너</div>
</div>
</Link>
<Link href="/container/recent">
{/* <Link href="/container/recent">
<div
className={`${styles.menuItem} ${isActive(
"/container/recent"
)}`}
>
<div>최근 실행 컨테이너</div>
</div>
</Link>
</Link> */}
<Link href="/container/semester">
<div
className={`${styles.menuItem} ${isActive(
Expand Down
16 changes: 11 additions & 5 deletions src/app/(main)/mypage/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,18 @@ import { useUserStore } from "@/store/userStore";
import styles from "./page.module.css";
import ProfilePic from "/public/icons/MyProfile.svg";
import { useRouter } from "next/navigation";
import { useFetchService } from "@/api/hooks/useStudent";
import { type ServiceSchema } from "@/type/schemas";

const MyPage = () => {
const router = useRouter();
const { name, role, studentId, email, logout } = useUserStore(
(state) => state
);

const { data: serviceData, isLoading, error } = useFetchService();
let numberOfElements = 0;
if (serviceData) serviceData.map(() => (numberOfElements++));

const handleLogout = () => {
logout();
Expand Down Expand Up @@ -54,15 +60,15 @@ const MyPage = () => {
</div>

<div className={styles.statisticsSection}>
<h2 className={styles.sectionTitle}>컨테이너 사용시간 통계</h2>
<h2 className={styles.sectionTitle}>컨테이너 정보</h2>
<div className={styles.statsItem}>
<span className={styles.statsLabel}>사용시간:</span>
<span className={styles.statsValue}>50시간</span>
<span className={styles.statsLabel}>컨테이너 수:</span>
<span className={styles.statsValue}>{numberOfElements}</span>
</div>
<div className={styles.statsItem}>
{/* <div className={styles.statsItem}>
<span className={styles.statsLabel}>이번 학기 사용시간:</span>
<span className={styles.statsValue}>20시간</span>
</div>
</div> */}
</div>

<div className={styles.linkSection}>
Expand Down
13 changes: 10 additions & 3 deletions src/app/(professor)/professor-page/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,18 @@ import styles from "./page.module.css";
import ProfilePic from "/public/icons/MyProfile.svg";
import { useRouter } from "next/navigation";
import { useUserStore } from "@/store/userStore";
import { useFetchCheck } from "@/api/hooks/useProfessor";
import { type ServiceSchema } from "@/type/schemas";

const MyPage = () => {
const { name, role, studentId, email, logout } = useUserStore(
(state) => state
);

const { data: containerCheckData, isLoading, error } = useFetchCheck();
let numberOfElements = 0;
if (containerCheckData) containerCheckData.map(() => (numberOfElements++));

const router = useRouter();

const handleLogout = () => {
Expand Down Expand Up @@ -57,12 +64,12 @@ const MyPage = () => {
<h2 className={styles.sectionTitle}>컨테이너 정보</h2>
<div className={styles.statsItem}>
<span className={styles.statsLabel}>운영중인 컨테이너 개수:</span>
<span className={styles.statsValue}>5개</span>
<span className={styles.statsValue}>{numberOfElements}</span>
</div>
<div className={styles.statsItem}>
{/* <div className={styles.statsItem}>
<span className={styles.statsLabel}>사용된 컨테이너 개수:</span>
<span className={styles.statsValue}>67개</span>
</div>
</div> */}
</div>

<div className={styles.linkSection}>
Expand Down
2 changes: 1 addition & 1 deletion src/components/container/Filter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export default function Filter({ onSelect }: FilterProps) {
className={`${styles.filterOptions} ${isFilterOpen ? styles.open : ""}`}
>
<div onClick={() => handleSelect("전체 학기")}>전체 학기</div>
<div onClick={() => handleSelect("최근 실행")}>최근 실행</div>
{/* <div onClick={() => handleSelect("최근 실행")}>최근 실행</div> */}
<div onClick={() => handleSelect("이번 학기")}>이번 학기</div>
</div>
</div>
Expand Down
6 changes: 5 additions & 1 deletion src/components/container/SSHModal.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,17 @@
align-items: center;
gap: 15px;
padding: 20px;
width: 550px;
width: 100%;
border-radius: 12px;
border: 3px solid var(--orange-color);
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
color: var(--gray-color);
}

.wrapper {
width: auto;
}

.header {
text-align: center;
font-size: 20px;
Expand Down
28 changes: 15 additions & 13 deletions src/components/container/SSHModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,22 @@ const Modal = ({ isOpen, onClose, content }: ModalProps) => {

return (
<div className={styles.overlay}>
<div className={styles.modal}>
<button className={styles.button} onClick={onClose}>
X
</button>
<div className={styles.header}>
아래 명령어를 터미널에 입력하세요
<div className={styles.wrapper}>
<div className={styles.modal}>
<button className={styles.button} onClick={onClose}>
X
</button>
<div className={styles.header}>
아래 명령어를 터미널에 입력하세요
</div>

<div className={styles.content}>
{content.map((cmd, index) => (
<p key={index}>{cmd}</p>
))}
</div>

</div>

<div className={styles.content}>
{content.map((cmd, index) => (
<p key={index}>{cmd}</p>
))}
</div>

</div>
</div>
);
Expand Down

0 comments on commit 74fa70c

Please sign in to comment.