mirror of
https://github.com/twentyhq/twenty.git
synced 2025-01-03 17:53:58 +03:00
parent
c1fff908fe
commit
89f6f32243
@ -307,6 +307,7 @@ export const RecordBoardCard = ({
|
||||
objectNameSingular={objectMetadataItem.nameSingular}
|
||||
record={record as ObjectRecord}
|
||||
variant={AvatarChipVariant.Transparent}
|
||||
maxWidth={150}
|
||||
/>
|
||||
)}
|
||||
|
||||
|
@ -10,6 +10,7 @@ export type RecordIdentifierChipProps = {
|
||||
record: ObjectRecord;
|
||||
variant?: AvatarChipVariant;
|
||||
size?: ChipSize;
|
||||
maxWidth?: number;
|
||||
};
|
||||
|
||||
export const RecordIdentifierChip = ({
|
||||
@ -17,6 +18,7 @@ export const RecordIdentifierChip = ({
|
||||
record,
|
||||
variant,
|
||||
size,
|
||||
maxWidth,
|
||||
}: RecordIdentifierChipProps) => {
|
||||
const { indexIdentifierUrl } = useContext(RecordIndexRootPropsContext);
|
||||
const { recordChipData } = useRecordChipData({
|
||||
@ -37,6 +39,7 @@ export const RecordIdentifierChip = ({
|
||||
LeftIcon={LeftIcon}
|
||||
LeftIconColor={LeftIconColor}
|
||||
size={size}
|
||||
maxWidth={maxWidth}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
@ -24,6 +24,7 @@ export type AvatarChipProps = {
|
||||
placeholderColorSeed?: string;
|
||||
onClick?: (event: MouseEvent) => void;
|
||||
to?: string;
|
||||
maxWidth?: number;
|
||||
};
|
||||
|
||||
export enum AvatarChipVariant {
|
||||
@ -60,6 +61,7 @@ export const AvatarChip = ({
|
||||
onClick,
|
||||
to,
|
||||
size = ChipSize.Small,
|
||||
maxWidth,
|
||||
}: AvatarChipProps) => {
|
||||
const { theme } = useContext(ThemeContext);
|
||||
|
||||
@ -106,14 +108,15 @@ export const AvatarChip = ({
|
||||
clickable={isDefined(onClick) || isDefined(to)}
|
||||
onClick={to ? undefined : onClick}
|
||||
className={className}
|
||||
maxWidth={maxWidth}
|
||||
/>
|
||||
);
|
||||
|
||||
return to ? (
|
||||
if (!isDefined(to)) return chip;
|
||||
|
||||
return (
|
||||
<StyledLink to={to} onClick={onClick}>
|
||||
{chip}
|
||||
</StyledLink>
|
||||
) : (
|
||||
chip
|
||||
);
|
||||
};
|
||||
|
@ -64,7 +64,7 @@ const StyledContainer = withTheme(styled.div<
|
||||
: 'inherit'};
|
||||
|
||||
display: inline-flex;
|
||||
justify-content: center;
|
||||
justify-content: flex-start;
|
||||
gap: ${({ theme }) => theme.spacing(1)};
|
||||
height: ${({ theme, size }) =>
|
||||
size === ChipSize.Large ? theme.spacing(4) : theme.spacing(3)};
|
||||
@ -72,7 +72,6 @@ const StyledContainer = withTheme(styled.div<
|
||||
maxWidth
|
||||
? `calc(${maxWidth}px - 2 * var(--chip-horizontal-padding))`
|
||||
: '200px'};
|
||||
|
||||
overflow: hidden;
|
||||
padding: var(--chip-vertical-padding) var(--chip-horizontal-padding);
|
||||
user-select: none;
|
||||
@ -129,6 +128,7 @@ export const Chip = ({
|
||||
accent = ChipAccent.TextPrimary,
|
||||
onClick,
|
||||
className,
|
||||
maxWidth,
|
||||
}: ChipProps) => {
|
||||
return (
|
||||
<StyledContainer
|
||||
@ -140,6 +140,7 @@ export const Chip = ({
|
||||
variant={variant}
|
||||
onClick={onClick}
|
||||
className={className}
|
||||
maxWidth={maxWidth}
|
||||
>
|
||||
{leftComponent}
|
||||
<OverflowingTextWithTooltip size={size} text={label} />
|
||||
|
Loading…
Reference in New Issue
Block a user