probe setrup

This commit is contained in:
insanity 2017-07-26 15:11:37 +09:00
parent ebf6e465cc
commit 33660ce01b

View File

@ -44,8 +44,9 @@ const osNames = [
export class ProbeDown extends React.Component<any, any> {
constructor(props: Props, context: State) {
super(props, context);
this.state = { activeItem: osNames[0].name };
this.state = {
activeItem: '',
};
}
public handleItemClick = (event: React.SyntheticEvent<HTMLAnchorElement>, data: MenuItemProps): void => {
@ -54,6 +55,9 @@ export class ProbeDown extends React.Component<any, any> {
public ShowContent = (): JSX.Element => {
let os = this.state.activeItem;
if(os === '') {
return <div>Instruction page.</div>;
}
switch (os) {
case 'Windows': {
return <Windows />;
@ -74,15 +78,14 @@ export class ProbeDown extends React.Component<any, any> {
}
public render(): JSX.Element {
const { activeItem } = this.state.activeItem;
return (
<Container fluid>
<Grid>
<Grid.Column width={4}>
<Menu fluid vertical icon='labeled'>
<Menu fluid vertical icon='labeled' pointing>
{osNames.map((item: any, index: number) => {
return (
<Menu.Item key={index} name={item.name} active={activeItem === item.name} onClick={this.handleItemClick} >
<Menu.Item key={index} name={item.name} active={this.state.activeItem === item.name} onClick={this.handleItemClick} >
<Icon name={item.icon} />
{item.name}
</Menu.Item>