Skip to content

Commit

Permalink
Merge pull request compound-finance#1 from protofire/harmony-stg
Browse files Browse the repository at this point in the history
feat: add get one page
  • Loading branch information
lijiang2087 authored Oct 8, 2024
2 parents 4912b49 + 4d849e8 commit 36c11b4
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/elm/DappInterface/CommonViews.elm
Original file line number Diff line number Diff line change
Expand Up @@ -179,11 +179,13 @@ pageHeader userLanguage page connectedWallet account _ governanceState _ =
v2MarketsExternalLink = "https://app.compound.finance/markets?market=v2"
v3VoteExternalLink = "https://app.compound.finance/vote"
swapLink = "https://swap.harmony.one"
getOneLink = "/#getone"
in
[ a (class homeClass :: href PageNavigation (getHrefUrl Home)) [ text (Translations.dashboard userLanguage) ]
-- , a (href External (v2MarketsExternalLink)) [ text (Translations.markets userLanguage) ]
-- , a (href External (v3VoteExternalLink)) [ text (Translations.vote userLanguage) ]
, a ([target "_blank"] ++ href External swapLink) [text ("Swap")]
, a ([target "_self"] ++ href External getOneLink) [text ("Get ONE")]
]
in
header [ class "dapp" ]
Expand Down
21 changes: 21 additions & 0 deletions src/elm/DappInterface/GetOne.elm
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module DappInterface.GetOne exposing (view)

import CompoundComponents.Utils.CompoundHtmlAttributes exposing (HrefLinkType(..), class, href, id, type_)
import Html exposing (Html, a, b, div, h2, h4, label, li, ol, p, section, span, text, u, iframe)
import Html.Attributes exposing (name, width, height, src)
import Strings.Terms as Terms
import Strings.Translations as Translations


view : Translations.Lang -> Html msg
view userLanguage =
div [ id "getone", class "exchange-container" ]
[
iframe [
id "simpleswap-frame"
,name "SimpleSwap Widget"
,width 528
,height 600
,src "https://simpleswap.io/widget/62d3bc7d-58e0-4815-87da-36fa3bd878ac"
] []
]
10 changes: 10 additions & 0 deletions src/elm/DappInterface/Page.elm
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ type Page
| CrowdPropose
| TermsOfService
| Vote
| GetOne


buildTitle : Translations.Lang -> Maybe String -> String
Expand Down Expand Up @@ -49,6 +50,9 @@ getPageTitle userLanguage page =
Vote ->
buildTitle userLanguage (Just (Translations.site_title_vote userLanguage))

GetOne ->
buildTitle userLanguage (Just (Translations.site_title_v2 userLanguage))


getHrefUrl : Page -> String
getHrefUrl page =
Expand All @@ -74,6 +78,9 @@ getHrefUrl page =
Vote ->
"#vote"

GetOne ->
"#getone"


getPage : Url.Url -> Page
getPage location =
Expand All @@ -85,6 +92,9 @@ getPage location =
Just [ "admin" ] ->
Admin

Just [ "getone" ] ->
GetOne

Just [ "liquidate" ] ->
Home

Expand Down
8 changes: 8 additions & 0 deletions src/elm/Main.elm
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import DappInterface.Page exposing (Page(..), getPage, getPageTitle)
import DappInterface.PrimaryActionModal
import DappInterface.Propose as Propose
import DappInterface.Terms as DappTerms
import DappInterface.GetOne as GetOne
import DappInterface.Vote as Vote
import Decimal exposing (Decimal)
import Dict exposing (Dict)
Expand Down Expand Up @@ -1195,6 +1196,13 @@ viewFull ({ page, liquidateModel, transactionState, compoundState, tokenState, o
, replFooter
]

GetOne ->
[ header
, GetOne.view userLanguage
, footer
, replFooter
]

Vote ->
[ alertView model
, header
Expand Down
16 changes: 16 additions & 0 deletions src/scss/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -950,6 +950,22 @@ body {
margin: 0 0;
}

.exchange-container {
width: 100%;
height: 100%;
border: none !important;
display: flex;
justify-content: center;
align-items: center;

iframe {
margin-top: 100px;
border: none !important;
width: 528px;
height: 600px;
}
}

@media (max-width: $device-sm) {
.mobile-hide {
display: none;
Expand Down

0 comments on commit 36c11b4

Please sign in to comment.