1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-04-19 01:17:18 +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'; import type { FC } from 'react';
const StyledVariantChip = styled(StrategyEvaluationChip)<{ order: number }>( const StyledVariantChip = styled(StrategyEvaluationChip)<{ order: number }>(
({ theme, order }) => { ({ theme, order }) => ({
const variantColor =
theme.palette.variants[order % theme.palette.variants.length];
return {
borderRadius: theme.shape.borderRadiusExtraLarge, borderRadius: theme.shape.borderRadiusExtraLarge,
border: 'none', border: 'none',
color: theme.palette.text.primary, color: theme.palette.text.primary,
background: background:
// TODO: adjust theme.palette.variants theme.palette.variants[order % theme.palette.variants.length],
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, fontWeight: theme.typography.fontWeightRegular,
}; }),
},
); );
const StyledPayloadHeader = styled('div')(({ theme }) => ({ const StyledPayloadHeader = styled('div')(({ theme }) => ({