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