-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: review fixes, without menu item control integration
- Loading branch information
Sergey Yuferev
committed
Apr 22, 2019
1 parent
5557e16
commit 9f938f3
Showing
9 changed files
with
135 additions
and
197 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import {PureComponent} from 'react' | ||
|
||
import RenderChild from '../RenderChild' | ||
import {MenuLevel, BaseMenuItem, MenuLevelBuilder} from './MenuLevelBuilder' | ||
|
||
export interface MenuControlProps<Item extends BaseMenuItem> { | ||
items: Item[] | ||
selected: string | ||
children: RenderChild<{ | ||
levels: MenuLevel<Item>[] | ||
}> | ||
} | ||
|
||
export class MenuControl<Item extends BaseMenuItem> extends PureComponent< | ||
MenuControlProps<Item> | ||
> { | ||
render() { | ||
const {props} = this | ||
return props.children({ | ||
levels: new MenuLevelBuilder(props.items).levels(props.selected), | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export * from './MenuControl' | ||
export * from './MenuLevelBuilder' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.