Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions src/components/field/field-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,16 @@ export const FieldList = ({ fields, nodeType, isHovering }: Props) => {
const previewGroupLength = getPreviewGroupLengths(fields);
return (
<NodeFieldWrapper>
{fields.map(({ name, type: fieldType, hoverVariant, depth, glyphs, variant }, i) => (
{fields.map(({ name, type: fieldType, ...rest }, i) => (
<Field
key={i}
name={name}
nodeType={nodeType}
hoverVariant={hoverVariant}
depth={depth}
isHovering={isHovering}
previewGroupLength={previewGroupLength[name]}
glyphs={glyphs}
type={fieldType}
spacing={spacing}
variant={variant}
{...rest}
/>
))}
</NodeFieldWrapper>
Expand Down
6 changes: 4 additions & 2 deletions src/components/field/field.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const FieldWrapper = styled.div<{ color: string }>`

const InnerFieldWrapper = styled.div<{ width: number }>`
display: flex;
justify-content: flex-end;
justify-content: flex-start;
flex: 0 0 auto;
width: ${props => `${props.width * FIELD_GLYPH_SPACING}px`};
`;
Expand Down Expand Up @@ -85,6 +85,7 @@ const FieldType = styled.div`

const IconWrapper = styled(Icon)`
padding-right: ${spacing[100]}px;
flex-shrink: 0;
`;

interface Props extends NodeField {
Expand All @@ -102,6 +103,7 @@ export const Field = ({
type,
nodeType,
glyphs = [],
glyphSize = LGSpacing[300],
spacing = 0,
variant,
previewGroupLength = 0,
Expand Down Expand Up @@ -183,7 +185,7 @@ export const Field = ({
<FieldWrapper color={getTextColor()}>
<InnerFieldWrapper width={spacing}>
{glyphs.map(glyph => (
<IconWrapper key={glyph} color={getIconColor(glyph)} glyph={GlyphToIcon[glyph]} />
<IconWrapper key={glyph} color={getIconColor(glyph)} glyph={GlyphToIcon[glyph]} size={glyphSize} />
))}
</InnerFieldWrapper>
{previewGroupLength ? (
Expand Down
1 change: 1 addition & 0 deletions src/components/node/node.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ export const FieldsWithGlyphs: Story = {
{
name: 'addressId',
type: 'string',
glyphs: ['link'],
},
],
},
Expand Down
1 change: 1 addition & 0 deletions src/types/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export interface NodeField {
type?: string;
depth?: number;
glyphs?: Array<NodeGlyph>;
glyphSize?: number;
variant?: NodeFieldVariant;
hoverVariant?: NodeFieldHoverVariant;
}
Expand Down