Skip to content

Commit

Permalink
Display community logo on header
Browse files Browse the repository at this point in the history
  • Loading branch information
mbeps committed Feb 18, 2023
1 parent 4887bc9 commit 70fac5e
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/components/Community/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,17 @@ const Header: React.FC<HeaderProps> = ({ communityData }) => {
<Box height="50%" bg="red.500" />
<Flex justify="center" bg="white" flexGrow={1}>
<Flex width="95%" maxWidth="860px" align="center">
{communityData.imageURL ? (
{/* using state instead of fetching from db as no refresh of the page is required */}
{communityStateValue.currentCommunity?.imageURL ? (
// If community has image then display the image
<Image />
<Image
src={communityStateValue.currentCommunity.imageURL}
borderRadius="full"
boxSize="66px"
alt="Community icons"
color="red.500"
border="3px solid white"
/>
) : (
// If the community has no image, show this default preset one
<Icon
Expand Down

0 comments on commit 70fac5e

Please sign in to comment.