Swap to standalone header (#1530)
* Lazy load sidebar header * Publish CSS * Swap to standalone header
This commit is contained in:
parent
62d776844c
commit
99f8bc29a8
|
@ -49,4 +49,4 @@
|
||||||
height: 1px;
|
height: 1px;
|
||||||
border-top: thin solid var(--background-modifier-accent);
|
border-top: thin solid var(--background-modifier-accent);
|
||||||
margin-bottom: 1em;
|
margin-bottom: 1em;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,17 +1,33 @@
|
||||||
.bd-sidebar-header {
|
.bd-sidebar-header {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
}
|
align-items: center;
|
||||||
|
}
|
||||||
.bd-sidebar-header .bd-changelog-button {
|
|
||||||
height: 16px;
|
.bd-sidebar-header h2 {
|
||||||
}
|
padding: 6px 10px;
|
||||||
|
box-sizing: border-box;
|
||||||
.bd-sidebar-header .bd-icon {
|
color: #96989d;
|
||||||
cursor: pointer;
|
white-space: nowrap;
|
||||||
fill: var(--interactive-normal);
|
text-overflow: ellipsis;
|
||||||
}
|
overflow: hidden;
|
||||||
|
flex-shrink: 0;
|
||||||
.bd-sidebar-header .bd-icon:hover {
|
display: flex;
|
||||||
fill: var(--interactive-hover);
|
font-weight: 700;
|
||||||
}
|
text-transform: uppercase;
|
||||||
|
letter-spacing: .02em;
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bd-sidebar-header .bd-changelog-button {
|
||||||
|
height: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bd-sidebar-header .bd-icon {
|
||||||
|
cursor: pointer;
|
||||||
|
fill: var(--interactive-normal);
|
||||||
|
}
|
||||||
|
|
||||||
|
.bd-sidebar-header .bd-icon:hover {
|
||||||
|
fill: var(--interactive-hover);
|
||||||
|
}
|
||||||
|
|
|
@ -3,13 +3,16 @@ import {React, WebpackModules} from "modules";
|
||||||
import HistoryIcon from "../icons/history";
|
import HistoryIcon from "../icons/history";
|
||||||
import Modals from "../modals";
|
import Modals from "../modals";
|
||||||
|
|
||||||
const SidebarComponents = WebpackModules.getModule(m => m.Header && m.Separator && m.Item);
|
|
||||||
const Tooltip = WebpackModules.getByPrototypes("renderTooltip");
|
const Tooltip = WebpackModules.getByPrototypes("renderTooltip");
|
||||||
|
|
||||||
export default class SettingsTitle extends React.Component {
|
export default class SettingsTitle extends React.Component {
|
||||||
|
renderHeader() {
|
||||||
|
return <h2 className="bd-sidebar-header-label">BetterDiscord</h2>;
|
||||||
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return <div className="bd-sidebar-header">
|
return <div className="bd-sidebar-header">
|
||||||
<SidebarComponents.Header>BetterDiscord</SidebarComponents.Header>
|
{this.renderHeader()}
|
||||||
<Tooltip color="primary" position="top" text="Changelog">
|
<Tooltip color="primary" position="top" text="Changelog">
|
||||||
{props =>
|
{props =>
|
||||||
<div {...props} className="bd-changelog-button" onClick={() => Modals.showChangelogModal(Changelog)}>
|
<div {...props} className="bd-changelog-button" onClick={() => Modals.showChangelogModal(Changelog)}>
|
||||||
|
@ -19,4 +22,4 @@ export default class SettingsTitle extends React.Component {
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</div>;
|
</div>;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue