-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
08502e6
commit a1c7cd0
Showing
12 changed files
with
168 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
ravens-team-react/ravens-team-react/src/components/teams/teams-list/team-panels-view.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import React, { useState } from "react"; | ||
import { TeamResponse } from "../../../utils/twitch-api-types/team-types"; | ||
import { useTeamParticipants } from "../../../hooks/team-hooks/use-team-participant-info"; | ||
import { Body1, Caption1, Spinner, Title2 } from "@fluentui/react-components"; | ||
import { TeamList } from "./team-list"; | ||
import { areEqual } from "react-window"; | ||
|
||
interface TeamPanelsProps { | ||
teams: TeamResponse[]; | ||
} | ||
|
||
export const TeamPanels: React.FC<TeamPanelsProps> = ({ teams }: TeamPanelsProps) => { | ||
const { resolvedTeamMembersbyTeam, loading, error } = useTeamParticipants(teams.map(team => team.id)); | ||
|
||
if (loading) return <Spinner appearance="inverted" labelPosition="before" label="Loading team information" />; | ||
if (error) return <div><Body1 as="h2">An error occured:</Body1><Caption1 as="p">{JSON.stringify(error)}</Caption1></div> | ||
|
||
const teamIds = Object.keys(resolvedTeamMembersbyTeam).forEach(teamId => { | ||
}); | ||
const teampanels: React.ReactElement[] = []; | ||
teams.forEach(team => { | ||
const panel = <div role="tabpanel" aria-labelledby={team.id}> | ||
<Title2>{team.team_display_name}</Title2> | ||
</div>; | ||
teampanels.push(panel);}); | ||
|
||
return ( | ||
<div> | ||
{teampanels} | ||
</div> | ||
); | ||
} |
Oops, something went wrong.