-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #45 from input-output-hk/PLT-7427
PLT-7427 - Add button to export contract to Marlowe Runner
- Loading branch information
Showing
9 changed files
with
132 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<!-- | ||
A new scriv changelog fragment. | ||
Uncomment the section that is right (remove the HTML comment wrapper). | ||
--> | ||
|
||
<!-- | ||
### Removed | ||
- A bullet item for the Removed category. | ||
--> | ||
|
||
### Added | ||
|
||
- Added button to export contracts to Marlowe Runner | ||
|
||
|
||
<!-- | ||
### Changed | ||
- A bullet item for the Changed category. | ||
--> | ||
<!-- | ||
### Deprecated | ||
- A bullet item for the Deprecated category. | ||
--> | ||
<!-- | ||
### Fixed | ||
- A bullet item for the Fixed category. | ||
--> | ||
<!-- | ||
### Security | ||
- A bullet item for the Security category. | ||
--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,6 +41,7 @@ | |
, "integers" | ||
, "js-object" | ||
, "js-timers" | ||
, "js-uri" | ||
, "json-helpers" | ||
, "lists" | ||
, "markdown" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
module ExportToRunner (exportToRunnerForm) where | ||
|
||
import Prologue hiding (div) | ||
|
||
import Component.Modal.ViewHelpers (modalHeader) | ||
import Data.Tuple.Nested ((/\)) | ||
import Gists.View (idPublishGist) | ||
import Halogen.Classes (modalContent) | ||
import Halogen.HTML (ClassName(..), HTML, a, div, div_, p, text) | ||
import Halogen.HTML.Events (onClick) | ||
import Halogen.HTML.Properties (classes) | ||
import MainFrame.Types (Action(..), State) | ||
|
||
exportToRunnerForm :: forall p. String -> State -> HTML p Action | ||
exportToRunnerForm contractString _state = | ||
div_ | ||
[ modalHeader "Export to Marlowe Runner" (Just CloseModal) | ||
, div [ classes [ modalContent ] ] | ||
[ p [ classes [ ClassName "mb-3" ] ] | ||
[ text | ||
"On what network would you like to deploy the contract?" | ||
] | ||
, div_ | ||
do | ||
(title /\ url) <- | ||
[ ("Mainnet" /\ "https://mainnet.runner.marlowe.iohk.io/") | ||
, ("Preprod" /\ "https://preprod.runner.marlowe.iohk.io/") | ||
, ("Preview" /\ "https://preview.runner.marlowe.iohk.io/") | ||
] | ||
pure $ a | ||
[ idPublishGist | ||
, classes [ ClassName "auth-button", ClassName "mx-3" ] | ||
, onClick $ const $ SendToRunner url contractString | ||
] | ||
[ text title | ||
] | ||
] | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters