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

Feature: TabMenu #3

Closed
wants to merge 32 commits into from
Closed

Conversation

ChefHutch
Copy link
Contributor

@ChefHutch ChefHutch commented Mar 16, 2021

Borked this with a rebase, moved to > #19

Added new components to the UIKit:

Exported:

  • TabMenu
  • Tab
  • Interfaces: TabMenuProps, TabProps

Not exported:

  • StyledTabMenu
  • StyledTab

Details

  • TabMenu maps over child elements in an almost-identical way to the ButtonMenu
  • An array of child element onClicks set the activeIndex depending on the index of the child that has been clicked
  • StyledTabMenu is responsible for the space between the buttons, and the elements' bottom-border
  • StyledTab is a styled html button, with dynamic color/background-color depending on whether it is selected. Below 572px the tab elements flex-grow to fill the available space. overflow-y is set to scroll so these elements become scrollable if they break out of the container.

Questions

  • Should Tab be separated into its own package?
  • Note the quite extensive yarn.lock changes in the root. I can revert these if they're alarming?

Screenshot 2021-03-16 at 15 23 27

@@ -1980,6 +1980,80 @@
minimatch "^3.0.4"
strip-json-comments "^3.1.1"

"@evocateur/libnpmaccess@^3.1.2":
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Lots of changes here just from running yarn in the root. Not sure if these are expected, or problematic?

@ChefHutch ChefHutch changed the title Feature: tab menu Feature: TabMenu Mar 16, 2021
@ChefHutch ChefHutch self-assigned this Mar 16, 2021
@ChefHutch
Copy link
Contributor Author

ChefHutch commented Mar 16, 2021

Screenshot 2021-03-16 at 15 55 05

@ChefHutch ChefHutch marked this pull request as ready for review March 16, 2021 15:49
hachiojidev
hachiojidev previously approved these changes Mar 17, 2021
import { Text } from "../Text";

const Tab: React.FC<TabProps> = ({ isActive = false, onClick, tabMenuLength = 1, children }) => {
const tabWidthPercentage = 100 / tabMenuLength;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why calculate the percentage and not use flex or grid?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also a good point - I was hung up on modifying the width style because it seemed to use a fixed width at desktop sizes in the designs, but looking again... it isn't.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice suggestion. Used flex-grow instead. Just confirming the behaviour with Bugs is all good.

17.March.2021.-.Loom.Recording.mp4

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There were a few tiny padding tweaks but it has the Bugs 👍

@hachiojidev hachiojidev dismissed their stale review March 17, 2021 00:57

Oops, accidentally approved

@hachiojidev
Copy link
Contributor

@ChefHutch Just fix the formatting

@ChefHutch
Copy link
Contributor Author

Aaaabsolutely wrecked this with a rebase to change first commit author, migrated to > #19

@ChefHutch ChefHutch closed this Mar 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants