Browse Source

fix: check for activity presence

pull/35/head
Dale 2 weeks ago
parent
commit
2f53938f81
Signed by: Deiru GPG Key ID: AA250C0277B927E1
  1. 26
      src/client/ChannelPage/Channel.tsx
  2. 33
      src/client/UserProfile/Profile.tsx

26
src/client/ChannelPage/Channel.tsx

@ -176,18 +176,20 @@ export const ChannelView = ({
{status?.isLive && <CircleIcon color="red" mr={2} />}
{channel.name}
</Heading>
<Flex align="center">
{channel?.activity?.icon && (
<Image
w="1.7rem"
h="1.7rem"
src={getMediaURL(channel.activity.icon.filename)}
/>
)}
<Text>
{channel.activity.verb} {channel.activity.name}
</Text>
</Flex>
{channel.activity && (
<Flex align="center">
{channel?.activity?.icon && (
<Image
w="1.7rem"
h="1.7rem"
src={getMediaURL(channel.activity.icon.filename)}
/>
)}
<Text>
{channel.activity.verb} {channel.activity?.name}
</Text>
</Flex>
)}
</Flex>
<Flex align="center">
<Flex title="Subscribers:" align="center" mr={2}>

33
src/client/UserProfile/Profile.tsx

@ -115,21 +115,24 @@ export const UserProfile = ({
<Heading as={Flex} align="bottom" mb={2} mr={2}>
{user?.settings?.singleUserChannel?.name}
</Heading>
<Flex align="center">
{user?.settings?.singleUserChannel?.activity?.icon && (
<Image
w="1.7rem"
h="1.7rem"
src={getMediaURL(
user?.settings?.singleUserChannel?.activity.icon.filename
)}
/>
)}
<Text>
{user?.settings?.singleUserChannel?.activity.verb}{" "}
{user?.settings?.singleUserChannel?.activity.name}
</Text>
</Flex>
{user?.settings?.singleUserChannel?.activity && (
<Flex align="center">
{user?.settings?.singleUserChannel?.activity?.icon && (
<Image
w="1.7rem"
h="1.7rem"
src={getMediaURL(
user?.settings?.singleUserChannel?.activity.icon
.filename
)}
/>
)}
<Text>
{user?.settings?.singleUserChannel?.activity?.verb}{" "}
{user?.settings?.singleUserChannel?.activity?.name}
</Text>
</Flex>
)}
</Flex>
{user?.settings?.singleUserChannel?.description && (
<Box order={isMobile ? 1 : 2}>

Loading…
Cancel
Save