Skip to content
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

SCP-2447 - Implement outline of new designs. #3474

Merged
merged 3 commits into from
Jul 3, 2021

Conversation

merivale
Copy link
Contributor

@merivale merivale commented Jul 2, 2021

I've tried to do as little as possible in this PR, to make things easier to review. The aim is to move things a step closer to the new designs by implementing the new sidebar card/modal, and putting things on that that were previously in separate screens. And also putting things that were on cards (notably the contract card) onto their own screens. On top of that, I did the minimum required to keep things basically functional - but the result is a lot of stuff looking a bit weird or ugly.

The next step(s), obviously, will be making all the component parts look pretty. As I do that, I'll also tidy up the names of the various view functions (some cards are still called screens here, and vice versa).

I don't think there's much point including screenshots (since I'd have to include loads). I think this is probably one you'll have to try out locally (sorry).

@merivale merivale requested a review from hrajchert July 2, 2021 10:37
Copy link
Contributor

@hrajchert hrajchert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code LGTM, I'll check functionality later

hideWhen :: Boolean -> Array String
hideWhen = flip applyWhen [ "hidden" ]
-- max-width container
container :: Array String
Copy link
Contributor

@hrajchert hrajchert Jul 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe rename to maxWidthContainer?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds good 👍

ViewWalletCard walletDetails -> [ walletDetailsCard walletDetails ]
PutdownWalletCard -> [ putdownWalletCard currentWalletDetails ]
WalletLibraryCard -> [ walletLibraryScreen walletLibrary ]
TemplateLibraryCard -> [ TemplateAction <$> templateLibraryCard ]
Copy link
Contributor

@hrajchert hrajchert Jul 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's better to start using the renderSubmodule version, as it allows you to add normal HTML and also subcomponents

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment on lines +193 to +204
dashboardBreadcrumb :: forall p. (Maybe Contract.State) -> HTML p Action
dashboardBreadcrumb mSelectedContractState =
div [ classNames [ "border-b", "border-gray" ] ]
[ nav [ classNames $ Css.container <> [ "flex", "gap-2", "py-2" ] ]
$ [ a [ onClick_ $ SelectContract Nothing ] [ text "Dashboard" ] ]
<> case mSelectedContractState of
Just { nickname } ->
[ span_ [ text ">" ]
, span_ [ text nickname ]
]
Nothing -> []
]
Copy link
Contributor

@hrajchert hrajchert Jul 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably create a function that receives an array of text and actions and draws a breadcrumb

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we probably should. The next PR will add a breadcrumb to some cards which will have - I think - exactly the same style. So that'll be the time to do it.

Comment on lines +17 to +24
-- Note [CardOpen]: As well as making the card a Maybe, we add an additional cardOpen flag.
-- When closing a card we set this to false instead of setting the card to Nothing, and that
-- way we can use CSS transitions to animate it on the way out as well as the way in. This is
-- preferable to using the Halogen.Animation module (used for toasts), because in this case we
-- need to simultaneously animate (fade in/out) the overlay, and because the animation for
-- cards has to be different for different screen sizes (on large screens some cards slide in
-- from the right) - and that's much easier to do with media queries.
, cardOpen :: Boolean
Copy link
Contributor

@hrajchert hrajchert Jul 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if after the refactor of the animation function next week, we could simplify this and avoid requiring an extra flag

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possibly. But the complication here is that the animation has to be different depending on the screen size (from below for small screens, from the right for large ones). That's easily done with transitions and media queries, just using tailwind's generated utility classes. To do it with media queries (without checking in the app what the screen size is) I think we'll have to actually write some CSS by hand...? 🤔 🤯

Copy link
Contributor

@hrajchert hrajchert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just tested functionality... looking good 👌

@merivale merivale merged commit 2a0600d into master Jul 3, 2021
@merivale merivale deleted the merivale/marlowe-run-restyling branch July 3, 2021 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants