Skip to content

Commit c827833

Browse files
committed
feat(ui-buttons): expose display prop on CondensedButton
1 parent 50617db commit c827833

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

packages/ui-buttons/src/CondensedButton/index.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ class CondensedButton extends Component<CondensedButtonProps> {
5656
interaction: undefined,
5757
color: 'primary',
5858
margin: '0',
59-
cursor: 'pointer'
59+
cursor: 'pointer',
60+
display: 'inline-block'
6061
}
6162

6263
_baseButton: BaseButton | null = null
@@ -94,6 +95,7 @@ class CondensedButton extends Component<CondensedButtonProps> {
9495
cursor,
9596
href,
9697
renderIcon,
98+
display,
9799
...props
98100
} = this.props
99101

@@ -103,6 +105,7 @@ class CondensedButton extends Component<CondensedButtonProps> {
103105
<BaseButton
104106
{...passthroughProps(props)}
105107
isCondensed
108+
display={display}
106109
withBackground={false}
107110
withBorder={false}
108111
type={type}

packages/ui-buttons/src/CondensedButton/props.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,11 @@ type CondensedButtonOwnProps = {
101101
onClick?: (
102102
event: React.KeyboardEvent<ViewProps> | React.MouseEvent<ViewProps>
103103
) => void
104+
105+
/**
106+
* The CSS display property of the button, `inline-block` or `block`
107+
*/
108+
display?: 'inline-block' | 'block'
104109
}
105110

106111
type PropKeys = keyof CondensedButtonOwnProps
@@ -124,7 +129,8 @@ const propTypes: PropValidators<PropKeys> = {
124129
cursor: PropTypes.string,
125130
href: PropTypes.string,
126131
renderIcon: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
127-
onClick: PropTypes.func
132+
onClick: PropTypes.func,
133+
display: PropTypes.oneOf(['inline-block', 'block'])
128134
}
129135

130136
const allowedProps: AllowedPropKeys = [
@@ -139,7 +145,8 @@ const allowedProps: AllowedPropKeys = [
139145
'renderIcon',
140146
'size',
141147
'type',
142-
'onClick'
148+
'onClick',
149+
'display'
143150
]
144151

145152
export type { CondensedButtonProps }

0 commit comments

Comments
 (0)