teams filtered and sorted

This commit is contained in:
memeriau
2022-03-03 23:50:56 +01:00
parent c04b62a657
commit b93da3e119
7 changed files with 68 additions and 4 deletions

View File

@@ -2,10 +2,10 @@ import React, { memo } from "react"
import { useSelector } from "react-redux"
import styles from "./styles.module.scss"
import TeamItem from "./TeamItem"
import { selectTeamList } from "../../store/teamList"
import { selectSortedActiveTeams } from "../../store/teamList"
const TeamList: React.FC = (): JSX.Element | null => {
const teams = useSelector(selectTeamList)
const teams = useSelector(selectSortedActiveTeams)
if (!teams || teams.length === 0) return null
return (

View File

@@ -5,7 +5,7 @@ import set from "lodash/set"
import classnames from "classnames"
import styles from "./styles.module.scss"
import { useUserTeamWishes } from "../teamWishes.utils"
import { fetchTeamListIfNeed, selectTeamList } from "../../../store/teamList"
import { fetchTeamListIfNeed, selectSortedActiveTeams } from "../../../store/teamList"
import useSelection from "../useSelection"
import { fetchVolunteerTeamWishesSetIfNeed } from "../../../store/volunteerTeamWishesSet"
import FormButton from "../../Form/FormButton/FormButton"
@@ -15,7 +15,7 @@ type Props = {
}
const TeamWishesForm: FC<Props> = ({ afterSubmit }): JSX.Element | null => {
const teams = useSelector(selectTeamList)
const teams = useSelector(selectSortedActiveTeams)
const { selection, setSelection, toggleToSelection, isInSelection } = useSelection()
const commentRef = useRef<HTMLTextAreaElement | null>(null)
const [userWishes, saveWishes] = useUserTeamWishes()