passing dynamic pages translations
This commit is contained in:
parent
c7b64397b4
commit
6670fea41c
|
|
@ -2,9 +2,14 @@ import React, { useEffect, useState } from "react";
|
||||||
import AnimatedPage from "../components/AnimatedPage";
|
import AnimatedPage from "../components/AnimatedPage";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
import { postRatingData } from "../services/WordpressFetchData";
|
import { postRatingData } from "../services/WordpressFetchData";
|
||||||
|
import { useUser } from "../hooks/useUser";
|
||||||
|
import Loading from "../components/animations/Loading";
|
||||||
|
|
||||||
export default function Rate() {
|
export default function Rate() {
|
||||||
const [rating, setRating] = useState(undefined);
|
const [rating, setRating] = useState(undefined);
|
||||||
|
|
||||||
|
const { screensTranslations } = useUser();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
return () => {
|
return () => {
|
||||||
setRating(undefined);
|
setRating(undefined);
|
||||||
|
|
@ -13,6 +18,9 @@ export default function Rate() {
|
||||||
|
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
||||||
|
if (!screensTranslations || !screensTranslations.game_results) return <Loading />;
|
||||||
|
const currentScreenTranslations = screensTranslations.rating;
|
||||||
|
|
||||||
function handleRatingChange(event) {
|
function handleRatingChange(event) {
|
||||||
// setRating({ ...rating, note: event.target.value });
|
// setRating({ ...rating, note: event.target.value });
|
||||||
setRating({ ...rating, note: 2 });
|
setRating({ ...rating, note: 2 });
|
||||||
|
|
@ -31,8 +39,8 @@ export default function Rate() {
|
||||||
<AnimatedPage className='page-container page-container--rating'>
|
<AnimatedPage className='page-container page-container--rating'>
|
||||||
<div className='screen '>
|
<div className='screen '>
|
||||||
<div className='screen__content'>
|
<div className='screen__content'>
|
||||||
<h1 className='titling-construction '>Notes</h1>
|
<h1 className='titling-construction '>{currentScreenTranslations.title}</h1>
|
||||||
<h2>merci pour votre participation</h2>
|
<h2>{currentScreenTranslations.text}</h2>
|
||||||
<div className='rating'>
|
<div className='rating'>
|
||||||
<div className='rating__items'>
|
<div className='rating__items'>
|
||||||
<input
|
<input
|
||||||
|
|
@ -109,7 +117,7 @@ export default function Rate() {
|
||||||
|
|
||||||
<textarea
|
<textarea
|
||||||
onChange={handleCommentChange}
|
onChange={handleCommentChange}
|
||||||
placeholder="Qu'avez-vous pensé de cette expérience ?"
|
placeholder={currentScreenTranslations.placeholder}
|
||||||
name=''
|
name=''
|
||||||
id=''
|
id=''
|
||||||
cols='10'
|
cols='10'
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user