Skip to content
This repository has been archived by the owner on Mar 19, 2019. It is now read-only.

Change urls on Slider left and right #90

Closed
luisherranz opened this issue Aug 18, 2017 · 12 comments
Closed

Change urls on Slider left and right #90

luisherranz opened this issue Aug 18, 2017 · 12 comments
Assignees

Comments

@luisherranz
Copy link
Contributor

No description provided.

@luisherranz
Copy link
Contributor Author

@orballo I saw you started working on this as well. I also had a branch but you can continue with it.

I thinks the best way to approach this would be in the connection package. I'd define an action and type called ROUTE_CHANGE_REQUESTED which gets type and id as arguments. Then, I'd do a saga listening for those actions which uses Router.push from @worona/next/router to change the url and has the same logic than the Link component of connection, retrieving the necessary permalink for the as parameter from the state. Finally, in the saturn theme, I'd use a saga to listen to all the ACTIVE_POST_SLIDE_CHANGED and dispatch the ROUTE_CHANGE_REQUESTED accordingly. For that, I'd include the postId in the activePostSlideChanged action.

Don't take into account my branch because I was about to implement this in a more complex way.

@orballo
Copy link

orballo commented Aug 21, 2017

Actually, I wasn't working on this. My branch (change-slide) was created because, right now, when you open a post from PostList, it doesn't open that Post, but the one with the activeSlide index that it's already in the store. This is because the Link component won't accept an onClick callback, and there is where we were sending the action ACTIVE_POST_SLIDE_CHANGE_REQUESTED.

That said, I can work on this issue as well. Just let me know if I should start with it.

@luisherranz
Copy link
Contributor Author

Ok! Well, you can work on this then 😁

About that: Instead of sending an action, why don't you initialize the Slide on the correct post ID using the new getId selector from the router?

@orballo
Copy link

orballo commented Aug 21, 2017

Yep, I was thinking about how to make it render properly the first time, without changing the index. I'll try that.

@luisherranz
Copy link
Contributor Author

luisherranz commented Aug 21, 2017 via email

@orballo
Copy link

orballo commented Aug 21, 2017

I'm going to start working on this issue, but I don't understand why do you want me to create an ROUTE_CHANGE_REQUESTED on connection if there is already one in router. Can I not use that one?

@luisherranz
Copy link
Contributor Author

luisherranz commented Aug 21, 2017 via email

@orballo
Copy link

orballo commented Aug 21, 2017

Maybe I'm looking somewhere else but:

https://github.com/worona/worona-pwa/blob/115ee50e458d7d748cb510d1798a90cfd2c24b5c/core/router/actions/index.js#L1-L17

https://github.com/worona/worona-pwa/blob/115ee50e458d7d748cb510d1798a90cfd2c24b5c/core/router/types/index.js#L1-L3

So far, with those actions, I've got the route change working, but it breaks when slides are passed too fast.

@luisherranz
Copy link
Contributor Author

luisherranz commented Aug 21, 2017 via email

@luisherranz
Copy link
Contributor Author

luisherranz commented Aug 29, 2017

@orballo what's still not working here?

@orballo
Copy link

orballo commented Aug 29, 2017

@luisherranz It's working, but the actions are sent when the animation starts, so the animation is not fluid.

@luisherranz
Copy link
Contributor Author

luisherranz commented Aug 29, 2017 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants