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:
parent
07046a52a8
commit
83a8cb816a
@ -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 }) => ({
|
||||
|
Loading…
Reference in New Issue
Block a user