import * as React from "react"; import * as Constants from "~/common/constants"; import { css } from "@emotion/react"; const STYLES_PRIMARY_TAB_GROUP = css` font-size: ${Constants.typescale.lvl2}; margin-bottom: 40px; display: flex; align-items: flex-start; flex-direction: row; box-sizing: border-box; width: 100%; flex-wrap: wrap; @media (max-width: ${Constants.sizes.mobile}px) { margin: 24px 0px 24px 0px; } `; const STYLES_SECONDARY_TAB_GROUP = css` font-size: ${Constants.typescale.lvl1}; margin: 36px 0px 24px 0px; display: flex; align-items: flex-start; flex-direction: row; box-sizing: border-box; width: 100%; flex-wrap: wrap; @media (max-width: ${Constants.sizes.mobile}px) { margin: 24px 0px 24px 0px; } `; const STYLES_TAB_GROUP = css` font-size: ${Constants.typescale.lvl1}; margin-bottom: 24px; display: flex; justify-content: center; align-items: center; flex-direction: row; box-sizing: border-box; width: 100%; flex-wrap: wrap; border-bottom: 1px solid ${Constants.system.gray}; @media (max-width: ${Constants.sizes.mobile}px) { margin: 24px 0px 24px 0px; } `; const STYLES_TAB = css` height: 40px; display: flex; align-items: center; padding: 0px 12px; margin-right: 16px; user-select: none; border-radius: 4px; @media (max-width: ${Constants.sizes.mobile}px) { margin-right: 12px; font-size: ${Constants.typescale.lvl0}; height: 32px; padding: 0px 8px; } :last-child { margin-right: 0px; } `; const STYLES_NAVTAB = css` height: 56px; display: flex; align-items: center; margin-right: 32px; user-select: none; border-bottom: 1px solid ${Constants.system.black}; @media (max-width: ${Constants.sizes.mobile}px) { margin-right: 12px; font-size: ${Constants.typescale.lvl1}; } :last-child { margin-right: 0px; } `; export class SecondaryTabGroup extends React.Component { render() { return (
{this.props.tabs.map((tab, i) => (
{} : this.props.onAction ? () => this.props.onAction({ type: "NAVIGATE", value: tab.value }) : () => this.props.onChange(i) } > {this.props.onAction ? tab.title : tab}
))}
); } } export class PrimaryTabGroup extends React.Component { render() { return (
{this.props.tabs.map((tab, i) => (
{} : this.props.onAction ? () => this.props.onAction({ type: "NAVIGATE", value: tab.value }) : () => this.props.onChange(i) } > {this.props.onAction ? tab.title : tab}
))}
); } } export class TabGroup extends React.Component { render() { return (
{this.props.tabs.map((tab, i) => (
{} : this.props.onAction ? () => this.props.onAction({ type: "NAVIGATE", value: tab.value }) : () => this.props.onChange(i) } > {this.props.onAction ? tab.title : tab}
))}
); } }