Skip to content

Commit ba1a4d1

Browse files
committed
legends
1 parent 37d1200 commit ba1a4d1

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/components/ColorLegends.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const ColorLegends = ({ onLegendClick, hiddenLegends }) => {
4141
onClick={() => onLegendClick(category)}
4242
></div>
4343
<span
44-
className={`cursor-pointer ${
44+
className={`cursor-pointer text-white font-light ${
4545
hiddenLegends.includes(category) ? "opacity-50 line-through" : "opacity-100"
4646
}`}
4747
onClick={() => onLegendClick(category)}

src/pages/LogsPage.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ const LogsPage = () => {
3535
try {
3636
const response = await fetch('/data/logs.json');
3737
const data = await response.json();
38-
setLogs(data);
38+
const logsWithId = data.map((log, index) => ({ ...log, id: `${log.title}-${log.date}-${index}`, originalIndex: index }));
39+
setLogs(logsWithId);
3940
} catch (err) {
4041
console.error("Error fetching logs:", err);
4142
} finally {
@@ -92,17 +93,17 @@ const LogsPage = () => {
9293
</div>
9394
</div>
9495
{showLegends && (
95-
<div className="mx-auto p-6 border border-gray-700 shadow-lg text-center bg-gray-900 mt-[-16px] mb-8">
96-
<h2 className="mb-[-16px] text-2xl font-semibold tracking-tight text-white">Legends</h2>
96+
<div className="mx-auto p-6 border border-gray-700 shadow-lg text-center bg-gray-900 opacity-80 mt-[-16px] mb-8" >
97+
<h2 className="mb-[-16px] text-xl font-light tracking-tight text-white">Categories</h2>
9798
<ColorLegends
9899
onLegendClick={handleLegendClick}
99100
hiddenLegends={hiddenLegends}
100101
/>
101102
</div>
102103
)}
103104
<div className={`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8 ${!showLegends ? 'mt-8' : ''}`}>
104-
{filteredLogs.map((log, index) => (
105-
<LogCard key={index} log={log} index={index} totalLogs={logs.length} />
105+
{filteredLogs.map((log) => (
106+
<LogCard key={log.id} log={log} index={log.originalIndex} totalLogs={logs.length} />
106107
))}
107108
</div>
108109

0 commit comments

Comments
 (0)