Skip to content

Commit

Permalink
Fixed local footer image
Browse files Browse the repository at this point in the history
  • Loading branch information
pookmish committed Jan 2, 2024
1 parent f42e5ca commit 05f8fca
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/config-pages/local-footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@ import FacebookIcon from "@components/elements/icons/FacebookIcon";
import {Maybe} from "@lib/gql/__generated__/drupal";
import {LocalFooterConfigPageType} from "@lib/drupal/drupal-jsonapi.types";
import {getConfigPageResource} from "@lib/drupal/get-resource";
import {buildUrl} from "@lib/drupal/utils";

const LocalFooter = async () => {
// Fetch from JSON API, it should return a cached version.
const configPage = await getConfigPageResource<LocalFooterConfigPageType>('stanford_local_footer');
if(!configPage || !configPage.su_footer_enabled) return;
if (!configPage || !configPage.su_footer_enabled) return;

const lockupProps = {
useDefault: configPage.su_local_foot_use_loc,
Expand All @@ -36,7 +37,7 @@ const LocalFooter = async () => {
line3: configPage.su_local_foot_line_3,
line4: configPage.su_local_foot_line_4,
line5: configPage.su_local_foot_line_5,
logoUrl: !configPage.su_local_foot_use_logo ? configPage.su_local_foot_loc_img?.uri.url : undefined,
logoUrl: !configPage.su_local_foot_use_logo && configPage.su_local_foot_loc_img?.uri.url ? buildUrl(configPage.su_local_foot_loc_img.uri.url).toString() : undefined,
}

return (
Expand Down

0 comments on commit 05f8fca

Please sign in to comment.