-
-
Notifications
You must be signed in to change notification settings - Fork 44
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
Fix Modals #660
Fix Modals #660
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.
Check my comments
@@ -5,74 +5,95 @@ | |||
</template> | |||
<script> | |||
import sbp from '~/shared/sbp.js' | |||
import { OPEN_MODAL, LOAD_MODAL, UNLOAD_MODAL, REPLACE_MODAL, CLOSE_MODAL } from '@utils/events.js' | |||
import { OPEN_MODAL, REPLACE_MODAL, UNLOAD_MODAL, CLOSE_MODAL } from '@utils/events.js' | |||
let keyboardEvent = Event |
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.
couldn't we place this inside the component as a method? Then we would just need to do this:
created () {
window.addEventListener('keyup', this.handleKeyUp)
},
beforeDestroy() {
window.removeEventListener('keyup', this.handleKeyUp)
},
methods: {
handleKeyUp (e) {
// Only if there an active modal
if (this.content && e.key === 'Escape') {
this.unloadModal()
}
}
}
if (this.content) { | ||
this.$router.push({ query: { modal: this.content, subcontent: this.activeSubcontent() } }) | ||
} else { | ||
this.$router.push({}) |
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 believe we shouldn't use push({})
, because this removes all the queries from an URL. For example:
http://localhost:8000/app/?id=special&modal=SignUp
when the modal is closed, the other queries are also removed
http://localhost:8000/app/
And maybe we might want to keep the other queries... I can't point any existing example at the moment but in other projects it's a common constraint I had to handle, so I just wanted to remind you of that.
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.
Hello @pieer ! This is almost perfect!
The mockup for this ☝️specific view is https://www.figma.com/file/mxGadAHfkWH6qApebQvcdN/Group-Income-2.0?node-id=543%3A4225 https://www.figma.com/file/mxGadAHfkWH6qApebQvcdN/Group-Income-2.0?node-id=48%3A86Others:
- Closing / canceling the change password closes the user settings modal as well - it should only close the first one.
Let me know if you have any questions!
content: null, | ||
subcontent: [] | ||
content: null, // This is the main modal | ||
subcontent: [] // This is for collection of modal on top of modals |
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 seems like there might be opportunity here for simplification too?
Is it possible to only have an array of content
? I.e. make it be content: []
instead of content: null
, and remove the subcontent
?
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'm not sure how it would simplify, do you want to change the url structure?
@pieer everything is looking perfect! Great work 😎 |
No description provided.