add - loading spinner, administration, navbar modfications
This commit is contained in:
1 parent
6a10740307
commit
27187c6c68
28 files changed
+886
-116
No files matched your search
@@ -82,7 +82,7 @@ export async function getServerSideProps(context) {
|
||||
|
||||
type Props = {
|
||||
user: User;
|
||||
userGains: any;
|
||||
userGains: Gain[];
|
||||
}
|
||||
|
||||
const MonCompte = (props: Props) => {
|
||||
@@ -196,7 +196,7 @@ const MonCompte = (props: Props) => {
|
||||
<div className="form-group row">
|
||||
<label htmlFor="inputName" className="col-sm-3 col-form-label">Nom :</label>
|
||||
<div className="col-sm-9">
|
||||
<input {...register("name")} className={`form-control ${errors.name ? 'is-invalid' : ''}`} defaultValue={props.user?.name[1]} id="inputName" placeholder="John..." />
|
||||
<input {...register("name")} className={`form-control ${errors.name ? 'is-invalid' : ''}`} defaultValue={props.user?.name || ''} id="inputName" placeholder="John..." />
|
||||
<div className="invalid-feedback alert alert-danger mt-2">{errors.name?.message}</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -204,7 +204,7 @@ const MonCompte = (props: Props) => {
|
||||
<div className="form-group row">
|
||||
<label htmlFor="surname" className="col-sm-3 col-form-label">Prenom :</label>
|
||||
<div className="col-sm-9">
|
||||
<input {...register("surname")} className={`form-control ${errors.surname ? 'is-invalid' : ''}`} defaultValue={props.user.surname || props.user?.name[0]} id="surname" placeholder="Doe..." />
|
||||
<input {...register("surname")} className={`form-control ${errors.surname ? 'is-invalid' : ''}`} defaultValue={props.user.surname || ''} id="surname" placeholder="Doe..." />
|
||||
<div className="invalid-feedback alert alert-danger mt-2">{errors.surname?.message}</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -233,12 +233,12 @@ const MonCompte = (props: Props) => {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="form-group row">
|
||||
<div className="form-group">
|
||||
<button
|
||||
type="submit"
|
||||
className="btn btn-primary mt-2"
|
||||
>
|
||||
Sauvegarder les changements
|
||||
Sauvegarder mes changements
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -257,14 +257,16 @@ const MonCompte = (props: Props) => {
|
||||
<th scope="col">#</th>
|
||||
<th scope="col">Mes codes joué</th>
|
||||
<th scope="col">Mes cadeaux</th>
|
||||
<th scope="col">Statut</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{props.userGains.map((info: any) => {
|
||||
{props.userGains.map((info: any, index: number) => {
|
||||
return <tr>
|
||||
<th scope="row"></th>
|
||||
<th scope="row">{++index}</th>
|
||||
<td>{info.codeCadeau}</td>
|
||||
<td>{info.produit.nomProduit}</td>
|
||||
<td>{info.produit.retrait ? '❌ déja récupéré' : '✔️ venir me chercher !'}</td>
|
||||
</tr>
|
||||
})}
|
||||
</tbody>
|
||||
|
||||
Reference in new issue
Block a user