-
Notifications
You must be signed in to change notification settings - Fork 146
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
feat: approver pattern #5027
feat: approver pattern #5027
Conversation
@@ -0,0 +1,26 @@ | |||
import { css } from 'leather-styles/css'; |
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.
Just a heads up, I meant to mention before, I have a <Footer
in the containers branch we can eventually use instead of this
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.
Will that play nicely with the fixed positioning though?
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.
The footers are all supposed to be sticky now. Ignore my Footer
for now and go as planned and then we can see if we can refactor them to share.
They are also supposed to have a top border when the content above them is scrollable but I didn't implement that yet
title: 'Feature/Approver', | ||
|
||
render: ({ children, ...args }) => ( | ||
<Flex maxW="390px" h="680px" border="1px solid lightgrey" overflowY="auto"> |
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.
Mark has told me to make the popup height 600px
. Is that good with you? Or do you think we should have it variable based on the popup type?
I found that popup.ts
accepts dimensions but we don't use them
@@ -0,0 +1,22 @@ | |||
import { useEffect } from 'react'; |
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 seems cool and maybe useful to me for dynamic height sizing which has proved tricky in containers.
I was trying to use calculated heights via variables which panda
doesn't like and had considered using style
so this is a good idea
The |
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.
💪 👍
@@ -197,6 +197,7 @@ | |||
"ecdsa-sig-formatter": "1.0.11", | |||
"ecpair": "2.1.0", | |||
"formik": "2.4.5", | |||
"framer-motion": "11.0.8", |
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.
👍
const slightPauseForContentEnterAnimation = createDelay(120); | ||
|
||
export function ApproverAdvanced({ children }: HasChildren) { | ||
const { isDisplayingAdvancedView, setIsDisplayingAdvancedView } = useApproverContext(); |
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.
can there be multiple advanced views? if so it seems this will close/open all of them at once?
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.
It isn't built to support this, and don't think we will @mica000 ?
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.
Maybe I proactively reject two Approver components?
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.
Correct, only one advanced view
<Button variant="outline">Cancel</Button> | ||
<Button>Approve</Button> |
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.
thinking in most cases there will be just these cancel/approve
btns no? maybe create them as default in Approver.Actions?
but this means we need to pass approve/cancel actions as props, so quite arguable
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 a tough one. I separated the actions (as prop) from the children, so we apply the button styles implicitly (flex with stretch) but adding the buttons themselves I'm not sure, maybe in some cases we want different ones?
Not sure how to handle exactly. Esp. if we have the animated confirm btn.
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.
cb142fc
to
12bcc8c
Compare
This is amazing!!!! 😍😍😍😍😍😍I noticed we are using 12 + 24px in the margins and 12px between ItemLayout and heading: This is happening because we don't have the heading component in development, so the structure will naturally be different. Wondering what we could do to preserve the same values. Maybe adding 24px between heading and itemLayout and 24px around all the margin will solve it? Image of how it is in designs: Also, the heading has a placeholder icon to show a tooltip that is sometimes present. Curious on how we would handle that as well. |
Thanks Michelly. I haven't made sure the margins are accurate yet, so good you point it out. think it might be best to put a min-height on the header element. Will come up with a god approach today and show you. The margins should look visually identical to designs, but be aware of the changes made in these PRs #5014 #5024. In Figma you've padded the |
a546d71
to
9a5a12d
Compare
7b42ae5
to
d54ded8
Compare
d54ded8
to
90b1724
Compare
This PR has been extracted to the monorepo |
This PR adds the
<Approver />
component as described in Notion.Initial demo
2024-03-05-000124.mp4
Todo
Approve
button cc/ @fabric-8