-
Notifications
You must be signed in to change notification settings - Fork 484
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some refactoring ahead of implementing the new designs. #3455
Conversation
021397b
to
3e3e846
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
-- I'm moving this view here so that we can easily call Contract.Actions from inside it. I'm not | ||
-- actually calling any Contract.Actions from here yet, but that's a TODO for the next PR... | ||
contractInnerBox :: forall p. Slot -> State -> HTML p Action | ||
contractInnerBox currentSlot state = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the same that previous ContractHome.View (contractCard)
?
If so, it looks a lot smaller, it's missing the contractType, Acronym and contractInstanceId 🤔 .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't the whole box (hence "inner"). I left the parent div and the header in the dashboard view, because that needs to have a clickable element that opens the screen for that contract - which is a dashboard action. But then the rest goes here in the contract view, because it will have contract actions.
@@ -1,10 +1,11 @@ | |||
module Contract.View | |||
( contractDetailsCard | |||
( contractInnerBox |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm more keen into renaming the current cards into modal
or dialog
and keeping card
for this widget. Or even keeping just card
for modals and this being a contractCard
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
InnerBox is particulary noisy, as a Box is a 3d element, and an inner box I'm thinking about a box inside a box.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair point. I'll leave it for now and rename things in the next PR - when I expect these things will become clearer. I'm not opposed to either of your suggestions.
@@ -28,12 +29,14 @@ type State | |||
, menuOpen :: Boolean | |||
, screen :: Screen | |||
, cards :: Array Card | |||
, status :: ContractStatus |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think just status
made more sense when the ContractHome and Play were separated (and maybe not even then... my bad). But I think this could be renamed to filterBy
, or contractFilter
or similar.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. I'll leave it for now, but try out a different name in the next PR.
This PR does some refactoring without making any functional or visual changes, before I start on implementing the new designs. I thought it would be clearer (and easier to review) if I kept this stuff separate from the design implementation itself.
Specifically, I have:
Play
andContractHome
into a combinedDashboard
module. I like how this combination turned out - it simplified some things and made me feel that these two things do belong together. I think it will be nicer still when the new design is implemented, and we no longer have contacts and contract setup stuff in separate screens, while contracts do go in separate screens instead of on cards. I'm expecting theDashboard.View
code to look nicer when that's done.Contract.View
. (I'm calling them "boxes". I had to call them something, and "card" was taken. 🤷♂️) This is to make it easier to callContract.Actions
from inside these boxes, directly from the dashboard - which is something we'll need to do for the new design.