fix constants.js, colorize channel names

This commit is contained in:
Kyep
2020-08-09 14:15:42 -07:00
parent 55fcea6d69
commit a7d22c5fec
3 changed files with 21 additions and 6 deletions
+8 -3
View File
@@ -54,6 +54,11 @@ export const RADIO_CHANNELS = [
freq: 1213,
color: '#a52a2a',
},
{
name: 'SyndicateTeam',
freq: 1244,
color: '#a52a2a',
},
{
name: 'Red Team',
freq: 1215,
@@ -65,8 +70,8 @@ export const RADIO_CHANNELS = [
color: '#3434fd',
},
{
name: 'CentCom',
freq: 1337,
name: 'ERT',
freq: 1345,
color: '#2681a5',
},
{
@@ -106,7 +111,7 @@ export const RADIO_CHANNELS = [
},
{
name: 'AI Private',
freq: 1447,
freq: 1343,
color: '#d65d95',
},
{
+11 -1
View File
@@ -22,6 +22,13 @@ export const Radio = (props, context) => {
} = data;
const tunedChannel = RADIO_CHANNELS
.find(channel => channel.freq === frequency);
let colorMap = [];
let rc = [];
let i = 0;
for (i=0; i < RADIO_CHANNELS.length; i++) {
rc = RADIO_CHANNELS[i];
colorMap[rc["name"]] = rc["color"];
}
const channels = map((value, key) => ({
name: key,
status: !!value,
@@ -111,10 +118,13 @@ export const Radio = (props, context) => {
<Button
icon={channel.status ? 'check-square-o' : 'square-o'}
selected={channel.status}
content={channel.name}
content=""
onClick={() => act('channel', {
channel: channel.name,
})} />
<Box inline color={colorMap[channel.name]}>
{channel.name}
</Box>
</Box>
))}
</LabeledList.Item>
File diff suppressed because one or more lines are too long