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
Implement sidebars on react pages #1957
Implement sidebars on react pages #1957
Conversation
06e34bd
to
5edce30
Compare
8877a41
to
af2f98d
Compare
/blog/myblogname has nested aside elements, and we only want the parent one Co-Authored-By: invalidCards <invalidcards@users.noreply.github.com>
only load css if a sidebar is needed destroy() removes css added await to fix nothing loading (again) css moved in next commit to clean up history
split from previous commit for readability
4dad847
to
6b7a45d
Compare
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.
Overall code LGTM, some nitpicks inline
* @param {Object[]} [section.items] - Array of objects containing button data | ||
* @param {String} section.items[].id - Button element ID | ||
* @param {String} section.items[].text - Visible button text | ||
* @param {Number/String} [section.items[].count] - Text to be displayed as a counter on the 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.
Another nitpick that doesn't require changing: Number|String is more commonly used. Technically in a type annotation like this it would be number|string
since Number and String refer to the boxed versions of the primitive number and string types.
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.
Yeah, all of the JSDoc—actually, most of the green code here—was copy-paste :D That did look odd though.
sdfkjsdkhfksdhfjksdhfksjdhfks
This would (presumably?) need to be rewritten to take the vertical nav layout into account. |
This PR adds XKit.interface.react.sidebar functions that work on the new dashboard as identically as possible to XKit.interface.sidebar. It can be tested with this gist, #1966, #1967, and/or #1968.
This code currently places the XKit sidebar items below the main navigation area of
tumblr.com/blog/my_blog_name
, and above all other native Tumblr sidebar items, including "recommended blogs," "radar," and "sponsored."The new
add
function is asynchronous and must beawait
ed before adding button handlers in extensions.The added functions work on both react and non-react pages.removedIt also includes anremovedXKit.interface.react.sidebar.add_sticky
optionOn react pages, this currently places the xkit sidebar items above all other native Tumblr sidebar items.resolved