mirror of
https://github.com/Paris-est-Ludique/intranet.git
synced 2025-06-10 01:24:20 +02:00
Some upgrades for teams choice
This commit is contained in:
parent
79b0dd47bf
commit
60c25aa690
@ -1,9 +1,23 @@
|
|||||||
@import "../../theme/mixins";
|
@import "../../theme/variables";
|
||||||
|
|
||||||
.mainMenu {
|
.mainMenu {
|
||||||
@include nav-menu;
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
list-style: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mainMenuItem {
|
.mainMenuItem {
|
||||||
@include nav-menu-item;
|
display: inline-block;
|
||||||
|
margin: 0 6px;
|
||||||
|
|
||||||
|
a {
|
||||||
|
font-size: 0.9em;
|
||||||
|
font-weight: bold;
|
||||||
|
color: $color-black;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
a:hover {
|
||||||
|
color: $color-grey-dark;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,7 @@ const TeamWishes: FC<Props> = (): JSX.Element | null => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={styles.root}>
|
<div className={styles.root}>
|
||||||
<div className={styles.title}>Mes choix d'équipes</div>
|
<div className={styles.title}>Mon choix d'équipe</div>
|
||||||
{teamWishesString && <span>{teamWishesString}</span>}
|
{teamWishesString && <span>{teamWishesString}</span>}
|
||||||
{!teamWishesString && <span className={styles.lineEmpty}>Non renseignés</span>}
|
{!teamWishesString && <span className={styles.lineEmpty}>Non renseignés</span>}
|
||||||
{comment && (
|
{comment && (
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { FC, memo, useCallback, useEffect, useRef, useState } from "react"
|
import { FC, memo, useCallback, useEffect, useRef } from "react"
|
||||||
import { useSelector } from "react-redux"
|
import { useSelector } from "react-redux"
|
||||||
import get from "lodash/get"
|
import get from "lodash/get"
|
||||||
import set from "lodash/set"
|
import set from "lodash/set"
|
||||||
@ -18,7 +18,6 @@ const TeamWishesForm: FC<Props> = ({ afterSubmit }): JSX.Element | null => {
|
|||||||
const { addToSelection, toggleToSelection, isInSelection } = useSelection()
|
const { addToSelection, toggleToSelection, isInSelection } = useSelection()
|
||||||
const commentRef = useRef<HTMLTextAreaElement | null>(null)
|
const commentRef = useRef<HTMLTextAreaElement | null>(null)
|
||||||
const [userWishes, saveWishes] = useUserTeamWishes()
|
const [userWishes, saveWishes] = useUserTeamWishes()
|
||||||
const [extendedTeam, setExtendedTeam] = useState<number | null>(null)
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!userWishes) return
|
if (!userWishes) return
|
||||||
@ -28,13 +27,6 @@ const TeamWishesForm: FC<Props> = ({ afterSubmit }): JSX.Element | null => {
|
|||||||
|
|
||||||
const onTeamClick = useCallback((id) => toggleToSelection(id), [toggleToSelection])
|
const onTeamClick = useCallback((id) => toggleToSelection(id), [toggleToSelection])
|
||||||
|
|
||||||
const onExtendClick = useCallback(
|
|
||||||
(id) => setExtendedTeam(extendedTeam === id ? null : id),
|
|
||||||
[extendedTeam, setExtendedTeam]
|
|
||||||
)
|
|
||||||
|
|
||||||
console.log("extendedTeam", extendedTeam)
|
|
||||||
|
|
||||||
const onSubmit = useCallback(() => {
|
const onSubmit = useCallback(() => {
|
||||||
const teamWishesComment = get(commentRef, "current.value", "")
|
const teamWishesComment = get(commentRef, "current.value", "")
|
||||||
const teamWishes = teams
|
const teamWishes = teams
|
||||||
@ -47,8 +39,16 @@ const TeamWishesForm: FC<Props> = ({ afterSubmit }): JSX.Element | null => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={styles.root}>
|
<div className={styles.root}>
|
||||||
<div className={styles.title}>
|
<div className={styles.title}>Mon choix d'équipe</div>
|
||||||
Sélectionne la ou les équipes que tu aimerais rejoindre :
|
<div className={styles.intro}>
|
||||||
|
<p>Sélectionne la ou les équipes que tu aimerais rejoindre.</p>
|
||||||
|
<p>
|
||||||
|
Pour plus d'informations sur les équipes,{" "}
|
||||||
|
<a href="/teams" target="_blank">
|
||||||
|
clique ici
|
||||||
|
</a>
|
||||||
|
.
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<ul className={styles.teamList}>
|
<ul className={styles.teamList}>
|
||||||
{teams.map((team: any) => (
|
{teams.map((team: any) => (
|
||||||
@ -56,8 +56,7 @@ const TeamWishesForm: FC<Props> = ({ afterSubmit }): JSX.Element | null => {
|
|||||||
key={team.id}
|
key={team.id}
|
||||||
className={classnames(
|
className={classnames(
|
||||||
styles.teamLine,
|
styles.teamLine,
|
||||||
isInSelection(team.id) && styles.active,
|
isInSelection(team.id) && styles.active
|
||||||
extendedTeam === team.id && styles.extended
|
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<button
|
<button
|
||||||
@ -67,14 +66,6 @@ const TeamWishesForm: FC<Props> = ({ afterSubmit }): JSX.Element | null => {
|
|||||||
>
|
>
|
||||||
{team.name}
|
{team.name}
|
||||||
</button>
|
</button>
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
onClick={() => onExtendClick(team.id)}
|
|
||||||
className={styles.extendButton}
|
|
||||||
>
|
|
||||||
Détails
|
|
||||||
</button>
|
|
||||||
<div className={styles.teamDescription}>{team.description}</div>
|
|
||||||
</li>
|
</li>
|
||||||
))}
|
))}
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -11,6 +11,15 @@
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.intro {
|
||||||
|
padding: 15px 0;
|
||||||
|
|
||||||
|
p {
|
||||||
|
margin: 0;
|
||||||
|
padding: 4px 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.inputWrapper {
|
.inputWrapper {
|
||||||
margin: 10px 0;
|
margin: 10px 0;
|
||||||
|
|
||||||
@ -66,17 +75,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.teamDescription {
|
|
||||||
display: none;
|
|
||||||
padding: 2px 4px 6px 8px;
|
|
||||||
color: $color-grey-dark;
|
|
||||||
font-size: 0.95em;
|
|
||||||
|
|
||||||
.extended & {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.commentWrapper {
|
.commentWrapper {
|
||||||
margin: 6px 0;
|
margin: 6px 0;
|
||||||
|
|
||||||
|
@ -8,3 +8,13 @@ body {
|
|||||||
font-family: "Helvetica-Light", Helvetica, Arial, sans-serif;
|
font-family: "Helvetica-Light", Helvetica, Arial, sans-serif;
|
||||||
background-color: $color-orange;
|
background-color: $color-orange;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
color: $color-green;
|
||||||
|
text-decoration: none;
|
||||||
|
font-weight: bold;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -7,6 +7,7 @@ $color-grey-dark: #555;
|
|||||||
$color-grey-medium: #999;
|
$color-grey-medium: #999;
|
||||||
$color-grey-light: #ccc;
|
$color-grey-light: #ccc;
|
||||||
$color-grey-lighter: #eee;
|
$color-grey-lighter: #eee;
|
||||||
|
$color-green: #080;
|
||||||
|
|
||||||
$border-large: 4px solid $color-black;
|
$border-large: 4px solid $color-black;
|
||||||
$border-thin: 2px solid $color-black;
|
$border-thin: 2px solid $color-black;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user