-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Display create menu within the chat area and add bottom up transition. #2222
Conversation
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.
src/components/CreateMenu.js
Outdated
@@ -51,6 +79,7 @@ class CreateMenu extends PureComponent { | |||
} | |||
|
|||
render() { | |||
console.debug(this.props.popOverType, this.getAnchorPosition()); |
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 this can be removed? I don't think it's very useful to have in production.
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.
Sorry for this one, will remove it.
src/components/CreateMenu.js
Outdated
@@ -59,7 +88,8 @@ class CreateMenu extends PureComponent { | |||
this.onModalHide(); | |||
this.resetOnModalHide(); | |||
}} | |||
anchorPosition={styles.createMenuPosition} | |||
anchorPosition={this.getAnchorPosition(this.props.popOverType)} |
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.
If the anchor position is determined by the popover type, and the popover type is already passed as a prop, then I think it would be cleaner to have anchor position determined inside of the <Popover>
component. Would this be possible?
@@ -84,5 +114,6 @@ class CreateMenu extends PureComponent { | |||
} | |||
|
|||
CreateMenu.propTypes = propTypes; | |||
CreateMenu.defaultProps = defaultProps; | |||
CreateMenu.displayName = 'CreateMenu'; |
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 know class components don't need displayName
, but I'm not sure about PureComponents. Can the display name be removed?
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.
Do you know?
const defaultProps = { | ||
popOverType: CONST.MODAL.MODAL_TYPE.POPOVER_LEFT_DOCKED, | ||
}; | ||
|
||
class CreateMenu extends PureComponent { |
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.
Is there a reason this is a PureComponent
instead of just a normal Component
?
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 pure component was implemented beforehand, not sure why it was done 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.
OK, I'll check on that and dig a little deeper. No need to let this block your PR since you didn't add it.
@@ -23,7 +23,9 @@ const propTypes = { | |||
CONST.MODAL.MODAL_TYPE.CONFIRM, | |||
CONST.MODAL.MODAL_TYPE.CENTERED, | |||
CONST.MODAL.MODAL_TYPE.BOTTOM_DOCKED, | |||
CONST.MODAL.MODAL_TYPE.POPOVER, | |||
CONST.MODAL.MODAL_TYPE.POPOVER_CENTER_BOTTOM, |
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 it would be easier to do something like type: PropTypes.oneOf(_.values(CONST.MODAL.MODAL_TYPE))
?
@@ -12,6 +12,8 @@ const propTypes = { | |||
bottom: PropTypes.number, | |||
left: PropTypes.number, | |||
}).isRequired, | |||
|
|||
popOverType: modalPropTypes.type, |
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 missing an inline comment to explain it.
I think it's okay that the menu location doesn't change even if the textbox has multiple lines and grows taller. But I think the location of the menu feels a little bit too high above the text input right now. Could we place it like 8 or 16px above the top edge of a one-line chat input? |
Hey @npsedhain, can we get an update on the changes requested here please? Thanks! |
Hey @trjExpensify, sorry for the delay, will push the changes within an hour! |
I have pushed the recommended changes, do let me know if there is more! cc: @tgolen @trjExpensify |
Looks like there is a conflict. |
Hey @tgolen, I have resolved the conflicts. |
Hm, looks like there are still conflicts. Maybe you didn't push your changes or there are just more conflicts? |
Aah I did push it, maybe because something else was merged, will fix it in a minute. |
@tgolen Its fixed! |
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.
Sorry for the delay on this!
@@ -84,5 +114,6 @@ class CreateMenu extends PureComponent { | |||
} | |||
|
|||
CreateMenu.propTypes = propTypes; | |||
CreateMenu.defaultProps = defaultProps; | |||
CreateMenu.displayName = 'CreateMenu'; |
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.
Do you know?
This PR caused a regression. Normally I would just revert it, but unfortunately the base branch was renamed soon after this was merged, so the automatic revert is not an option. @npsedhain Can you create a pull request to fix this regression? |
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
Since this will be a deploy blocker, I am creating a PR here to fix the regression. |
🚀 [Deployed](https://github.com/Expensify/Expensify.cash
|
Just noticed that this other PR actually split up the implementation of |
Details
Fixed Issues
Fixes [GH_LINK_2090](https://github.com//issues/2090)Tests
Tested On
Screenshots
Web
Screen.Recording.2021-04-03.at.11.31.35.AM.mov
Mobile Web
(Doesn't break anything on a smaller screen)
Screen.Recording.2021-04-03.at.11.25.04.PM.mov
Desktop
Screen.Recording.2021-04-03.at.11.33.16.AM.mov