colors
parent
0df0ee49d0
commit
9729035b50
|
@ -56,6 +56,26 @@ function MyBadge({ count, color = "blue" }) {
|
||||||
return <Badge color={color} count={count} overflowCount={100000} showZero />;
|
return <Badge color={color} count={count} overflowCount={100000} showZero />;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const segmentedDmcPipelineBadgeColors = [
|
||||||
|
"grey",
|
||||||
|
"yellow",
|
||||||
|
"purple",
|
||||||
|
"blue",
|
||||||
|
"orange",
|
||||||
|
"green",
|
||||||
|
"red",
|
||||||
|
];
|
||||||
|
|
||||||
|
const segmentedSetterCloserBadgeColors = [
|
||||||
|
"grey",
|
||||||
|
"yellow",
|
||||||
|
"purple",
|
||||||
|
"blue",
|
||||||
|
"orange",
|
||||||
|
"green",
|
||||||
|
"red",
|
||||||
|
];
|
||||||
|
|
||||||
export default function CrmTest() {
|
export default function CrmTest() {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const appContext = useAppContext();
|
const appContext = useAppContext();
|
||||||
|
@ -222,6 +242,32 @@ export default function CrmTest() {
|
||||||
return items;
|
return items;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const getSegmentedLabels = (item, index) => {
|
||||||
|
console.log("item", index);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Space>
|
||||||
|
<span>{item}</span>
|
||||||
|
<MyBadge
|
||||||
|
count={
|
||||||
|
crmContext.customers.filter(
|
||||||
|
(customer) =>
|
||||||
|
customer.Pipeline ===
|
||||||
|
(selectedSegmentedTypeValue === CRM_TYPE.DMC_PIPELINE
|
||||||
|
? 1
|
||||||
|
: 2) && customer.DealPhase === index + 1
|
||||||
|
).length
|
||||||
|
}
|
||||||
|
color={
|
||||||
|
selectedSegmentedTypeValue === CRM_TYPE.DMC_PIPELINE
|
||||||
|
? segmentedDmcPipelineBadgeColors[index]
|
||||||
|
: segmentedSetterCloserBadgeColors[index]
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</Space>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const customersRequest = () => {
|
const customersRequest = () => {
|
||||||
setIsRequesting(true);
|
setIsRequesting(true);
|
||||||
|
@ -264,7 +310,7 @@ export default function CrmTest() {
|
||||||
value: CRM_TYPE.CUSTOMERS,
|
value: CRM_TYPE.CUSTOMERS,
|
||||||
label: (
|
label: (
|
||||||
<Space>
|
<Space>
|
||||||
<span>All customers</span>
|
<span>All Leads</span>
|
||||||
<MyBadge count={crmContext.customers.length} />
|
<MyBadge count={crmContext.customers.length} />
|
||||||
</Space>
|
</Space>
|
||||||
),
|
),
|
||||||
|
@ -339,23 +385,7 @@ export default function CrmTest() {
|
||||||
options={segmentedOptions.map((item, index) => {
|
options={segmentedOptions.map((item, index) => {
|
||||||
return {
|
return {
|
||||||
value: index,
|
value: index,
|
||||||
label: (
|
label: getSegmentedLabels(item, index),
|
||||||
<Space>
|
|
||||||
<span>{item}</span>
|
|
||||||
<MyBadge
|
|
||||||
count={
|
|
||||||
crmContext.customers.filter(
|
|
||||||
(customer) =>
|
|
||||||
customer.Pipeline ===
|
|
||||||
(selectedSegmentedTypeValue ===
|
|
||||||
CRM_TYPE.DMC_PIPELINE
|
|
||||||
? 1
|
|
||||||
: 2) && customer.DealPhase === index + 1
|
|
||||||
).length
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
</Space>
|
|
||||||
),
|
|
||||||
};
|
};
|
||||||
})}
|
})}
|
||||||
style={{ marginBottom: AppStyle.app.margin }}
|
style={{ marginBottom: AppStyle.app.margin }}
|
||||||
|
|
Loading…
Reference in New Issue