Skip to content

Commit 4862e3e

Browse files
authored
Merge pull request IntersectMBO#3816 from input-output-hk/hrajchert/scp-2591-implement-no-possible-action-card
SCP-2591 - Marlowe Run Client - implement no actions card
2 parents 1a5621c + 335f251 commit 4862e3e

File tree

6 files changed

+115
-41
lines changed

6 files changed

+115
-41
lines changed

marlowe-dashboard-client/package-lock.json

Lines changed: 65 additions & 35 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

marlowe-dashboard-client/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"purescript-psa": "^0.8.2",
3535
"purs-loader": "^3.7.2",
3636
"raw-loader": "^4.0.2",
37-
"tailwindcss": "^2.2.4",
37+
"tailwindcss": "^2.2.7",
3838
"webpack": "^5.36.2",
3939
"webpack-cli": "^4.6.0",
4040
"webpack-dev-server": "^3.11.2"

marlowe-dashboard-client/src/Contract/View.purs

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import Effect.Aff.Class (class MonadAff)
2727
import Halogen (ComponentHTML)
2828
import Halogen.Css (applyWhen, classNames)
2929
import Halogen.Extra (lifeCycleSlot, LifecycleEvent(..))
30-
import Halogen.HTML (HTML, a, button, div, div_, h2, h3, h4_, input, p, span, span_, sup_, text)
30+
import Halogen.HTML (HTML, a, button, div, div_, h2, h3, h4, h4_, input, p, span, span_, sup_, text)
3131
import Halogen.HTML.Events (onClick)
3232
import Halogen.HTML.Events.Extra (onClick_, onValueInput_)
3333
import Halogen.HTML.Properties (InputType(..), enabled, href, id_, placeholder, ref, target, type_, value)
@@ -720,9 +720,23 @@ renderTasks state =
720720
$ namedActions
721721
<#> uncurry (renderPartyTasks state)
722722
else
723-
div
724-
[ classNames [ "p-4" ] ]
725-
[ text "There are no tasks to perform at this step. The contract will progress automatically when the timeout has passed." ]
723+
noPossibleActions
724+
725+
noPossibleActions :: forall p a. HTML p a
726+
noPossibleActions =
727+
let
728+
purpleDot extraCss = div [ classNames $ [ "rounded-full", "bg-lightpurple", "w-3", "h-3", "animate-grow" ] <> extraCss ] []
729+
in
730+
div
731+
[ classNames [ "p-4", "text-xs", "flex", "flex-col", "h-full" ] ]
732+
[ h4 [ classNames [ "font-semibold" ] ] [ text "Please wait…" ]
733+
, p [ classNames [ "mt-2" ] ] [ text "There are no tasks to complete at this step. The contract will progress automatically when the timeout passes." ]
734+
, div [ classNames [ "flex-grow", "flex", "justify-center", "items-center" ] ]
735+
[ purpleDot [ "mr-2" ]
736+
, purpleDot [ "animate-delay-150" ]
737+
, purpleDot [ "ml-2", "animate-delay-300" ]
738+
]
739+
]
726740

727741
participantWithNickname :: State -> Party -> String
728742
participantWithNickname state party =

marlowe-dashboard-client/static/css/main.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
@import url("https://fonts.googleapis.com/css2?family=Barlow:ital,wght@0,400;0,600;0,700;1,400&display=swap");
22

3-
@import "tabs.css";
3+
@import "./tabs.css";
4+
@import "./utilities.css";
45
@import "../../web-common/static/icons.css";
56
@import "../../web-common/static/popover.css";
67

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/* Tailwind has a utility for transition delay, but not for animation delay, for the
2+
moment I'm manually adding some utilities.
3+
The !important is used because the animation shorthand property (the one that tailwind uses)
4+
resets the delay to zero (probably thats the reason they didn't add this kind of utility yet)
5+
*/
6+
.animate-delay-75 {
7+
animation-delay: 75ms !important;
8+
}
9+
10+
.animate-delay-100 {
11+
animation-delay: 100ms !important;
12+
}
13+
14+
.animate-delay-150 {
15+
animation-delay: 150ms !important;
16+
}
17+
18+
.animate-delay-200 {
19+
animation-delay: 200ms !important;
20+
}
21+
22+
.animate-delay-300 {
23+
animation-delay: 300ms !important ;
24+
}

marlowe-dashboard-client/tailwind.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ module.exports = {
7070
animation: {
7171
"from-below": "from-below 250ms ease-out 1",
7272
"to-bottom": "to-bottom 250ms ease-out 1",
73+
grow: "grow 1s ease-in-out infinite",
7374
},
7475
transitionProperty: {
7576
width: "width",
@@ -89,6 +90,10 @@ module.exports = {
8990
"0%": { transform: "translateY(0px)", opacity: 1 },
9091
"100%": { transform: "translateY(20px)", opacity: 0 },
9192
},
93+
grow: {
94+
"0%, 100%": { transform: "scale(1)" },
95+
"50%": { transform: "scale(1.15)" },
96+
},
9297
},
9398
gridTemplateRows: {
9499
"auto-1fr": "auto minmax(0, 1fr)",

0 commit comments

Comments
 (0)