1- import { Box , Flex , HStack , Link , Text , VStack } from '@metafam/ds' ;
1+ import { Box , Button , Flex , HStack , Link , Text , VStack } from '@metafam/ds' ;
22import { PlayerAvatar } from 'components/Player/PlayerAvatar' ;
33import { PlayerFragmentFragment } from 'graphql/autogen/types' ;
44import { getPersonalityInfo } from 'graphql/getPersonalityInfo' ;
55import { PersonalityOption } from 'graphql/types' ;
6+ import { useUser } from 'lib/hooks' ;
67import React , { useEffect } from 'react' ;
78import { getPlayerDescription , getPlayerName } from 'utils/playerHelpers' ;
89
@@ -17,6 +18,8 @@ const MAX_BIO_LENGTH = 240;
1718
1819type Props = { player : PlayerFragmentFragment } ;
1920export const PlayerHero : React . FC < Props > = ( { player } ) => {
21+ const { user } = useUser ( ) ;
22+
2023 const description = getPlayerDescription ( player ) ;
2124 const [ show , setShow ] = React . useState ( description . length <= MAX_BIO_LENGTH ) ;
2225 const [ types , setTypes ] = React . useState < {
@@ -33,9 +36,27 @@ export const PlayerHero: React.FC<Props> = ({ player }) => {
3336 loadTypes ( ) ;
3437 } , [ ] ) ;
3538
39+ const isOwnProfile = player . username === user ?. username ;
40+
3641 return (
3742 < ProfileSection >
3843 < VStack spacing = { 8 } >
44+ { isOwnProfile && (
45+ < Flex width = "100%" justifyContent = "end" >
46+ < Button
47+ variant = "outline"
48+ fontFamily = "body"
49+ fontSize = "14px"
50+ borderColor = "purple.600"
51+ backgroundColor = "blackAlpha.400"
52+ href = "/profile/setup/username"
53+ mb = "-4"
54+ _hover = { { backgroundColor : 'blackAlpha.500' } }
55+ >
56+ Edit Profile
57+ </ Button >
58+ </ Flex >
59+ ) }
3960 < PlayerAvatar
4061 w = { { base : 32 , md : 56 } }
4162 h = { { base : 32 , md : 56 } }
0 commit comments