1
0
mirror of https://github.com/mgerb/ps-launcher synced 2026-01-11 19:02:50 +00:00

coming along well - electron is pretty nice

This commit is contained in:
2017-10-17 23:01:08 -05:00
parent 3f49700225
commit c4e028d102
29 changed files with 424 additions and 199 deletions

View File

@@ -0,0 +1,22 @@
@import '../../scss/variables.scss';
.sub-header {
background: $dark-blue--1;
border-bottom: 1px solid $dark-blue--3;
display: flex;
height: 100px;
overflow: auto;
.sub-header__item {
width: 100px;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
&:hover, &.selected {
background: $dark-blue--3;
}
}
}

View File

@@ -0,0 +1,45 @@
import React from 'react';
import { inject, observer } from 'mobx-react';
import * as _ from 'lodash';
import { AppState } from '../../state/AppState';
import './SubHeader.scss';
interface Props {
AppState?: AppState;
}
@inject('AppState')
@observer
export class SubHeader extends React.Component<Props, any> {
constructor(props: Props) {
super(props);
}
public componentDidMount(): void {
this.renderItems();
}
private selectExpansion(exp: string): void {
this.props.AppState.setSelectedExpansion(exp);
}
private renderItems(): any {
const { selectedExpKey } = this.props.AppState;
return _.map(this.props.AppState.expansions, (exp, key) => {
return (
<div key={key} className={'sub-header__item ' + (key === selectedExpKey && 'selected')} onClick={() => this.selectExpansion(key)}>
<div style={{ textAlign: 'center' }}>{exp.name}</div>
</div>
);
});
}
public render(): any {
return (
<div className="sub-header">
{this.renderItems()}
</div>
);
}
}