Feat/performance-refactor-styled-component (#5516)
In this PR I'm optimizing a whole RecordTableCell in real conditions with a complex RelationFieldDisplay component : - Broke down getObjectRecordIdentifier into multiple utils - Precompute memoized function for getting chip data per field with useRecordChipDataGenerator() - Refactored RelationFieldDisplay - Use CSS modules where performance is needed instead of styled components - Create a CSS theme with global CSS variables to be used by CSS modules
This commit is contained in:
@ -7,7 +7,6 @@ import { getImageAbsoluteURIOrBase64 } from '~/utils/image/getImageAbsoluteURIOr
|
||||
export type RecordChipProps = {
|
||||
objectNameSingular: string;
|
||||
record: ObjectRecord;
|
||||
maxWidth?: number;
|
||||
className?: string;
|
||||
variant?: EntityChipVariant;
|
||||
};
|
||||
@ -15,7 +14,6 @@ export type RecordChipProps = {
|
||||
export const RecordChip = ({
|
||||
objectNameSingular,
|
||||
record,
|
||||
maxWidth,
|
||||
className,
|
||||
variant,
|
||||
}: RecordChipProps) => {
|
||||
@ -34,7 +32,6 @@ export const RecordChip = ({
|
||||
getImageAbsoluteURIOrBase64(objectRecordIdentifier.avatarUrl) || ''
|
||||
}
|
||||
linkToEntity={objectRecordIdentifier.linkToShowPage}
|
||||
maxWidth={maxWidth}
|
||||
className={className}
|
||||
variant={variant}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user