forked from M-Labs/web2019
Do not show reminders in summary
Signed-off-by: Egor Savkin <es@m-labs.hk>
This commit is contained in:
parent
ca2eb29fbf
commit
9d5ed66985
File diff suppressed because one or more lines are too long
@ -1,6 +1,6 @@
|
|||||||
import {OverlayTrigger} from "react-bootstrap";
|
import {OverlayTrigger} from "react-bootstrap";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import {MaxLevel} from "./warnings";
|
import {Levels, MaxLevel} from "./warnings";
|
||||||
import {useShopStore} from "./shop_store";
|
import {useShopStore} from "./shop_store";
|
||||||
import {compareArraysLevelOne} from "./utils";
|
import {compareArraysLevelOne} from "./utils";
|
||||||
|
|
||||||
@ -37,10 +37,10 @@ export function WarningIndicator({crate_index, card_index}) {
|
|||||||
const warnings = useShopStore(state => state.crates[crate_index].items[card_index].show_warnings, compareArraysLevelOne);
|
const warnings = useShopStore(state => state.crates[crate_index].items[card_index].show_warnings, compareArraysLevelOne);
|
||||||
|
|
||||||
const max_level = MaxLevel(warnings);
|
const max_level = MaxLevel(warnings);
|
||||||
return (
|
return max_level.priority === Levels.warning.priority ? (
|
||||||
<img
|
<img
|
||||||
className="alert-warning align-self-start d-block"
|
className="alert-warning align-self-start d-block"
|
||||||
src={max_level.icon}
|
src={max_level.icon}
|
||||||
/>
|
/>
|
||||||
)
|
) : (<span className="alert-warning align-self-start d-block"></span>);
|
||||||
}
|
}
|
@ -8,7 +8,7 @@
|
|||||||
import {item_occupied_counters, resource_counters} from "./count_resources";
|
import {item_occupied_counters, resource_counters} from "./count_resources";
|
||||||
import {useShopStore} from "./shop_store";
|
import {useShopStore} from "./shop_store";
|
||||||
|
|
||||||
const Levels = {
|
export const Levels = {
|
||||||
"reminder": {priority: 1, icon: '/images/shop/icon-reminder.svg', color: "black"},
|
"reminder": {priority: 1, icon: '/images/shop/icon-reminder.svg', color: "black"},
|
||||||
"warning": {priority: 2, icon: '/images/shop/icon-warning.svg', color: "#c75e5e"},
|
"warning": {priority: 2, icon: '/images/shop/icon-warning.svg', color: "#c75e5e"},
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user