diff --git a/src/app/[path]/forms/[form]/page.tsx b/src/app/[path]/forms/[form]/page.tsx index bde9ab4..ca49c15 100644 --- a/src/app/[path]/forms/[form]/page.tsx +++ b/src/app/[path]/forms/[form]/page.tsx @@ -13,6 +13,15 @@ interface PageProps { }; } +const isValidUrl = (url: string): boolean => { + try { + new URL(url); + return true; + } catch (e) { + return false; + } +}; + const Page = async ({ params }: PageProps) => { const { form } = params; const { interviewsByTopic, isError } = await fetchInterviews('ma'); @@ -46,7 +55,8 @@ const Page = async ({ params }: PageProps) => { {formDetails.metadata.description} {(formDetails.metadata.help_page_url || - formDetails.metadata.original_form) && ( + (formDetails.metadata.original_form && + isValidUrl(formDetails.metadata.original_form))) && ( <>

More information: @@ -59,13 +69,17 @@ const Page = async ({ params }: PageProps) => { )} - {formDetails.metadata.original_form && ( -

  • - - Original form - -
  • - )} + {formDetails.metadata.original_form && + isValidUrl(formDetails.metadata.original_form) && ( +
  • + + Original form + +
  • + )} )} diff --git a/src/app/css/AffiliatesSection.module.css b/src/app/css/AffiliatesSection.module.css index 547fc18..21eafca 100644 --- a/src/app/css/AffiliatesSection.module.css +++ b/src/app/css/AffiliatesSection.module.css @@ -1,13 +1,12 @@ .AffiliatesSection { - background: rgba(0,0,0,.1); - + background: rgba(0, 0, 0, 0.1); } .AffiliatesContainer { margin-right: auto; margin-left: auto; max-width: 576px; - + & > :not(:last-child) { margin-bottom: 1em; } @@ -16,4 +15,4 @@ .AffiliateLogo { height: auto; max-width: 100%; -} \ No newline at end of file +} diff --git a/src/app/css/AllFormsContainer.module.css b/src/app/css/AllFormsContainer.module.css index 76e95a2..c0355bd 100644 --- a/src/app/css/AllFormsContainer.module.css +++ b/src/app/css/AllFormsContainer.module.css @@ -1,3 +1,3 @@ .AllFormsContainer { max-width: calc(992px); -} \ No newline at end of file +} diff --git a/src/app/css/Footer.module.css b/src/app/css/Footer.module.css index 4f3cafb..1518455 100644 --- a/src/app/css/Footer.module.css +++ b/src/app/css/Footer.module.css @@ -9,4 +9,4 @@ margin-right: auto; max-width: 576px; width: 100%; -} \ No newline at end of file +} diff --git a/src/app/css/FormPage.module.css b/src/app/css/FormPage.module.css index 435e798..9eb0e6d 100644 --- a/src/app/css/FormPage.module.css +++ b/src/app/css/FormPage.module.css @@ -1,3 +1,3 @@ .FormPage { max-width: 768px; -} \ No newline at end of file +} diff --git a/src/app/css/HeroSection.module.css b/src/app/css/HeroSection.module.css index 83c6983..6a61e22 100644 --- a/src/app/css/HeroSection.module.css +++ b/src/app/css/HeroSection.module.css @@ -4,4 +4,4 @@ & textarea { min-height: 6lh; } -} \ No newline at end of file +} diff --git a/src/app/css/HowItWorksSection.module.css b/src/app/css/HowItWorksSection.module.css index 0a8086b..09b647e 100644 --- a/src/app/css/HowItWorksSection.module.css +++ b/src/app/css/HowItWorksSection.module.css @@ -1,3 +1,3 @@ .HowItWorksSection { background-color: #3e7d9a54; -} \ No newline at end of file +} diff --git a/src/app/css/InteractiveForm.module.css b/src/app/css/InteractiveForm.module.css index 76c8c2b..c26a63c 100644 --- a/src/app/css/InteractiveForm.module.css +++ b/src/app/css/InteractiveForm.module.css @@ -1,7 +1,7 @@ .Form { gap: 1rem; - &:last-child{ + &:last-child { border-bottom: 0 !important; } @@ -12,7 +12,6 @@ } } - .FormTitleContainer { max-width: 768px; } @@ -24,7 +23,6 @@ } } - .FormButtonContainer { margin-left: auto; @@ -33,4 +31,4 @@ margin-left: 0; } } -} \ No newline at end of file +} diff --git a/src/app/css/NavigationBar.module.css b/src/app/css/NavigationBar.module.css index b2fe640..bfc1d7b 100644 --- a/src/app/css/NavigationBar.module.css +++ b/src/app/css/NavigationBar.module.css @@ -21,7 +21,6 @@ &:not(:hover) { text-decoration: none; } - } .AllFormsPath { @@ -29,7 +28,7 @@ } .ExternalLinkIcon { - height: .8em; - width: .8em; + height: 0.8em; + width: 0.8em; vertical-align: top; -} \ No newline at end of file +} diff --git a/src/app/css/SearchSection.module.css b/src/app/css/SearchSection.module.css index 10a7136..58000c1 100644 --- a/src/app/css/SearchSection.module.css +++ b/src/app/css/SearchSection.module.css @@ -1,3 +1,3 @@ .ClearSearchButton { font-size: 80%; -} \ No newline at end of file +} diff --git a/src/app/css/ShowAllToggle.module.css b/src/app/css/ShowAllToggle.module.css index 53306f5..3a333ac 100644 --- a/src/app/css/ShowAllToggle.module.css +++ b/src/app/css/ShowAllToggle.module.css @@ -3,4 +3,4 @@ border: none !important; background: #002e60 !important; margin-top: 10px; -} \ No newline at end of file +} diff --git a/src/app/css/ThankYou.module.css b/src/app/css/ThankYou.module.css index 106fc54..89f28f0 100644 --- a/src/app/css/ThankYou.module.css +++ b/src/app/css/ThankYou.module.css @@ -6,4 +6,4 @@ height: auto; max-width: 100%; } -} \ No newline at end of file +} diff --git a/src/app/css/TopicCard.module.css b/src/app/css/TopicCard.module.css index a7ccbde..101d939 100644 --- a/src/app/css/TopicCard.module.css +++ b/src/app/css/TopicCard.module.css @@ -17,7 +17,7 @@ .TagContainer { overflow: hidden; transition: max-height 0.4s ease-in-out; - gap: .5rem; + gap: 0.5rem; } .FormTag { @@ -46,4 +46,4 @@ } .ShowContainer { -} \ No newline at end of file +} diff --git a/src/app/css/TopicPage.module.css b/src/app/css/TopicPage.module.css index 061cc73..ac58741 100644 --- a/src/app/css/TopicPage.module.css +++ b/src/app/css/TopicPage.module.css @@ -1,3 +1,3 @@ .TopicPage { max-width: 768px; -} \ No newline at end of file +} diff --git a/src/app/css/TopicsSection.module.css b/src/app/css/TopicsSection.module.css index 78a5494..274f5e8 100644 --- a/src/app/css/TopicsSection.module.css +++ b/src/app/css/TopicsSection.module.css @@ -1,3 +1,3 @@ .TopicsSection { background-color: #fbfafe; -} \ No newline at end of file +} diff --git a/src/app/globals.css b/src/app/globals.css index 12f9f3b..ca6cb10 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -53,4 +53,4 @@ h5, /* Removes body bottom padding if the last child element is the affiliates section. */ .body-container:has(#affiliates-section:last-child) { padding-bottom: 0 !important; -} \ No newline at end of file +}