Added and optimized missing RatingFieldDisplay component (#5904)

The display for Rating field type was missing, I just added it based on
RatingInput in readonly mode and optimized a bit for performance also.

Fixes https://github.com/twentyhq/twenty/issues/5900
This commit is contained in:
Lucas Bordeau
2024-06-17 17:27:19 +02:00
committed by GitHub
parent dba0b28eae
commit e1bd3a4c5a
8 changed files with 149 additions and 17 deletions

View File

@ -1,14 +1,14 @@
import { useTheme } from '@emotion/react';
import IconTwentyStarFilledRaw from '@ui/display/icon/assets/twenty-star-filled.svg?react';
import { IconComponentProps } from '@ui/display/icon/types/IconComponent';
import { THEME_COMMON } from '@ui/theme';
type IconTwentyStarFilledProps = Pick<IconComponentProps, 'size' | 'stroke'>;
const iconStrokeMd = THEME_COMMON.icon.stroke.md;
export const IconTwentyStarFilled = (props: IconTwentyStarFilledProps) => {
const theme = useTheme();
const size = props.size ?? 24;
const stroke = props.stroke ?? theme.icon.stroke.md;
const stroke = props.stroke ?? iconStrokeMd;
return (
<IconTwentyStarFilledRaw height={size} width={size} strokeWidth={stroke} />