From 464a0966e519e9a9b2f7a5d2584fb819b04a8f04 Mon Sep 17 00:00:00 2001 From: James Walker Date: Sun, 15 Dec 2024 17:36:06 +0000 Subject: [PATCH] Add Instagram URL to Partner view --- src/Theme/Page/Partner.elm | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/Theme/Page/Partner.elm b/src/Theme/Page/Partner.elm index cbdac73..bdd881a 100644 --- a/src/Theme/Page/Partner.elm +++ b/src/Theme/Page/Partner.elm @@ -33,7 +33,7 @@ viewInfo localModel { partner, events } = , section [ css [ contactWrapperStyle ] ] [ div [ css [ contactSectionStyle ] ] [ h3 [ css [ contactHeadingStyle, Theme.Global.smallInlineTitleStyle ] ] [ text (t PartnerContactsHeading) ] - , viewContactDetails partner.maybeUrl partner.maybeContactDetails + , viewContactDetails partner.maybeUrl partner.maybeContactDetails partner.maybeInstagramUrl ] , div [ css [ contactSectionStyle ] ] [ h3 [ css [ contactHeadingStyle, Theme.Global.smallInlineTitleStyle ] ] [ text (t PartnerAddressHeading) ] @@ -110,9 +110,9 @@ viewPartnerEvents events localModel partner = ) -viewContactDetails : Maybe String -> Maybe Data.PlaceCal.Partners.Contact -> Html msg -viewContactDetails maybeUrl maybeContactDetails = - if maybeUrl == Nothing && maybeContactDetails == Nothing then +viewContactDetails : Maybe String -> Maybe Data.PlaceCal.Partners.Contact -> Maybe String -> Html msg +viewContactDetails maybeUrl maybeContactDetails maybeInstagramUrl = + if maybeUrl == Nothing && maybeContactDetails == Nothing && maybeInstagramUrl == Nothing then p [ css [ contactItemStyle ] ] [ text (t PartnerContactsEmptyText) ] else @@ -146,6 +146,12 @@ viewContactDetails maybeUrl maybeContactDetails = Just url -> p [ css [ contactItemStyle ] ] [ a [ href url, target "_blank", css [ linkStyle ] ] [ text (Copy.Text.urlToDisplay url) ] ] + Nothing -> + text "" + , case maybeInstagramUrl of + Just url -> + p [ css [ contactItemStyle ] ] [ a [ href url, target "_blank", css [ linkStyle ] ] [ text (Copy.Text.urlToDisplay url) ] ] + Nothing -> text "" ]