dashboard 형태의 UI 수정 및 고도화

This commit is contained in:
2026-03-04 08:29:39 +09:00
parent 618d5f8e6f
commit ccc9f7c634
17 changed files with 1296 additions and 224 deletions

View File

@@ -367,6 +367,94 @@
padding-top: 4px;
}
/* ── Dev Log ─────────────────────────────────────────────────────────── */
.home-dev-log {
display: grid;
gap: 8px;
}
.home-dev-log__empty {
margin: 0;
color: var(--text-muted);
font-size: 13px;
padding: 16px 0;
}
.home-dev-log__item {
border: 1px solid var(--line);
padding: 14px 18px;
border-radius: var(--radius-md);
background: var(--surface-card);
display: grid;
grid-template-columns: auto 1fr auto;
align-items: start;
gap: 14px;
box-shadow: var(--shadow-card);
transition: border-color 0.2s ease, background 0.2s ease;
}
.home-dev-log__item:hover {
border-color: rgba(52, 211, 153, 0.25);
background: var(--surface-raised);
}
.home-dev-log__dot {
width: 7px;
height: 7px;
border-radius: 50%;
background: #34d399;
box-shadow: 0 0 6px rgba(52, 211, 153, 0.8);
margin-top: 7px;
flex-shrink: 0;
}
.home-dev-log__content {
display: grid;
gap: 4px;
}
.home-dev-log__title {
margin: 0;
font-weight: 600;
font-size: 15px;
color: var(--text-bright);
letter-spacing: -0.01em;
}
.home-dev-log__desc {
margin: 0;
color: var(--text-dim);
font-size: 12px;
line-height: 1.6;
}
.home-dev-log__date {
font-size: 11px;
color: rgba(52, 211, 153, 0.7);
text-transform: uppercase;
letter-spacing: 0.08em;
white-space: nowrap;
padding-top: 4px;
}
.home-dev-log__link {
display: inline-flex;
align-items: center;
gap: 6px;
margin-top: 4px;
font-size: 13px;
color: #34d399;
text-decoration: none;
padding: 8px 0;
transition: opacity 0.2s ease;
font-weight: 500;
}
.home-dev-log__link:hover {
opacity: 0.75;
}
/* ── Profile ─────────────────────────────────────────────────────────── */
.home-profile {

View File

@@ -1,13 +1,30 @@
import React from 'react';
import React, { useEffect, useState } from 'react';
import { Link } from 'react-router-dom';
import { navLinks } from '../../routes.jsx';
import { getBlogPosts } from '../../data/blog';
import { getTodos } from '../../api';
import myPhoto from '../../assets/myPhoto.jpg';
import './Home.css';
const SEVEN_DAYS_MS = 7 * 24 * 60 * 60 * 1000;
const Home = () => {
const posts = getBlogPosts().slice(0, 3);
const highlights = navLinks.filter((link) => link.id !== 'home');
const [recentDev, setRecentDev] = useState([]);
useEffect(() => {
getTodos()
.then((todos) => {
if (!Array.isArray(todos)) return;
const now = Date.now();
const filtered = todos
.filter((t) => t.status === 'done' && t.updated_at && (now - new Date(t.updated_at).getTime()) <= SEVEN_DAYS_MS)
.slice(0, 5);
setRecentDev(filtered);
})
.catch(() => { /* 조용히 실패 */ });
}, []);
return (
<div className="home">
@@ -97,6 +114,36 @@ const Home = () => {
</div>
</section>
<section className="home-section">
<div className="home-section__header">
<h2>최근 개발</h2>
<p>최근 7 완료된 태스크를 보여줍니다.</p>
</div>
<div className="home-dev-log">
{recentDev.length === 0 ? (
<p className="home-dev-log__empty">완료된 태스크가 없습니다.</p>
) : (
recentDev.map((todo) => (
<div key={todo.id} className="home-dev-log__item">
<span className="home-dev-log__dot" />
<div className="home-dev-log__content">
<p className="home-dev-log__title">{todo.title}</p>
{todo.description && (
<p className="home-dev-log__desc">{todo.description}</p>
)}
</div>
<span className="home-dev-log__date">
{new Date(todo.updated_at).toLocaleDateString('ko-KR', { month: 'short', day: 'numeric' })}
</span>
</div>
))
)}
<Link to="/todo" className="home-dev-log__link">
Todo 보드 열기
</Link>
</div>
</section>
<section className="home-section">
<div className="home-section__header">
<h2>Profile</h2>