mirror of
https://github.com/Paris-est-Ludique/intranet.git
synced 2025-09-12 14:20:08 +02:00
Add login form on pages where login is needed
This commit is contained in:
@@ -4,6 +4,7 @@ import { fetchVolunteerAsksSet } from "../../store/volunteerAsksSet"
|
||||
import { useAskTools, addAsk, answerLaterOnProfileBefore } from "./utils"
|
||||
import MealsForm, { fetchFor as fetchForMealsForm } from "../VolunteerBoard/MealsForm/MealsForm"
|
||||
import { useUserMeals } from "../VolunteerBoard/meals.utils"
|
||||
import { useUserDayWishes } from "../VolunteerBoard/daysWishes.utils"
|
||||
|
||||
export function AskMeals(asks: JSX.Element[], id: number): void {
|
||||
const { dispatch, jwtToken, volunteerAsks } = useAskTools()
|
||||
@@ -17,8 +18,11 @@ export function AskMeals(asks: JSX.Element[], id: number): void {
|
||||
}, [dispatch, id, jwtToken, volunteerAsks?.hiddenAsks])
|
||||
|
||||
const [userMeals] = useUserMeals()
|
||||
const [userWishes] = useUserDayWishes()
|
||||
const participation = get(userWishes, "active", "inconnu") as string
|
||||
const meals = get(userMeals, "meals", [])
|
||||
const needToShow = meals.length === 0
|
||||
const needToShow =
|
||||
(participation === "oui" || participation === "peut-etre") && meals.length === 0
|
||||
|
||||
addAsk(
|
||||
asks,
|
||||
|
@@ -6,6 +6,7 @@ import ParticipationDetailsForm, {
|
||||
fetchFor as fetchForParticipationDetailsForm,
|
||||
} from "../VolunteerBoard/ParticipationDetailsForm/ParticipationDetailsForm"
|
||||
import { useUserParticipationDetails } from "../VolunteerBoard/participationDetails.utils"
|
||||
import { useUserDayWishes } from "../VolunteerBoard/daysWishes.utils"
|
||||
|
||||
export function AskParticipationDetails(asks: JSX.Element[], id: number): void {
|
||||
const { dispatch, jwtToken, volunteerAsks } = useAskTools()
|
||||
@@ -19,9 +20,12 @@ export function AskParticipationDetails(asks: JSX.Element[], id: number): void {
|
||||
}, [dispatch, id, jwtToken, volunteerAsks?.hiddenAsks])
|
||||
|
||||
const [participationDetails] = useUserParticipationDetails()
|
||||
const [userWishes] = useUserDayWishes()
|
||||
const participation = get(userWishes, "active", "inconnu") as string
|
||||
const tshirtSize = get(participationDetails, "tshirtSize", "")
|
||||
const food = get(participationDetails, "food", "")
|
||||
const needToShow = !tshirtSize || !food
|
||||
const needToShow =
|
||||
(participation === "oui" || participation === "peut-etre") && (!tshirtSize || !food)
|
||||
|
||||
addAsk(
|
||||
asks,
|
||||
|
@@ -46,7 +46,7 @@ const Asks = (): JSX.Element | null => {
|
||||
dans <a href="/profil">Mon profil</a> :)
|
||||
<br />
|
||||
Tu as fait le tour des dernières infos ou questions importantes,
|
||||
merci ! :)
|
||||
merci !
|
||||
<br />
|
||||
Nous te préviendrons quand il y en aura de nouvelles.
|
||||
<br />
|
||||
|
Reference in New Issue
Block a user