mirror of
https://github.com/MetaFam/TheGame.git
synced 2026-02-09 05:25:15 -05:00
Renamed player columns to be consistent snake_case (#262)
This commit is contained in:
@@ -82,7 +82,7 @@ export const PlayerTile: React.FC<Props> = ({ player }) => (
|
||||
{player.rank}
|
||||
</MetaTag>
|
||||
)}
|
||||
<MetaTag size="md">XP: {Math.floor(player.totalXp)}</MetaTag>
|
||||
<MetaTag size="md">XP: {Math.floor(player.total_xp)}</MetaTag>
|
||||
</Wrap>
|
||||
{player.box_profile?.description ? (
|
||||
<VStack spacing={2} align="stretch">
|
||||
|
||||
@@ -49,7 +49,7 @@ export const PlayerMemberships: React.FC<Props> = ({
|
||||
}
|
||||
{(player.rank || '').toLowerCase()}
|
||||
</Text>
|
||||
<Text fontSize="xs">XP: {Math.round(player.totalXp || 0)}</Text>
|
||||
<Text fontSize="xs">XP: {Math.round(player.total_xp || 0)}</Text>
|
||||
</HStack>
|
||||
</Box>
|
||||
</HStack>
|
||||
|
||||
@@ -36,7 +36,7 @@ export const SetupPlayerType: React.FC = () => {
|
||||
playerId: user.id,
|
||||
input: {
|
||||
enneagram: personalityType?.name,
|
||||
playerTypeId: playerType?.id,
|
||||
player_type_id: playerType?.id,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -58,8 +58,8 @@ export const SetupProfile: React.FC = () => {
|
||||
})),
|
||||
);
|
||||
}
|
||||
if (player.tz && !timeZone) {
|
||||
setTimeZone(player.tz);
|
||||
if (player.timezone && !timeZone) {
|
||||
setTimeZone(player.timezone);
|
||||
}
|
||||
}
|
||||
}, [
|
||||
|
||||
@@ -28,7 +28,7 @@ export const SetupTimeZone: React.FC = () => {
|
||||
const { error } = await updateProfile({
|
||||
playerId: user.id,
|
||||
input: {
|
||||
tz: timeZone
|
||||
timezone: timeZone
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -4,11 +4,11 @@ export const PlayerFragment = gql`
|
||||
fragment PlayerFragment on player {
|
||||
id
|
||||
username
|
||||
totalXp
|
||||
total_xp
|
||||
rank
|
||||
ethereum_address
|
||||
availability_hours
|
||||
tz
|
||||
timezone
|
||||
EnneagramType {
|
||||
description
|
||||
name
|
||||
|
||||
@@ -6,7 +6,7 @@ import { PlayerFragment } from './fragments';
|
||||
|
||||
const playersQuery = gql`
|
||||
query GetPlayers($limit: Int) {
|
||||
player(order_by: { totalXp: desc }, limit: $limit) {
|
||||
player(order_by: { total_xp: desc }, limit: $limit) {
|
||||
...PlayerFragment
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,8 @@ export const UpdateProfileMutation = gql`
|
||||
update_player_by_pk(pk_columns: { id: $playerId }, _set: $input) {
|
||||
id
|
||||
availability_hours
|
||||
tz
|
||||
timezone
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -10,9 +10,9 @@ export interface TimeZoneDisplay {
|
||||
export const getPlayerTimeZoneDisplay = (player: PlayerFragmentFragment): TimeZoneDisplay => {
|
||||
let tzLabel;
|
||||
let offsetLabel;
|
||||
if (player?.tz) {
|
||||
const timeZone = spacetime.now().goto(player.tz)
|
||||
const tzDisplay = display(player.tz)
|
||||
if (player?.timezone) {
|
||||
const timeZone = spacetime.now().goto(player.timezone)
|
||||
const tzDisplay = display(player.timezone)
|
||||
if (tzDisplay && tzDisplay.daylight && tzDisplay.standard) {
|
||||
tzLabel = timeZone.isDST()
|
||||
? tzDisplay.daylight.abbrev
|
||||
@@ -24,7 +24,7 @@ export const getPlayerTimeZoneDisplay = (player: PlayerFragmentFragment): TimeZo
|
||||
offsetLabel = `(GMT ${offset})`;
|
||||
}
|
||||
} else {
|
||||
tzLabel = player.tz;
|
||||
tzLabel = player.timezone;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user