Skip to content

Commit

Permalink
Merge branch 'main' into cleanup-header
Browse files Browse the repository at this point in the history
  • Loading branch information
vinnyjth authored Jan 31, 2024
2 parents 43f708e + b69445a commit 33d1d11
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 65 deletions.
20 changes: 16 additions & 4 deletions packages/web-shared/components/ContentSingle.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { add as addBreadcrumb, useBreadcrumbDispatch } from '../providers/Breadc
import { set as setModal, useModal } from '../providers/ModalProvider';

import { Box, Loader, Longform, H3, ContentCard, BodyText, ShareButton } from '../ui-kit';
import { useHTMLContent, useVideoMediaProgress } from '../hooks';
import { useFeatureFeed, useHTMLContent, useVideoMediaProgress } from '../hooks';
import { Title, ParentTitle, ParentSummary } from './ContentSingle.styles';

import VideoPlayer from './VideoPlayer';
Expand All @@ -27,6 +27,17 @@ function ContentSingle(props = {}) {
const [state, dispatch] = useModal();
const parseHTMLContent = useHTMLContent();

const feedId = props?.data?.featureFeed?.id;
const {
feedLoading,
feedError,
data: feedData,
} = useFeatureFeed({
variables: {
itemId: feedId,
},
});

const invalidPage = !props.loading && !props.data;

// Video details
Expand Down Expand Up @@ -70,7 +81,6 @@ function ContentSingle(props = {}) {
parentChannel,
childContentItemsConnection,
siblingContentItemsConnection,
featureFeed,
parentItem,
} = props?.data;

Expand All @@ -79,7 +89,9 @@ function ContentSingle(props = {}) {
const hasChildContent = childContentItems?.length > 0;
const hasSiblingContent = siblingContentItems?.length > 0;
const hasParent = !!parentItem;
const validFeatures = featureFeed?.features?.filter(

const feed = feedData?.node;
const validFeatures = feed?.features?.filter(
(feature) => !!FeatureFeedComponentMap[feature?.__typename]
);
const hasFeatures = validFeatures?.length;
Expand Down Expand Up @@ -342,7 +354,7 @@ function ContentSingle(props = {}) {
{/* Sub-Feature Feed */}
{hasFeatures ? (
<Box my="l">
<FeatureFeed data={featureFeed} />
<FeatureFeed data={feed} />
</Box>
) : null}
</Box>
Expand Down
56 changes: 0 additions & 56 deletions packages/web-shared/hooks/useContentItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,62 +88,6 @@ export const GET_CONTENT_ITEM = gql`
... on FeaturesNode {
featureFeed {
id
features {
id
... on HorizontalCardListFeature {
title
cards {
id
title
summary
coverImage {
name
sources {
uri
}
}
hasAction
action
actionIcon
relatedNode {
id
__typename
... on ContentItem {
title
}
... on Url {
url
}
}
}
}
... on ButtonFeature {
action {
title
action
relatedNode {
id
__typename
... on Url {
url
}
}
}
}
... on HtmlFeature {
content
}
... on ScriptureFeature {
scriptures {
id
html
reference
copyright
version
text
}
}
}
}
}
}
Expand Down
26 changes: 26 additions & 0 deletions packages/web-shared/hooks/useFeatureFeed.js
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,32 @@ export const FEED_FEATURES = gql`
}
}
}
... on ButtonFeature {
action {
title
action
relatedNode {
id
__typename
... on Url {
url
}
}
}
}
... on HtmlFeature {
content
}
... on ScriptureFeature {
scriptures {
id
html
reference
copyright
version
text
}
}
}
}
}
Expand Down
8 changes: 3 additions & 5 deletions web-embeds/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,9 @@
<div data-church="liquid_church" data-type="Auth" data-modal="true" class="apollos-widget"
style="max-width: 1180px; padding: 40px; margin: auto; margin-top: 20px"></div>
<div data-type="FeatureFeed" data-church="liquid_church"
data-feature-feed="FeatureFeed:04160599-4edf-4824-98c5-02c1a8854c48" data-modal="true" class="apollos-widget">
</div>
<div data-type="FeatureFeed" data-church="liquid_church"
data-feature-feed="FeatureFeed:e5d913ee-0f28-45a3-8f71-f5ce2ae6cb3b" data-modal="true" class="apollos-widget">
</div>
data-feature-feed="FeatureFeed:d3912726-487b-4635-9cec-99ed84a21209" data-modal="true" class="apollos-widget"></div>


<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
Expand Down

0 comments on commit 33d1d11

Please sign in to comment.