one component

This commit is contained in:
Olivier Gagnon 2021-08-27 17:39:15 -04:00
parent bcb0606900
commit a8254e7144
2 changed files with 21 additions and 13 deletions

@ -0,0 +1,20 @@
import React from 'react';
interface IProps {
current: boolean;
text: string;
onClick: () => void;
}
export function HeaderTab(props: IProps) {
let className = "cmpy-mgmt-header-tab";
if (props.current) {
className += " current";
}
return (
<button className={className} onClick={props.onClick}>
{props.text}
</button>
)
}

@ -3,19 +3,7 @@
// divisions, see an overview of your corporation, or create a new industry // divisions, see an overview of your corporation, or create a new industry
import React from "react"; import React from "react";
import { BaseReactComponent } from "./BaseReactComponent"; import { BaseReactComponent } from "./BaseReactComponent";
import { HeaderTab } from "./HeaderTab";
function HeaderTab(props) {
let className = "cmpy-mgmt-header-tab";
if (props.current) {
className += " current";
}
return (
<button className={className} onClick={props.onClick}>
{props.text}
</button>
)
}
export class HeaderTabs extends BaseReactComponent { export class HeaderTabs extends BaseReactComponent {
renderTab(props) { renderTab(props) {