diff --git a/src/components/Footer/Subscription/subscription.js b/src/components/Footer/Subscription/subscription.js index a487bd21..6305d1af 100644 --- a/src/components/Footer/Subscription/subscription.js +++ b/src/components/Footer/Subscription/subscription.js @@ -6,6 +6,10 @@ import "./subscription.scss" export default function Subscription() { const data = useFooter() const dataSubscription = data?.allStrapiLayout?.nodes[0]?.footer?.subscription + const subscriptionUrl = dataSubscription?.url + const subscriptionLanding = dataSubscription?.landing_page?.slug + + const isExternalLink = subscriptionUrl?.startsWith('http') return (
@@ -13,13 +17,27 @@ export default function Subscription() {
) -} +} \ No newline at end of file diff --git a/src/hooks/useFooter.js b/src/hooks/useFooter.js index c73e894e..2827a39b 100644 --- a/src/hooks/useFooter.js +++ b/src/hooks/useFooter.js @@ -74,6 +74,10 @@ const useFooter = () => { } subscription { title + url + landing_page { + slug + } } } } @@ -82,5 +86,4 @@ const useFooter = () => { `) } -export default useFooter - +export default useFooter \ No newline at end of file diff --git a/src/schema/layoutSchema.js b/src/schema/layoutSchema.js index fabdde60..c68bbd6a 100644 --- a/src/schema/layoutSchema.js +++ b/src/schema/layoutSchema.js @@ -117,7 +117,34 @@ type StrapiLayoutNavbarNavButtonLanding_page { type StrapiLayoutFooterSubscription { id: Int title: String + url: String + landing_page: StrapiLayoutFooterSubscriptionLanding } + + type StrapiLayoutFooterSubscriptionLanding { + id: Int + name: String + slug: String + published_at( + formatString: String + fromNow: Boolean + difference: String + locale: String + ): Date + created_at( + formatString: String + fromNow: Boolean + difference: String + locale: String + ): Date + updated_at( + formatString: String + fromNow: Boolean + difference: String + locale: String + ): Date + } + type StrapiLayoutFooterNavegation { id: Int diff --git a/src/schema/schema.js b/src/schema/schema.js index 3591b8d4..c17b7bf9 100644 --- a/src/schema/schema.js +++ b/src/schema/schema.js @@ -1308,6 +1308,32 @@ type StrapiLayoutNavbarLogo { type StrapiLayoutFooterSubscription { id: Int title: String + url: String + landing_page: StrapiLayoutFooterSubscriptionLanding +} + +type StrapiLayoutFooterSubscriptionLanding { + id: Int + name: String + slug: String + published_at( + formatString: String + fromNow: Boolean + difference: String + locale: String + ): Date + created_at( + formatString: String + fromNow: Boolean + difference: String + locale: String + ): Date + updated_at( + formatString: String + fromNow: Boolean + difference: String + locale: String + ): Date } type StrapiLayoutFooterNavegation {