-
Notifications
You must be signed in to change notification settings - Fork 3
add tag filter, and limit functionality for collection chunks #7
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
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.
Nothing to worth blocking over, but some questions & potential improvements for my own curiousity!
src/ChunkCollection.jsx
Outdated
let urlParams = toQuery({ | ||
collection_identifier: identifier, | ||
limit: limit || "", | ||
'tags[]': tags || [], | ||
}) |
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.
Would https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams/URLSearchParams work for this as well?
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.
Oh! You're right. I'll use this instead thanks 💯
src/Editmode.jsx
Outdated
script.src = "https://static.editmode.com/editmode@^1.0.0/dist/editmode.js"; | ||
script.src = devMode ? "http://static.lvh.me:3002/editmode@^1.0.0/dist/editmode.js" : "https://static.editmode.com/editmode@^1.0.0/dist/editmode.js"; |
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.
Would a check for window.location.href.includes("localhost")
work for this ternary?
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.
Smart! Yeah, I'll update this line 👍
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.
Actually, I'll remove the devMode ternary for now, this is just for me anyway haha.
Using window.location.href.includes("localhost")
will return an error for other devs that will use editmode-react locally, since the library is pointing to editmode local server instead of the prod one.
🚀 PR was released in |
Changes
tag
attribute inChunkCollection
limit
attribute inChunkCollection
toQuery
util - this converts object to url parameters📦 Published PR as canary version:
3.0.1-canary.7.dba0530.0
✨ Test out this PR locally via: