mirror of
https://github.com/MetaFam/TheGame.git
synced 2026-04-24 03:00:09 -04:00
* removing BrightId *(unused)* and DAOHaus memberships *(loaded separately)* from `Player` retreival 🦷 * setting `max-width` on hamburger menu 🧾 * increasing shown DAOs, shunting remote schemas, & handling missing Discord token 🤐 * triggering recalc on element resize 🚲 * adding copy of ETH address on profile image click 🛹 * adding `@emotion/cache` to try and eliminate unstyled content render ⚓ * cleaning up failed emotion cache experiment 🚓 * updating Ceramic & locking versions to beat a dependency conflict 🤲🏿
29 lines
796 B
TypeScript
29 lines
796 B
TypeScript
import type { AvatarProps } from '@metafam/ds';
|
|
import { SquareImage } from 'components/SquareImage';
|
|
import type { Player } from 'graphql/autogen/types';
|
|
import type { GuildPlayer } from 'graphql/types';
|
|
import { useProfileField } from 'lib/hooks';
|
|
import React from 'react';
|
|
import { getPlayerImage } from 'utils/playerHelpers';
|
|
|
|
type PlayerProfilePictureProps = AvatarProps & {
|
|
player?: Player | GuildPlayer;
|
|
};
|
|
|
|
export const PlayerProfilePicture: React.FC<PlayerProfilePictureProps> = ({
|
|
player: user,
|
|
src: source,
|
|
...props
|
|
}) => {
|
|
const player = user as Player;
|
|
const { value: image } = useProfileField({
|
|
field: 'profileImageURL',
|
|
player,
|
|
getter: getPlayerImage,
|
|
});
|
|
|
|
const src = source ?? image ?? undefined;
|
|
|
|
return <SquareImage {...{ src, ...props }} />;
|
|
};
|