mirror of
https://github.com/Redocly/redoc.git
synced 2024-11-29 12:03:44 +03:00
chore: SideMenu accept className
This commit is contained in:
parent
d74578dc9b
commit
873fe05a5d
|
@ -12,15 +12,18 @@ export interface MenuItemsProps {
|
|||
onActivate?: (item: IMenuItem) => void;
|
||||
style?: React.CSSProperties;
|
||||
root?: boolean;
|
||||
|
||||
className?: string;
|
||||
}
|
||||
|
||||
@observer
|
||||
export class MenuItems extends React.Component<MenuItemsProps> {
|
||||
render() {
|
||||
const { items, root } = this.props;
|
||||
const { items, root, className } = this.props;
|
||||
const active = this.props.active == null ? true : this.props.active;
|
||||
return (
|
||||
<MenuItemUl
|
||||
className={className}
|
||||
style={this.props.style}
|
||||
active={active}
|
||||
{...(root ? { role: 'navigation' } : {})}
|
||||
|
|
|
@ -9,7 +9,7 @@ import { PerfectScrollbar } from '../../common-elements/perfect-scrollbar';
|
|||
import { RedocAttribution } from './styled.elements';
|
||||
|
||||
@observer
|
||||
export class SideMenu extends React.Component<{ menu: MenuStore }> {
|
||||
export class SideMenu extends React.Component<{ menu: MenuStore; className?: string }> {
|
||||
private _updateScroll?: () => void;
|
||||
|
||||
render() {
|
||||
|
@ -19,6 +19,7 @@ export class SideMenu extends React.Component<{ menu: MenuStore }> {
|
|||
{options =>
|
||||
options.nativeScrollbars ? (
|
||||
<MenuItems
|
||||
className={this.props.className}
|
||||
style={{
|
||||
overflow: 'auto',
|
||||
msOverflowStyle: '-ms-autohiding-scrollbar',
|
||||
|
@ -28,7 +29,7 @@ export class SideMenu extends React.Component<{ menu: MenuStore }> {
|
|||
root={true}
|
||||
/>
|
||||
) : (
|
||||
<PerfectScrollbar updateFn={this.saveScrollUpdate}>
|
||||
<PerfectScrollbar updateFn={this.saveScrollUpdate} className={this.props.className}>
|
||||
<MenuItems items={store.items} onActivate={this.activate} root={true} />
|
||||
<RedocAttribution>
|
||||
<a target="_blank" href="https://github.com/Rebilly/ReDoc">
|
||||
|
|
Loading…
Reference in New Issue
Block a user