diff --git a/src/pages/lotto/Functions.jsx b/src/pages/lotto/Functions.jsx
index db22443..a385a03 100644
--- a/src/pages/lotto/Functions.jsx
+++ b/src/pages/lotto/Functions.jsx
@@ -1,4 +1,4 @@
-import React, { useEffect, useMemo, useState } from 'react';
+import React, { useEffect, useMemo, useRef, useState } from 'react';
import { deleteHistory, getHistory, getLatest, getStats, recommend } from '../../api';
const fmtKST = (value) => value?.replace('T', ' ') ?? '';
@@ -166,21 +166,26 @@ const FrequencyChart = ({ stats }) => {
- {series.map((item) => (
-
-
- {item.number}
-
- ))}
+ {series.map((item) => {
+ const showLabel = item.number === 1 || item.number % 5 === 0;
+ return (
+
+
+
+ {showLabel ? item.number : ''}
+
+
+ );
+ })}
);
@@ -205,6 +210,9 @@ export default function Functions() {
const [result, setResult] = useState(null);
const [history, setHistory] = useState([]);
+ const [historyExpanded, setHistoryExpanded] = useState(false);
+ const historyEndRef = useRef(null);
+ const prevHistoryExpandedRef = useRef(false);
const [stats, setStats] = useState(() => readStatsCache());
const [statsLoading, setStatsLoading] = useState(false);
const [statsError, setStatsError] = useState('');
@@ -306,6 +314,20 @@ export default function Functions() {
refreshStats();
}, []);
+ const visibleHistory = historyExpanded ? history : history.slice(0, 5);
+
+ useEffect(() => {
+ if (historyExpanded && !prevHistoryExpandedRef.current) {
+ requestAnimationFrame(() => {
+ historyEndRef.current?.scrollIntoView({
+ behavior: 'smooth',
+ block: 'end',
+ });
+ });
+ }
+ prevHistoryExpandedRef.current = historyExpanded;
+ }, [historyExpanded, visibleHistory.length]);
+
return (
{error ? (
@@ -542,47 +564,46 @@ export default function Functions() {
)}
-
-
-
-
Distribution
-
전체 회차 번호 분포
-
- 1~45번 번호가 등장한 횟수를 기준으로 분포를 표시합니다.
-
-
-
- {statsLoading ? (
- 로딩 중
- ) : null}
- {stats?.total_draws ? (
-
- {stats.total_draws}회차
-
- ) : null}
-
-
-
-
- {statsError ? (
- {statsError}
- ) : null}
- {stats ? (
-
- ) : (
-
- 통계 데이터를 불러오지 못했습니다.
-
- )}
-
+
+
+
+
Distribution
+
전체 회차 번호 분포
+
+ 1~45번 번호가 등장한 횟수를 기준으로 분포를 표시합니다.
+
+
+
+ {statsLoading ? (
+ 로딩 중
+ ) : null}
+ {stats?.total_draws ? (
+
+ {stats.total_draws}회차
+
+ ) : null}
+
+
+
+
+ {statsError ? {statsError}
: null}
+ {stats ? (
+
+ ) : (
+
+ 통계 데이터를 불러오지 못했습니다.
+
+ )}
+
+
@@ -594,6 +615,30 @@ export default function Functions() {
{history.length}건
+ {history.length > 5 ? (
+
+ ) : null}