changes
This commit is contained in:
@@ -1,39 +1,6 @@
|
||||
import { useState, useEffect } from 'react'
|
||||
import { Link } from 'react-router-dom'
|
||||
import { myGainsApi } from '../services/game'
|
||||
|
||||
function TabNav({ active }) {
|
||||
return (
|
||||
<div className="flex border-b border-gray-200 mb-6">
|
||||
<Link
|
||||
to="/mes-gains"
|
||||
className={`flex-1 flex items-center justify-center gap-2 py-3 text-sm font-medium transition-colors ${
|
||||
active === 'gains'
|
||||
? 'text-[#006B6B] border-b-2 border-[#006B6B]'
|
||||
: 'text-gray-400'
|
||||
}`}
|
||||
>
|
||||
<svg className="w-4 h-4" fill="none" stroke="currentColor" strokeWidth={2} viewBox="0 0 24 24">
|
||||
<path strokeLinecap="round" strokeLinejoin="round" d="M20 12V22H4V12M22 7H2v5h20V7zM12 22V7M12 7H7.5a2.5 2.5 0 010-5C11 2 12 7 12 7zM12 7h4.5a2.5 2.5 0 000-5C13 2 12 7 12 7z" />
|
||||
</svg>
|
||||
Mes gains
|
||||
</Link>
|
||||
<Link
|
||||
to="/profile"
|
||||
className={`flex-1 flex items-center justify-center gap-2 py-3 text-sm font-medium transition-colors ${
|
||||
active === 'profile'
|
||||
? 'text-[#006B6B] border-b-2 border-[#006B6B]'
|
||||
: 'text-gray-400'
|
||||
}`}
|
||||
>
|
||||
<svg className="w-4 h-4" fill="none" stroke="currentColor" strokeWidth={2} viewBox="0 0 24 24">
|
||||
<path strokeLinecap="round" strokeLinejoin="round" d="M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z" />
|
||||
</svg>
|
||||
Profile
|
||||
</Link>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
import UserNav from '../components/UserNav'
|
||||
|
||||
function formatDate(dateStr) {
|
||||
return new Date(dateStr).toLocaleDateString('fr-FR', {
|
||||
@@ -57,21 +24,9 @@ export default function MesGains() {
|
||||
|
||||
return (
|
||||
<div className="min-h-screen bg-white max-w-sm mx-auto px-6 pt-6">
|
||||
<TabNav active="gains" />
|
||||
<UserNav active="gains" />
|
||||
|
||||
<Link
|
||||
to="/saisir-code-unique"
|
||||
className="flex items-center justify-center gap-2 w-full bg-[#006B6B] hover:bg-[#005959] text-white font-medium py-3 rounded-lg transition-colors mb-6 text-sm"
|
||||
>
|
||||
<svg className="w-4 h-4" fill="none" stroke="currentColor" strokeWidth={2} viewBox="0 0 24 24">
|
||||
<path strokeLinecap="round" strokeLinejoin="round" d="M12 4v16m8-8H4" />
|
||||
</svg>
|
||||
Saisir un nouveau code
|
||||
</Link>
|
||||
|
||||
{loading && (
|
||||
<p className="text-center text-gray-400 text-sm mt-8">Chargement...</p>
|
||||
)}
|
||||
{loading && <p className="text-center text-gray-400 text-sm mt-8">Chargement...</p>}
|
||||
|
||||
{error && (
|
||||
<div className="px-4 py-3 rounded-lg bg-red-50 border border-red-200 text-red-600 text-sm">
|
||||
@@ -83,19 +38,13 @@ export default function MesGains() {
|
||||
<p className="text-center text-gray-400 text-sm mt-8">Aucun gain pour le moment.</p>
|
||||
)}
|
||||
|
||||
{/* Timeline */}
|
||||
<div className="relative">
|
||||
{gains.map((gain, index) => (
|
||||
<div key={gain.participationId} className="flex gap-4">
|
||||
{/* Ligne verticale + cercle */}
|
||||
<div className="flex flex-col items-center">
|
||||
<div className="w-3 h-3 mt-1 rounded-full border-2 border-gray-400 flex-shrink-0" />
|
||||
{index < gains.length - 1 && (
|
||||
<div className="w-px flex-1 bg-gray-200 my-1" />
|
||||
)}
|
||||
{index < gains.length - 1 && <div className="w-px flex-1 bg-gray-200 my-1" />}
|
||||
</div>
|
||||
|
||||
{/* Contenu */}
|
||||
<div className={`flex-1 pb-6 ${index === 0 ? 'bg-gray-50 rounded-lg px-3 pt-1 -ml-1' : ''}`}>
|
||||
<p className="font-semibold text-gray-800 text-sm">{gain.lot}</p>
|
||||
<p className="text-gray-500 text-xs mt-1 leading-relaxed">{gain.description}</p>
|
||||
|
||||
Reference in New Issue
Block a user