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

Add Dropdown Menu to the mobile IDE View #1513

Merged

Conversation

ghalestrilo
Copy link
Collaborator

Part of the Mobile UI Project. This PR adds an <OverlayManager /> component, and a general-purpose <Dropdown /> component. It creates a navigation dialog for the <MobileIDEView />.

I have verified that this pull request:

  • has no linting errors (npm run lint)
  • is from a uniquely-named feature branch and has been rebased on top of the latest master. (If I was asked to make more changes, I have made sure to rebase onto master then too)
  • is descriptively named and links to an issue number, i.e. Fixes #123

Copy link
Member

@catarak catarak left a comment

Choose a reason for hiding this comment

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

I'm not seeing the same linting errors that you're seeing from PropTypes (I tried removing one one of the // eslint-disable-line statements and nothing new appeared. I noticed that this PR commits a package.json. Maybe it's installing a new React version/PropTypes version? Maybe you're using a different version of Node?

Also, on the desktop editor, the console heading got a little messed up:
Screen Shot 2020-07-27 at 12 51 34 PM

Lastly, I'm noticing a few things commented out here and there which I would prefer is just removed. I've found that just leaving commented out code (which I am guilty of doing!) causes confusion.

@ghalestrilo
Copy link
Collaborator Author

Nice, I'll look into this!

@ghalestrilo ghalestrilo requested a review from catarak July 28, 2020 13:58
@ghalestrilo
Copy link
Collaborator Author

Should be good now. Console glitch was fixed, and eslint stopped complaining

client/modules/User/components/ResetPasswordForm.jsx Outdated Show resolved Hide resolved
client/components/OverlayManager.jsx Outdated Show resolved Hide resolved
client/components/Dropdown.jsx Show resolved Hide resolved
@ghalestrilo
Copy link
Collaborator Author

Quick note: I didn't delete the <OverlayManager /> component, though it's not being used yet.

@ghalestrilo ghalestrilo requested a review from catarak July 29, 2020 21:09
client/components/Dropdown.jsx Outdated Show resolved Hide resolved
client/utils/custom-hooks.js Outdated Show resolved Hide resolved
@ghalestrilo ghalestrilo requested a review from catarak July 30, 2020 17:40
// Return values
const setRef = (r) => { ref.current = r; };
const [visible, setVisible] = useState(true);
const trigger = () => setVisible(true);
Copy link
Member

Choose a reason for hiding this comment

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

I noticed that when you use Tab to get to the Dropdown button, and then hit Enter, the Dropdown will open, but if you hit Enter again, it won't close. Is it because trigger only sets visible to true when it should toggle it (i.e. visible = !visible)?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

You're right, thanks for catching that! I updated it and it now behaves exactly like the original dropdown lists ✨

@ghalestrilo ghalestrilo requested a review from catarak July 30, 2020 19:19
@ghalestrilo ghalestrilo mentioned this pull request Jul 31, 2020
3 tasks
@catarak
Copy link
Member

catarak commented Aug 3, 2020

Two things left I think:

  1. The dropdown is still open when you load /mobile.
  2. When you click on a dropdown item, it doesn't close the dropdown. You can see this in action by clicking on "Preferences", then closing the overlay, and you'll see that the dropdown is still open.

@@ -34,7 +34,8 @@ class App extends React.Component {
render() {
return (
<div className="app">
{this.state.isMounted && !window.devToolsExtension && getConfig('NODE_ENV') === 'development' && <DevTools />}
{/* FIXME: Remove false */}
Copy link
Member

Choose a reason for hiding this comment

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

I'm assuming you want to remove this for this PR!

@catarak
Copy link
Member

catarak commented Aug 3, 2020

This is working great! I think it is ready to merge.

@ghalestrilo ghalestrilo merged commit 8c5c90b into processing:develop Aug 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Mobile UI
  
Awaiting triage
Development

Successfully merging this pull request may close these issues.

None yet

2 participants