1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-04-15 01:16:22 +02:00

refactor: simplify new rollout variant

This commit is contained in:
Tymoteusz Czech 2025-03-20 13:32:49 +01:00
parent 07046a52a8
commit 83a8cb816a
No known key found for this signature in database
GPG Key ID: 133555230D88D75F

View File

@ -6,22 +6,14 @@ import type { StrategyVariantSchema } from 'openapi';
import type { FC } from 'react';
const StyledVariantChip = styled(StrategyEvaluationChip)<{ order: number }>(
({ theme, order }) => {
const variantColor =
theme.palette.variants[order % theme.palette.variants.length];
return {
borderRadius: theme.shape.borderRadiusExtraLarge,
border: 'none',
color: theme.palette.text.primary,
background:
// TODO: adjust theme.palette.variants
theme.mode === 'dark'
? `hsl(from ${variantColor} h calc(s - 30) calc(l - 45))`
: `hsl(from ${variantColor} h s calc(l + 5))`,
fontWeight: theme.typography.fontWeightRegular,
};
},
({ theme, order }) => ({
borderRadius: theme.shape.borderRadiusExtraLarge,
border: 'none',
color: theme.palette.text.primary,
background:
theme.palette.variants[order % theme.palette.variants.length],
fontWeight: theme.typography.fontWeightRegular,
}),
);
const StyledPayloadHeader = styled('div')(({ theme }) => ({