Skip to content

Commit

Permalink
Merge pull request #752 from CodeForAfrica/ft/fix-image-loading
Browse files Browse the repository at this point in the history
Fix image loading
  • Loading branch information
koechkevin authored Jul 3, 2024
2 parents 1f52ad2 + d1a3043 commit 33eec4c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions apps/roboshield/.env
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ PAYLOAD_PUBLIC_LOCALES="en"
SENTRY_ENVIRONMENT=local
SENTRY_ORG=code-for-africa
SENTRY_PROJECT=roboshield

NEXT_PUBLIC_IMAGE_DOMAINS="*.codeforafrica.org"
NEXT_PUBLIC_IMAGE_UNOPTIMIZED="true"
8 changes: 8 additions & 0 deletions apps/roboshield/next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ const nextConfig = {
config.experiments = { ...config.experiments, topLevelAwait: true }; // eslint-disable-line no-param-reassign
return config;
},
images: {
domains: process.env.NEXT_PUBLIC_IMAGE_DOMAINS?.split(",")
?.map((d) => d.trim())
?.filter((d) => d),
unoptimized:
process.env.NEXT_PUBLIC_IMAGE_UNOPTIMIZED?.trim()?.toLowerCase() ===
"true",
},
};

export default withSentryConfig(nextConfig, {
Expand Down

0 comments on commit 33eec4c

Please sign in to comment.