Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Completed team division. #355

Merged
merged 1 commit into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions react-fm/src/pages/eventPage/EventPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,11 @@
credits
reservedPlayersList {
displayName
teamColor
}
waitListPlayers{
displayName
teamColor
}
}
}
Expand Down Expand Up @@ -112,7 +114,7 @@

setCityNameId(id.substring(0, 1));
setEvent(eventData);
} catch (err: any) {

Check warning on line 117 in react-fm/src/pages/eventPage/EventPage.tsx

View workflow job for this annotation

GitHub Actions / build (18.x)

Unexpected any. Specify a different type
setError(err.message);
} finally {
setLoading(false);
Expand Down
16 changes: 8 additions & 8 deletions react-fm/src/pages/matchQueues/GamesList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,14 @@ export const GamesList: FC<event> = ({ gameEvent, cityName, cityNameId, addPlaye
const teamA = (teamAColor: string) => (
<Box className={styles.teamDivision}>
<span className={styles.colorTeamA} style={{ background: teamAColor }} />
{teamAColor ? teamAColor : 'White'} (Team A)
{teamAColor ? teamAColor : 'Red'} (Team A)
</Box>
);

const teamB = (teamBColor: string) => (
<Box className={styles.teamDivisionSecond}>
<span className={styles.colorTeamB} style={{ background: teamBColor }} />
{teamBColor ? teamBColor : 'Blue'} (Team B)
{teamBColor ? teamBColor : 'Black'} (Team B)
</Box>
);

Expand Down Expand Up @@ -166,9 +166,9 @@ export const GamesList: FC<event> = ({ gameEvent, cityName, cityNameId, addPlaye
venueName={playingEvent.venueName}
waitListPlayers={playingEvent.waitListPlayers}
stripePaymentUrl={playingEvent.stripePaymentUrl}
team_division={false}
team1_color={playingEvent.team1_color ? playingEvent.team1_color : ''}
team2_color={playingEvent.team2_color ? playingEvent.team2_color : ''}
team_division={playingEvent.teamDivision ? playingEvent.teamDivision : false}
team1_color={playingEvent.team1Color ? playingEvent.team1Color : ''}
team2_color={playingEvent.team2Color ? playingEvent.team2Color : ''}
dummyData={playingEvent.dummyData ? playingEvent.dummyData : false}
handlePassName={passName}
credits={playingEvent.credits ? playingEvent.credits : 0}
Expand Down Expand Up @@ -207,9 +207,9 @@ export const GamesList: FC<event> = ({ gameEvent, cityName, cityNameId, addPlaye
/>
) : null}

{playingEvent.team_division ? (
{playingEvent?.teamDivision ? (
<Box>
{teamA(playingEvent.team1_color)}
{teamA(playingEvent?.team1Color || 'Red')}
<Grid container spacing={{ xs: 2, md: 3 }} columns={{ xs: 4, sm: 8, md: 12 }}>
{Array.from({ length: playingEvent.reservedPlayersCount / 2 }, (_, i) => {
const player =
Expand All @@ -220,7 +220,7 @@ export const GamesList: FC<event> = ({ gameEvent, cityName, cityNameId, addPlaye
})}
</Grid>
<Typography className={styles.versus}>v/s</Typography>
{teamB(playingEvent.team2_color)}
{teamB(playingEvent?.team2Color || 'Black')}

<Grid container spacing={{ xs: 2, md: 3 }} columns={{ xs: 4, sm: 8, md: 12 }}>
{Array.from({ length: playingEvent.reservedPlayersCount / 2 }, (_, i) => {
Expand Down
12 changes: 8 additions & 4 deletions react-fm/src/pages/matchQueues/eventsComponents/Events.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ export const EventsCard: FC<EventDetails> = ({
dummyData,
handlePassName,
credits,
team_division,
team1_color,
team2_color,
}) => {
const isPortrait = useOrientation();
const [, notificationsActions] = useNotifications();
Expand All @@ -49,6 +52,7 @@ export const EventsCard: FC<EventDetails> = ({
const openWaitList = waitListPlayersCount - waitListPlayers.length;
const currentUrl = window.location.origin;
const fullEventLink = `${currentUrl}/event/${uniqueEventId}`;
// console.log(team1_color, team2_color, team_division);

let whatsappGroupLink: string | undefined;
switch (eventId) {
Expand Down Expand Up @@ -142,7 +146,7 @@ export const EventsCard: FC<EventDetails> = ({
if (currencyCode === 'INR') {
timeZone = (
<span>
{dummyData ? futureDate : date} {' '} {time}
{dummyData ? futureDate : date} {' '} {`time`}
</span>
);
} else {
Expand Down Expand Up @@ -243,9 +247,9 @@ export const EventsCard: FC<EventDetails> = ({
venueName={venueName}
waitListPlayers={waitListPlayers}
waitListPlayersCount={waitListPlayersCount}
team_division={false}
team1_color={''}
team2_color={''}
team_division={team_division}
team1_color={team1_color}
team2_color={team2_color}
dummyData={dummyData}
handlePassName={handlePassName}
cityId={cityId}
Expand Down
Loading