Skip to content
Closed
Changes from 1 commit
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
5 changes: 3 additions & 2 deletions src/components/KeyboardToolbar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,11 @@ const KeyboardToolbar: React.FC<KeyboardToolbarProps> = ({
styles.toolbar,
{
backgroundColor: `${theme[colorScheme].background}${opacity}`,
paddingLeft: showArrows ? 8 : 0,
paddingRight: 8,
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

My current idea was to add View instead of <> for button group and apply a style paddingLeft there.

And accordingly I wanted to remove paddingHorizontal from container and add paddingRight: 8 to doneButtonContainer. In this case we will not need to write additional conditional code 🤔

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Can you try to make these changes and I'll run CI to see if it passes or not? 👀

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

That was exactly my first idea as well!

What I think might be an even better approach is the following:

  • Remove paddingHorizontal: 8 from toolbar style
  • Add a View instead of <> and give it the following styles:
  arrowsButton: {
    flexDirection: 'row',
    gap: 5,
    paddingHorizontal:8,
  },
  • Remove the done doneButtonContainer styles
  • add paddingHorizonal: 8 to doneButton
  • in Arrow.tsx remove marginHorizontal: 5 from arrowUpContainer

This way both done and arrow buttons have a padding of 8 and the 2 arrow buttons still have the gap of 5 between them. Also with this if the arrow or done button gets removed the whole container is removed as well.

Also in the previous version the done button didnt have padding on the left only on the right (margin). Now it is centered in its container.

},
],
[colorScheme, opacity, theme],
[colorScheme, opacity, theme, showArrows],
);
const offset = useMemo(
() => ({ closed: closed + KEYBOARD_TOOLBAR_HEIGHT, opened }),
Expand Down Expand Up @@ -222,7 +224,6 @@ const styles = StyleSheet.create({
width: "100%",
flexDirection: "row",
height: KEYBOARD_TOOLBAR_HEIGHT,
paddingHorizontal: 8,
},
doneButton: {
fontWeight: "600",
Expand Down