Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add ability to change padding between FAB group items #1435

Closed
Closed
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
8 changes: 6 additions & 2 deletions src/components/FAB/FABGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ type Props = {
* @optional
*/
theme: Theme;
/**
* Space between FAB group items
*/
itemMargin?: number;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's remove this prop and instead add wrapperStyle prop to the actions - line 30.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's remove this prop and instead add wrapperStyle prop to the actions - line 30.

#4657

};

type State = {
Expand Down Expand Up @@ -205,6 +209,7 @@ class FABGroup extends React.Component<Props, State> {
style,
fabStyle,
visible,
itemMargin,
} = this.props;
const { colors } = theme;

Expand Down Expand Up @@ -250,7 +255,7 @@ class FABGroup extends React.Component<Props, State> {
{actions.map((it, i) => (
<View
key={i} // eslint-disable-line react/no-array-index-key
style={styles.item}
style={[styles.item, { marginBottom: itemMargin || 16 }]}
pointerEvents="box-none"
>
{it.label && (
Expand Down Expand Up @@ -361,7 +366,6 @@ const styles = StyleSheet.create({
},
item: {
marginHorizontal: 24,
marginBottom: 16,
flexDirection: 'row',
justifyContent: 'flex-end',
alignItems: 'center',
Expand Down