Refactor towards modular structure

This commit is contained in:
Borys_Levytskyi
2021-01-14 20:48:19 +02:00
parent f671b32b63
commit 50d1606105
31 changed files with 221 additions and 154 deletions

View File

@@ -0,0 +1,33 @@
import AppState from "../AppState";
import React from "react";
type IndicatorsProps = {
appState: AppState
};
function Indicators(props: IndicatorsProps) {
const list = [];
const state = props.appState;
if(props.appState.env != 'prod') {
list.push(state.env);
}
if(props.appState.debugMode) {
list.push("debug");
}
if(localStorage.getItem('TrackAnalytics') === 'false') {
list.push("notrack");
}
if(list.length == 0)
return null;
return <div>
{list.map(i => <span>{i}&nbsp;</span>)}
</div>
}
export default Indicators;