From b0d71e5091fdafddfdb5f41a4bb3860e02272d92 Mon Sep 17 00:00:00 2001 From: Larry Adames Date: Wed, 20 Sep 2023 13:38:42 -0400 Subject: [PATCH] PLT-7515 update layout of landing page --- public/images/twotone_wallet.svg | 7 ++++ src/Component/LandingPage.purs | 59 +++++++++++++++++++------------- 2 files changed, 42 insertions(+), 24 deletions(-) create mode 100644 public/images/twotone_wallet.svg diff --git a/public/images/twotone_wallet.svg b/public/images/twotone_wallet.svg new file mode 100644 index 00000000..80807bc6 --- /dev/null +++ b/public/images/twotone_wallet.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/src/Component/LandingPage.purs b/src/Component/LandingPage.purs index 7ca85435..d4768fa7 100644 --- a/src/Component/LandingPage.purs +++ b/src/Component/LandingPage.purs @@ -5,6 +5,7 @@ import Prelude import Component.ConnectWallet (mkConnectWallet) import Component.ConnectWallet as ConnectWallet import Component.Types (ContractInfo, MkComponentMBase, WalletInfo) +import Component.BodyLayout as BodyLayout import Contrib.React.Svg (SvgUrl(..), svgImg) import Data.Map (Map) import Data.Maybe (Maybe(..)) @@ -15,7 +16,7 @@ import Effect.Exception (Error) import JS.Unsafe.Stringify (unsafeStringify) import Marlowe.Runtime.Web.Types as Runtime import React.Basic (JSX) -import React.Basic.DOM (text) as DOOM +import React.Basic.DOM (text, img) as DOOM import React.Basic.DOM.Simplified.Generated as DOM import React.Basic.Hooks (component, useState') import React.Basic.Hooks as React @@ -49,30 +50,40 @@ mkLandingPage = do connectWallet <- mkConnectWallet liftEffect $ component "LandingPage" \{ setWalletInfo } -> React.do possibleErrors /\ setErrors <- useState' Nothing - pure $ DOM.div {} $ - [ DOM.nav { className: "navbar navbar-expand-sm navbar-light bg-light fix-top" } $ - DOM.div { className: "container-fluid" } - [ DOM.a { href: "#", className: "navbar-brand" } - [ svgImg { src: marloweLogoUrl } ] + pure $ BodyLayout.component + { title: DOM.div { className: "px-3 mx-3 fw-bold" } + [ DOOM.img { src: "/images/twotone_wallet.svg" } + , DOM.h3 { className: "fw-bold" } $ DOOM.text "Choose a wallet to deploy a Marlowe smart contract" + ] + , description: + DOM.div { className: "px-3 mx-3" } + [ DOM.p {} [ DOOM.text "Selecting a wallet is your first step in deploying a smart contract, your choice should be compatible with the blockchain network you want to deploy your contract on." ] ] - , DOM.div { className: "container-fluid" } - $ DOM.div { className: "row justify-content-center" } - $ DOM.div { className: "col-xl-5 col-lg-8 col-12" } - [ case possibleErrors of - -- FIXME: Should we present errors on the connectWallet level? - Just NoWallets -> DOOM.text "NO WALLETS?" - Just (ConnectionError err) -> DOOM.text $ unsafeStringify err - Nothing -> connectWallet - { currentlyConnected: Nothing - , onWalletConnect: case _ of - ConnectWallet.Connected walletInfo -> setWalletInfo walletInfo - ConnectWallet.NoWallets -> setErrors $ Just NoWallets - ConnectWallet.ConnectionError err -> setErrors $ Just $ ConnectionError err - , onDismiss: pure unit - , inModal: false - } - ] - ] + , content: DOM.div {} $ + [ DOM.nav { className: "navbar navbar-expand-sm navbar-light bg-light fix-top" } $ + DOM.div { className: "container-fluid" } + [ DOM.a { href: "#", className: "navbar-brand" } + [ svgImg { src: marloweLogoUrl } ] + ] + , DOM.div { className: "container-fluid" } + $ DOM.div { className: "row justify-content-center" } + $ DOM.div { className: "col-xl-5 col-lg-8 col-12" } + [ case possibleErrors of + -- FIXME: Should we present errors on the connectWallet level? + Just NoWallets -> DOOM.text "NO WALLETS?" + Just (ConnectionError err) -> DOOM.text $ unsafeStringify err + Nothing -> connectWallet + { currentlyConnected: Nothing + , onWalletConnect: case _ of + ConnectWallet.Connected walletInfo -> setWalletInfo walletInfo + ConnectWallet.NoWallets -> setErrors $ Just NoWallets + ConnectWallet.ConnectionError err -> setErrors $ Just $ ConnectionError err + , onDismiss: pure unit + , inModal: false + } + ] + ] + } marloweLogoUrl :: SvgUrl marloweLogoUrl = SvgUrl "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYwIiBoZWlnaHQ9IjQyIiB2aWV3Qm94PSIwIDAgMTYwI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