Hi there, you can try forking it and changing this outlet:
import { apiInitializer } from "discourse/lib/api";
import CustomHeaderTopicButton from "../components/custom-header-topic-button";
export default apiInitializer("1.15.0", (api) => {
api.renderInOutlet("before-header-panel", CustomHeaderTopicButton);
});
to something like:
api.renderInOutlet("bread-crumbs-left", CustomHeaderTopicButton);
For example, I put the button above the sidebar here:
import { apiInitializer } from "discourse/lib/api";
import CustomHeaderTopicButton from "../components/custom-header-topic-button";
export default apiInitializer((api) => {
api.renderInOutlet("before-sidebar-sections", CustomHeaderTopicButton);
/*
document.addEventListener("DOMContentLoaded", function() {
const newTopicBtn = document.getElementById("new-topic-button");
const sidebar = document.getElementById("d-sidebar");
if (newTopicBtn && sidebar) {
sidebar.insertBefore(newTopicBtn, sidebar.firstChild);
}
});
*/
});
You can also probably change the button using some CSS (make a new theme, and put the CSS in the ‘mobile’ tab or in mobile.scss
if you’re using a repo).
2 Likes