Skip to content

Commit 9410fa1

Browse files
committed
legends
1 parent 1210a78 commit 9410fa1

File tree

1 file changed

+20
-5
lines changed

1 file changed

+20
-5
lines changed

src/pages/LogsPage.js

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
import React, { useState, useEffect } from 'react';
22
import { Link } from 'react-router-dom';
3-
import { ArrowLeftIcon } from '@phosphor-icons/react';
3+
import { ArrowLeftIcon, CaretDown, CaretUp } from '@phosphor-icons/react';
44
import LogCard from '../components/LogCard';
55
import ColorLegends from '../components/ColorLegends';
66
import usePageTitle from "../utils/usePageTitle";
77

88
const LogsPage = () => {
99
usePageTitle('Logs <?>');
1010
const [logs, setLogs] = useState([]);
11+
const [showLegends, setShowLegends] = useState(false);
1112
const [loading, setLoading] = useState(true);
1213

1314
useEffect(() => {
@@ -58,12 +59,26 @@ const LogsPage = () => {
5859
<h1 className="text-4xl font-bold tracking-tight text-primary-400 sm:text-6xl mb-4 flex items-center">
5960
Logs
6061
</h1>
61-
<hr className="border-gray-700 mb-8" />
62-
<div className="mb-8 mx-auto p-6 border border-gray-700 rounded-lg shadow-lg text-center bg-gray-900">
62+
<div
63+
className="relative flex justify-center items-center w-full cursor-pointer"
64+
onClick={() => setShowLegends(!showLegends)}
65+
>
66+
<hr className="border-gray-700 w-full absolute" />
67+
<div className="relative bg-gray-900 px-4 z-10">
68+
{showLegends ? (
69+
<CaretUp size={32} className="text-primary-400" />
70+
) : (
71+
<CaretDown size={32} className="text-primary-400" />
72+
)}
73+
</div>
74+
</div>
75+
{showLegends && (
76+
<div className="mx-auto p-6 border border-gray-700 rounded-lg shadow-lg text-center bg-gray-900 mt-0 mb-8">
6377
<h2 className="text-2xl font-semibold tracking-tight text-white">Legends</h2>
6478
<ColorLegends />
65-
</div>
66-
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8">
79+
</div>
80+
)}
81+
<div className={`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8 ${!showLegends ? 'mt-8' : ''}`}>
6782
{logs.map((log, index) => (
6883
<LogCard key={index} log={log} index={index} totalLogs={logs.length} />
6984
))}

0 commit comments

Comments
 (0)