Skip to content

Commit

Permalink
usability: highlight test envs
Browse files Browse the repository at this point in the history
  • Loading branch information
MortenHofft committed Aug 14, 2024
1 parent 7d51fb7 commit 99ed546
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/api/util/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const datasetAttemptLogs = "https://logs.gbif.org/app/discover#/?_g=(filters:!()

const environments = {
prod: {
isProduction: true,
gbifUrl: 'https://www.gbif.org',
dataApi: 'https://registry-api.gbif.org',
dataApi_v1: 'https://api.gbif.org/v1',
Expand Down
10 changes: 6 additions & 4 deletions src/components/Layout/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import BasicMenu from './BasicMenu';
import SelectLang from './SelectLang';
import UserMenu from './UserMenu';
import Logo from './Logo';

import config from '../../api/util/config';
import './menu.css';
import { FormattedMessage } from 'react-intl';
import withContext from "../hoc/withContext";
Expand Down Expand Up @@ -96,19 +96,21 @@ class SiteLayout extends Component {
</React.Fragment>;

return (
<Layout style={{ minHeight: '100vh' }}>
<Layout style={{ minHeight: '100vh' }} className={config.isProduction ? '' : 'testEnv'}>
{sideMenu}
<Layout style={{ marginLeft: `${isRTL ? 0 : contentMargin}px`, marginRight: `${isRTL ? contentMargin : 0}px` }}>

<Header style={{ background: '#fff', padding: 0, display: 'flex' }}>
<Header className="header__primary" style={{ padding: 0, display: 'flex' }}>
{isMobile && <div className="headerLogo"><Logo style={{ height: '100px', flex: '0 0 auto' }} /></div>}

{collapsed ? <MenuUnfoldOutlined style={{ flex: '0 0 auto' }}
className="menu-trigger"
onClick={this.toggle} /> : <MenuFoldOutlined style={{ flex: '0 0 auto' }}
className="menu-trigger"
onClick={this.toggle} />}
<div style={{ flex: '1 1 auto' }} />
<div style={{ flex: '1 1 auto' }}>
<span className="header__warning">Test environment</span>
</div>
<div className="header__secondary" style={{ flex: '0 0 auto' }}>
<UserMenu />
<SelectLang />
Expand Down
16 changes: 16 additions & 0 deletions src/components/Layout/menu.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,20 @@
.header__secondary {
float: right;
padding: 0 16px;
}

.header__primary {
background: white!important
}
.testEnv .header__primary {
background: repeating-linear-gradient(45deg, #ffffff, #ffffff 10px, #ffd9d6 10px, #ffd9d6 20px)!important;
}

.header__warning {
display: none;
}
.testEnv .header__warning {
display: block;
font-weight: bold;
color: tomato;
}

0 comments on commit 99ed546

Please sign in to comment.