This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
import { useState } from "react";
|
||||
import Button from "../../components/Buttons/Button";
|
||||
import InputBox from "../../components/Inputs/InputBox";
|
||||
import PopUp from "../../components/PopUp/PopUp";
|
||||
|
||||
const jatekEredmenyek = [
|
||||
{ helyezes: 1, datum: "2025-03-24 14:22" },
|
||||
{ helyezes: 5, datum: "2025-03-24 14:20" },
|
||||
{ helyezes: 3, datum: "2025-03-24 14:18" },
|
||||
{ helyezes: 4, datum: "2025-03-24 14:15" },
|
||||
];
|
||||
|
||||
export default function Test() {
|
||||
const [showPopup, setShowPopup] = useState(false);
|
||||
const [inputValue, setInputValue] = useState("");
|
||||
|
||||
return (
|
||||
<div className="w-full h-screen flex flex-col items-center justify-center space-y-6">
|
||||
<InputBox
|
||||
placeholder="E-mail cím"
|
||||
type="text"
|
||||
width="w-1/2"
|
||||
value={inputValue}
|
||||
onChange={(e) => setInputValue(e.target.value)}
|
||||
/>
|
||||
<Button
|
||||
text="Játék Előzmények"
|
||||
type="button"
|
||||
width="w-1/2"
|
||||
onClick={() => setShowPopup(true)}
|
||||
/>
|
||||
{showPopup && (
|
||||
<PopUp onClose={() => setShowPopup(false)}>
|
||||
<div className="p-6 w-full max-w-md">
|
||||
<h1 className="text-2xl font-bold text-center mb-4">Játék Előzmények</h1>
|
||||
<div className="space-y-3">
|
||||
{jatekEredmenyek.map((eredmeny, index) => (
|
||||
<div
|
||||
key={index}
|
||||
className={`flex justify-between items-center rounded-lg p-4 shadow-md ${
|
||||
eredmeny.helyezes <= 3 ? "border-l-4 border-green-500" : "border-l-4 border-blue-500"
|
||||
} bg-gray-50`}
|
||||
>
|
||||
<p className="text-gray-800 font-semibold">
|
||||
Felhasználónév {eredmeny.helyezes}. helyezés
|
||||
</p>
|
||||
<span className="text-sm text-gray-500">{eredmeny.datum}</span>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
<div className="flex justify-center mt-6">
|
||||
<Button text="Bezár" type="button" width="w-24" onClick={() => setShowPopup(false)} />
|
||||
</div>
|
||||
</div>
|
||||
</PopUp>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
// src/components/PopUp/RatingSet.jsx
|
||||
|
||||
export default function RatingSet() {
|
||||
// Ezeket lehet később props-ból vagy API-ból is betölteni
|
||||
const stats = [
|
||||
{ label: "Win Rate", value: "68%" },
|
||||
{ label: "Success Rate", value: "85%" },
|
||||
{ label: "My cards rate", value: "72%" },
|
||||
];
|
||||
|
||||
return (
|
||||
<div className="p-6 w-full max-w-md">
|
||||
<h1 className="text-2xl font-bold text-center mb-4">Statisztikák</h1>
|
||||
<div className="space-y-6">
|
||||
{stats.map((stat, index) => (
|
||||
<div
|
||||
key={index}
|
||||
className="flex justify-between items-center rounded-lg p-4 shadow-md bg-gray-50 border-l-4 border-indigo-500"
|
||||
>
|
||||
<p className="text-gray-800 font-semibold">{stat.label}</p>
|
||||
<span className="text-lg font-bold text-indigo-700">{stat.value}</span>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -1,6 +1,3 @@
|
||||
// src/pages/Testing/Test.jsx
|
||||
// itt tesztelhetjük a komponenseket illetve bármit
|
||||
|
||||
import { useState } from "react"
|
||||
import Button from "../../components/Buttons/Button"
|
||||
import InputBox from "../../components/Inputs/InputBox"
|
||||
@@ -8,10 +5,12 @@ import PopUp from "../../components/PopUp/PopUp"
|
||||
import Logo from "../../assets/pictures/Logo.jsx"
|
||||
import Navbar from "../../components/Navbar/Navbar"
|
||||
import Footer from "../../components/Footer/Footer.jsx"
|
||||
import RatingSet from "../../components/PopUp/RatingSet" // <- statisztikai komponens
|
||||
|
||||
export default function Test() {
|
||||
const [showPopup, setShowPopup] = useState(false)
|
||||
const [inputValue, setInputValue] = useState("") // input értékének tárolása
|
||||
const [showRegistrationPopup, setShowRegistrationPopup] = useState(false)
|
||||
const [showPreviewPopup, setShowPreviewPopup] = useState(false) // <- új state
|
||||
const [inputValue, setInputValue] = useState("")
|
||||
|
||||
return (
|
||||
<div className="w-full h-screen flex flex-col">
|
||||
@@ -24,9 +23,25 @@ export default function Test() {
|
||||
value={inputValue}
|
||||
onChange={(e) => setInputValue(e.target.value)}
|
||||
/>
|
||||
<Button text="Regisztráció" type="button" width="w-1/2" onClick={() => setShowPopup(true)} />
|
||||
{showPopup && (
|
||||
<PopUp onClose={() => setShowPopup(false)}>
|
||||
|
||||
<div className="flex flex-col sm:flex-row sm:space-x-4 space-y-4 sm:space-y-0 w-1/2">
|
||||
<Button
|
||||
text="Regisztráció"
|
||||
type="button"
|
||||
width="w-full"
|
||||
onClick={() => setShowRegistrationPopup(true)}
|
||||
/>
|
||||
<Button
|
||||
text="Előnézet"
|
||||
type="button"
|
||||
width="w-full"
|
||||
onClick={() => setShowPreviewPopup(true)} // <- másik state trigger
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* Regisztrációs popup */}
|
||||
{showRegistrationPopup && (
|
||||
<PopUp onClose={() => setShowRegistrationPopup(false)}>
|
||||
<div className="flex flex-col items-center space-y-4">
|
||||
{/* <Logo size={120} /> */}
|
||||
<h1 className="text-2xl font-bold text-center">Sikeres regisztráció!</h1>
|
||||
@@ -39,10 +54,17 @@ export default function Test() {
|
||||
<p className="text-center text-sm text-gray-500">
|
||||
Ha nem kaptad meg a levelet, ellenőrizd a spam mappádat is!
|
||||
</p>
|
||||
<Button text="Bezár" type="button" width="w-24" onClick={() => setShowPopup(false)} />
|
||||
<Button text="Bezár" type="button" width="w-24" onClick={() => setShowRegistrationPopup(false)} />
|
||||
</div>
|
||||
</PopUp>
|
||||
)}
|
||||
|
||||
{/* Előnézeti popup (RatingSet) */}
|
||||
{showPreviewPopup && (
|
||||
<PopUp onClose={() => setShowPreviewPopup(false)}>
|
||||
<RatingSet />
|
||||
</PopUp>
|
||||
)}
|
||||
</div>
|
||||
<Footer />
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user