Skip to content

Commit

Permalink
feat: <BuildInfo> add props showSwitchDebug
Browse files Browse the repository at this point in the history
  • Loading branch information
SolidZORO committed Jun 4, 2020
1 parent df6a508 commit 3901a1d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 8 additions & 3 deletions packages/leaa-dashboard/src/components/BuildInfo/BuildInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import style from './style.module.less';

interface IProps {
className?: string;
showSwitchDebug?: boolean;
}

export const BuildInfo = (props: IProps) => {
Expand All @@ -30,10 +31,14 @@ export const BuildInfo = (props: IProps) => {
<div className={style['build-list']}>
<div className={style['build-item']}>
<span>MODE:</span>
<Button type="link" size="small" className={style['switch-debug-module']} onClick={onAdd}>
{props.showSwitchDebug ? (
<Button type="link" size="small" className={style['switch-debug-module']} onClick={onAdd}>
<strong>{buildConfig.MODE}</strong>
<span className={style['switch-debug-bar']} style={{ width: debugCount * 10 }} />
</Button>
) : (
<strong>{buildConfig.MODE}</strong>
<span className={style['switch-debug-bar']} style={{ width: debugCount * 10 }} />
</Button>
)}
</div>

<div className={style['build-item']}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const UserMenu = (props: IProps): JSX.Element => {
<div className={style['container']}>
<Skeleton active />

<BuildInfo />
<BuildInfo showSwitchDebug />
</div>

<div className={style['footer']}>
Expand Down

0 comments on commit 3901a1d

Please sign in to comment.