Skip to content

Commit

Permalink
Merge pull request #2376 from Plant-for-the-Planet-org/feature/widget…
Browse files Browse the repository at this point in the history
…s-logic-update

Improve user widget rendering and handle null cases
  • Loading branch information
mariahosfeld authored Jan 22, 2025
2 parents 2b10701 + 5874a7e commit 36cb55c
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions pages/sites/[slug]/[locale]/profile/widgets.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,19 @@ function ProfilePage({ pageProps: { tenantConfig } }: Props): ReactElement {
<Head>
<title>{t('widgets')}</title>
</Head>
{user?.isPrivate === false ? (
<div className={styles.widgetsContainer}>
<iframe
src={`${process.env.WIDGET_URL}?user=${user?.id}&tenantkey=${tenantConfig.id}`}
className={styles.widgetIFrame}
/>
</div>
) : (
<EmbedModal {...embedModalProps} />
{user !== null && (
<>
{user.isPrivate === false ? (
<div className={styles.widgetsContainer}>
<iframe
src={`${process.env.WIDGET_URL}?user=${user.slug}&tenantkey=${tenantConfig.id}`}
className={styles.widgetIFrame}
/>
</div>
) : (
<EmbedModal {...embedModalProps} />
)}
</>
)}
</UserLayout>
) : (
Expand Down

0 comments on commit 36cb55c

Please sign in to comment.