mirror of
https://github.com/MetaFam/TheGame.git
synced 2026-04-24 03:00:09 -04:00
delete unused stuff
This commit is contained in:
@@ -377,15 +377,6 @@ const PlayerStats: React.FC<PlayerStatsProps> = ({ player }) => {
|
||||
>
|
||||
<MenuItem>View Profile</MenuItem>
|
||||
</MetaLink>
|
||||
<MetaLink
|
||||
color="black"
|
||||
href={
|
||||
hasEditedProfile ? '/profile/edit' : '/profile/setup/username'
|
||||
}
|
||||
_hover={{ textDecoration: 'none' }}
|
||||
>
|
||||
<MenuItem>Edit Profile</MenuItem>
|
||||
</MetaLink>
|
||||
<MenuItem onClick={disconnect}>Disconnect</MenuItem>
|
||||
</MenuList>
|
||||
</Menu>
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
import { MetaTag, Wrap, WrapItem } from '@metafam/ds';
|
||||
import { PlayerFragmentFragment } from 'graphql/autogen/types';
|
||||
import { SkillColors } from 'graphql/types';
|
||||
import React from 'react';
|
||||
|
||||
import { ProfileSection } from '../../../../components/ProfileSection';
|
||||
|
||||
type Props = { player: PlayerFragmentFragment };
|
||||
const PlayerSkills: React.FC<Props> = ({ player }) => {
|
||||
if (!player.skills?.length) {
|
||||
return null;
|
||||
}
|
||||
return (
|
||||
<ProfileSection title="Skills">
|
||||
<Wrap>
|
||||
{(player.skills || []).map(({ Skill }) => (
|
||||
<WrapItem key={Skill.id}>
|
||||
<MetaTag
|
||||
size="md"
|
||||
fontWeight="normal"
|
||||
backgroundColor={SkillColors[Skill.category]}
|
||||
>
|
||||
{Skill.name}
|
||||
</MetaTag>
|
||||
</WrapItem>
|
||||
))}
|
||||
</Wrap>
|
||||
</ProfileSection>
|
||||
);
|
||||
};
|
||||
|
||||
export default PlayerSkills;
|
||||
@@ -1,47 +0,0 @@
|
||||
import { Image, Text, Wrap } from '@metafam/ds';
|
||||
import { FlexContainer } from 'components/Container';
|
||||
import { PlayerFragmentFragment } from 'graphql/autogen/types';
|
||||
import { images as BaseImages } from 'graphql/getPersonalityInfo';
|
||||
import React from 'react';
|
||||
|
||||
import { ProfileSection } from '../../../../components/ProfileSection';
|
||||
|
||||
type Props = {
|
||||
player: PlayerFragmentFragment;
|
||||
};
|
||||
const PlayerType: React.FC<Props> = ({ player }) => {
|
||||
if (!player.color_aspect) {
|
||||
return null;
|
||||
}
|
||||
const image = BaseImages[player.color_aspect.mask];
|
||||
|
||||
return (
|
||||
<ProfileSection title="Player Type">
|
||||
<Wrap>
|
||||
<Image
|
||||
w="100%"
|
||||
maxW={16}
|
||||
h={16}
|
||||
src={image}
|
||||
alt={player.color_aspect.name}
|
||||
filter="drop-shadow(0px 0px 3px black)"
|
||||
/>
|
||||
<FlexContainer align="stretch" ml={2}>
|
||||
<Text color="white" casing="uppercase" textAlign="left">
|
||||
{player.color_aspect.name}
|
||||
</Text>
|
||||
<Text
|
||||
color="blueLight"
|
||||
fontWeight="normal"
|
||||
whiteSpace="initial"
|
||||
textAlign="left"
|
||||
>
|
||||
{player.color_aspect.description}
|
||||
</Text>
|
||||
</FlexContainer>
|
||||
</Wrap>
|
||||
</ProfileSection>
|
||||
);
|
||||
};
|
||||
|
||||
export default PlayerType;
|
||||
@@ -1,86 +0,0 @@
|
||||
import { PageContainer } from 'components/Container';
|
||||
import { getPlayer } from 'graphql/getPlayer';
|
||||
import {
|
||||
GetStaticPaths,
|
||||
GetStaticPropsContext,
|
||||
InferGetStaticPropsType,
|
||||
} from 'next';
|
||||
import React from 'react';
|
||||
|
||||
import PlayerSkills from './Section/Skills';
|
||||
import PlayerType from './Section/Type';
|
||||
|
||||
type QueryParams = { username: string };
|
||||
|
||||
type Props = InferGetStaticPropsType<typeof getStaticProps>;
|
||||
|
||||
export const getStaticPaths: GetStaticPaths<QueryParams> = async () => ({
|
||||
paths: [],
|
||||
fallback: true,
|
||||
});
|
||||
|
||||
export const getStaticProps = async (
|
||||
context: GetStaticPropsContext<QueryParams>,
|
||||
) => {
|
||||
const username = context.params?.username;
|
||||
|
||||
if (username == null) {
|
||||
return {
|
||||
redirect: {
|
||||
destination: '/',
|
||||
permanent: false,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
let player = await getPlayer(username);
|
||||
if (player == null) {
|
||||
player = await getPlayer(username.toLowerCase());
|
||||
if (player != null) {
|
||||
return {
|
||||
redirect: {
|
||||
destination: `/profile/${username.toLowerCase()}/edit`,
|
||||
permanent: false,
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
props: {
|
||||
player: player || null,
|
||||
},
|
||||
revalidate: 1,
|
||||
};
|
||||
};
|
||||
|
||||
const EditPage: React.FC<Props> = ({ player }) => {
|
||||
console.log('player', player);
|
||||
|
||||
return (
|
||||
<PageContainer>
|
||||
Main info:
|
||||
<br /> Username:
|
||||
<br /> {player.username} <br />
|
||||
<br /> Time zone:
|
||||
<br /> hours: {player.timezone} <br />
|
||||
<br /> Availability:
|
||||
<br /> hours: {player.availability_hours} <br />
|
||||
<br /> Residence:
|
||||
<br />
|
||||
<br /> Working hours:
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
Secondary info:
|
||||
<br /> Personality type:
|
||||
<br /> title: {player.type.title}
|
||||
<br /> description: {player.type.description} <br />
|
||||
<PlayerType player={player} />
|
||||
<PlayerSkills player={player} />
|
||||
<br />
|
||||
</PageContainer>
|
||||
);
|
||||
};
|
||||
|
||||
export default EditPage;
|
||||
Reference in New Issue
Block a user