mirror of
https://github.com/flarum/framework.git
synced 2025-02-21 04:31:57 +08:00
chore: IndexSidebar
class
This commit is contained in:
parent
09b9b4a083
commit
a00b0df4d8
@ -17,7 +17,10 @@ export default function isDark(hexcolor: string | null): boolean {
|
||||
let hexnumbers = hexcolor.replace('#', '');
|
||||
|
||||
if (hexnumbers.length === 3) {
|
||||
hexnumbers = hexnumbers.split('').map(char => char.repeat(2)).join('');
|
||||
hexnumbers = hexnumbers
|
||||
.split('')
|
||||
.map((char) => char.repeat(2))
|
||||
.join('');
|
||||
}
|
||||
|
||||
const r = parseInt(hexnumbers.slice(0, 2), 16);
|
||||
|
@ -7,13 +7,14 @@ import Button from '../../common/components/Button';
|
||||
import SelectDropdown from '../../common/components/SelectDropdown';
|
||||
import listItems from '../../common/helpers/listItems';
|
||||
import LinkButton from '../../common/components/LinkButton';
|
||||
import classList from '../../common/utils/classList';
|
||||
|
||||
export interface IndexSidebarAttrs extends ComponentAttrs {}
|
||||
|
||||
export default class IndexSidebar<CustomAttrs extends IndexSidebarAttrs = IndexSidebarAttrs> extends Component<CustomAttrs> {
|
||||
view(vnode: Mithril.Vnode<CustomAttrs, this>): Mithril.Children {
|
||||
return (
|
||||
<nav className="IndexPage-nav sideNav">
|
||||
<nav className={classList('IndexPage-nav sideNav', this.attrs.className)}>
|
||||
<ul>{listItems(this.items().toArray())}</ul>
|
||||
</nav>
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user