-
Notifications
You must be signed in to change notification settings - Fork 1
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
New search layout + New Navigation #20
Conversation
sergiofruto
commented
May 6, 2019
From a product's perspective looks great! 👌 Deploying this too prod 🚀 |
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.
Great work Checho! 🚀
Leaving some comments to clean up some code and opinions for a future refactor.
Cheers!
asPath, | ||
} = this.props | ||
|
||
return ( |
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.
In the near future we will try to remove all this duplicated code. Looking good for now
menuOpen: false, | ||
} | ||
|
||
focusInput = React.createRef(); |
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 we remove this since it's not used?
@@ -17,42 +17,107 @@ export default class Header extends Component { | |||
noNav: false, | |||
} | |||
|
|||
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.
Im moving some future components to functional components. If you wish... you can move this to using useState() and drop the class. As you wish.
|
||
render() { | ||
const { handleSearchSubmit } = this.props; | ||
const categories = [ |
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.
We could export this array from Nav.js
or have categories list somewhere else and import it here. Instead of repeating code.
https://github.com/Canillitapp/headlines-web/blob/master/shared/components/Nav.js#L5
@@ -0,0 +1,69 @@ | |||
import React, { Component } 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.
For emoji reactions I am working on a Modal component too. That will sit in the middle of the window as a popup.
Can we rename this to DropdownMenu.js
instead?
Maybe you can you react-modal
(https://github.com/Canillitapp/headlines-web/blob/emoji-reaction/shared/components/ReactionsModal.js#L2).
It also handles a UX when clicking out of the modal.
Let's sync this afterwards in Slack ;)
<div className="input-wrapper"> | ||
<input placeholder="Buscar noticias" type="text" name="searchTerm" /> | ||
</div> | ||
{/* <button className="search-submit-btn" type="submit"></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.
Let's remove this commented code
@@ -2,6 +2,8 @@ const routes = require('next-routes')() | |||
|
|||
routes | |||
.add('download', '/download') | |||
.add('search', '/search/:search') | |||
.add('test', '/test') |
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 we remove this unused route?
const { handleSearchSubmit, handleSearchOpen } = this.props; | ||
return ( | ||
<div className="modal-overlay"> | ||
<button className="close-btn" onClick={handleSearchOpen}> |
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 this being rendered? Can't see it working.
Make sure we got fixed this before merging #26 |