Skip to content

Commit 328cc3b

Browse files
committed
Updated Modal.tsx
1 parent 88418bb commit 328cc3b

2 files changed

Lines changed: 66 additions & 1 deletion

File tree

‎src/components/modal/Modal.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { useGamepads } from 'awesome-react-gamepads';
1515
import ControllerIcon from "@components/icons/ControllerIcon";
1616
import { useAudio } from '@context/AudioContext';
1717
import accounts from "@src/config/accounts.json";
18-
import { SecretsView } from "./views/secrets_new";
18+
import { SecretsView } from "./views/secrets";
1919
import "./modal.css";
2020

2121
const AUDIO_SRC = '/audio/nav.mp3';
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
"use client";
2+
3+
import React from "react";
4+
import { useSecret } from "@context/SecretContext";
5+
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
6+
import { faQuestionCircle, faLock, faUnlock } from "@fortawesome/free-solid-svg-icons";
7+
8+
export interface SecretsViewProps
9+
{
10+
title: string;
11+
description?: string;
12+
}
13+
14+
export const SecretsView = ({ title, description }: SecretsViewProps) => {
15+
16+
const { stats } = useSecret();
17+
18+
return (
19+
<>
20+
<div className="my-auto mx-auto grid grid-cols-1 w-full h-full justify-items-center">
21+
<div className="relative my-auto">
22+
<div className="flex mb-2 ">
23+
<label className="text-lg sm:text-xl my-auto opacity-50 text-white grow align-bottom mb-1">
24+
{title}
25+
</label>
26+
{description && (
27+
<FontAwesomeIcon icon={faQuestionCircle} className="w-5 h-5 mb-1 opacity-25 hover:opacity-100 align-self-end justify-self-end text-white justify-right"
28+
aria-label={description} />
29+
)}
30+
</div>
31+
<div className="grid grid-cols-2 grid-rows-1 relative w-fit max-w-150 text-ellipsis">
32+
<table>
33+
<thead>
34+
<tr>
35+
<th> </th>
36+
<th>Name</th>
37+
<th>Description</th>
38+
</tr>
39+
</thead>
40+
<tbody>
41+
{
42+
stats && Array.from(stats).map(([id, stat]) => {
43+
return (
44+
<tr key={id}>
45+
<td>
46+
<FontAwesomeIcon icon={stat.isUnlocked ? faUnlock : faLock} />
47+
</td>
48+
<td>
49+
<span className="font-semibold">{stat.stat.title}</span>
50+
</td>
51+
<td>
52+
<span>{stat.stat.description}</span>
53+
</td>
54+
</tr>
55+
);
56+
})
57+
}
58+
</tbody>
59+
</table>
60+
</div>
61+
</div>
62+
</div>
63+
</>
64+
);
65+
};

0 commit comments

Comments
 (0)