Skip to content

Commit

Permalink
adding % on the company page
Browse files Browse the repository at this point in the history
  • Loading branch information
guillim committed Nov 13, 2024
1 parent 1f87ae4 commit 0c4c3ac
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ type SettingsObjectFieldDataTypeProps = {
to?: string;
Icon?: IconComponent;
label?: string;
labelDetail?: string;
value: SettingsFieldType;
};

Expand Down Expand Up @@ -50,11 +51,15 @@ const StyledLabelContainer = styled.div`
white-space: nowrap;
`;

const StyledSpan = styled.span`
color: ${({ theme }) => theme.font.color.extraLight};
`;
export const SettingsObjectFieldDataType = ({
to,
value,
Icon: IconFromProps,
label: labelFromProps,
labelDetail,
}: SettingsObjectFieldDataTypeProps) => {
const theme = useTheme();

Expand All @@ -70,7 +75,9 @@ export const SettingsObjectFieldDataType = ({
return (
<StyledDataType as={to ? Link : 'div'} to={to} value={value}>
<StyledIcon size={theme.icon.size.sm} />
<StyledLabelContainer>{label}</StyledLabelContainer>
<StyledLabelContainer>
{label} <StyledSpan>{labelDetail && ${labelDetail}`}</StyledSpan>
</StyledLabelContainer>
</StyledDataType>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export const SettingsObjectFieldItemTableRow = ({
() => getRelationMetadata({ fieldMetadataItem }),
[fieldMetadataItem, getRelationMetadata],
) ?? {};

console.log('fieldMetadataItem:', fieldMetadataItem);
const fieldType = fieldMetadataItem.type;
const isFieldTypeSupported = isFieldTypeSupportedInSettings(fieldType);

Expand Down Expand Up @@ -234,6 +234,9 @@ export const SettingsObjectFieldItemTableRow = ({
? relationObjectMetadataItem?.labelSingular
: relationObjectMetadataItem?.labelPlural
}
labelDetail={
fieldMetadataItem.settings?.type === 'percentage' ? '%' : undefined
}
to={
relationObjectMetadataItem?.namePlural &&
!relationObjectMetadataItem.isSystem
Expand Down

0 comments on commit 0c4c3ac

Please sign in to comment.