Skip to content

Commit

Permalink
Fixes the About Us page crashing [#23]
Browse files Browse the repository at this point in the history
  • Loading branch information
AkimaLunar committed Jul 24, 2020
1 parent 9fe4845 commit 456f211
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
3 changes: 1 addition & 2 deletions src/components/constructs/Figure/Figure.js
Expand Up @@ -8,8 +8,7 @@ import clientConfig from '../../../../config/client';
import Image from '@elements/Image';

const Figure = ({ className, node }) => {
console.log('Figure', node);
if (!node || !node.asset || !node.asset._ref) {
if (!node?.asset?._ref) {
return null;
}
const fluid = getFluidGatsbyImage(
Expand Down
8 changes: 3 additions & 5 deletions src/components/views/AboutUs/AboutUs.js
@@ -1,7 +1,6 @@
import React, { useMemo } from 'react';
import React from 'react';
import PropTypes from 'prop-types';
import { withSpacing } from '@utilities/styles/spacing';
import { constructStyles } from './AboutUs.styles';

import BlockContent from '@sanity/block-content-to-react';
import Box from '@elements/Box';
Expand All @@ -14,10 +13,9 @@ const serializers = {
},
};

const AboutUs = ({ className, blocks, title, ...restProps }) => {
const styles = useMemo(() => constructStyles(restProps), [restProps]);
const AboutUs = ({ className, blocks, title }) => {
return (
<Box my10 article css={styles} className={className}>
<Box my10 article className={className}>
<Text element="h1" title color="tertiary">
{title}
</Text>
Expand Down

0 comments on commit 456f211

Please sign in to comment.