Skip to content

Implement Tabs component #47247

Closed
Closed

Description

@masterX89

where to use

  • client/src/components/Donation/duration-amount-options.tsx(for a/b test)

  • client/src/templates/Challenges/classic/mobile-layout.tsx

image

<Tabs
    activeKey={currentTab}
    defaultActiveKey={currentTab}
    id='mobile-layout'
    onSelect={this.switchTab}
    >
	{/* omit something */}
    <TabPane
        eventKey={Tab.Editor}
        title={i18next.t('learn.editor-tabs.code')}
        {...editorTabPaneProps}
        >
        {/* omit something */}
        {editor}
    </TabPane>
    <TabPane
        eventKey={Tab.Console}
        title={i18next.t('learn.editor-tabs.tests')}
        {...editorTabPaneProps}
        >
        {testOutput}
    </TabPane>
    {/* omit something */}
</Tabs>

Props interface

Tabs

Name Type Default Description
activeKey string number
animation boolean true Sets if Fade animation strategy
id string
onSelect function Callback fired when a Tab is selected

Tab

Name Type Default Description
disabled boolean Use false to disable
title node

TabPane

Name Type Default Description
eventKey string number
title
mountOnEnter Wait until the first "enter" transition to mount the tab (add it to the DOM)
unmountOnExit Unmount the tab (remove it from the DOM) when it is no longer visible

Screenshots

Status Light theme Dark theme
selected image image
unselected image image

Current specs

Tabs

  • Themes:
    • Light
    • Dark

Tab

  • Font-family: Roboto Mono, monospace
  • States:
    • disabled
    • selected

TabPane

  • display:
    • block
    • hidden

Spacing and typography

Tabs

Tab

  • border: 1px
  • border-color: transparent
  • border-bottom-color: #ddd
  • margin-right: 2px
  • padding: 5px 10px
  • font-size: 0.8em
  • font-color: --foreground-secondary: var(--gray05)
Status Spacing and typography
selected border-top-color: #ddd
border-right-color: #ddd
border-left-color: #ddd
background-color: --background-quaternary
unselected border-bottom-color: #ddd

TabPane

Status Spacing and typography
selected display: block
unselected display: none

rough delivery plan

  • basic fCC Tailwind style Uncontrolled Tabs - feat(ui-components): implement Tabs components #47313
  • add disable prop
  • add Fade animation, and could set false
  • basic controlled Tabs, add onSelect
  • mountOnEnter and unmountOnExit
  • implement TabPane (this part of the details still need to continue to discuss)

Activity

  1. ahmaxed commented on Aug 12, 2022

    @ahmaxed
    Member

    @masterX89, thanks for researching the Tabs component and opening this detailed issue. Solid work here.

    Here are a few nitpicks:

    • Client/src/components/Donation/duration-amount-options.tsx belongs to a feature that we might a/b test in a couple of months so it does not need checking. You could re-adjust the specifications based on the mobile-layout.tsx only.
    • bsStyle could be removed since it is not used in mobile-layout.tsx
    • If a props is not used in codebase such as mountOnEnter in the Tabs component, it should be removed.
    • The Tab component could be removed.
    • Spacing and typography and Current specs could be made more specific to each component Tabs and `Tab
  2. masterX89 commented on Aug 19, 2022

    @masterX89
    ContributorAuthor

    @ahmadabdolsaheb Thanks for the suggestions, I modified the content of the issue according to the suggestions and tried to implement basic Tabs component. If there is anything that can be improved please let me know.
    Thanks in advance :)

  3. added
    status: PR in works
    scope: tools/scripts
    on Sep 21, 2022
  4. rahulxdemon commented on Aug 4, 2023

    @rahulxdemon

    I would like to work on this issue

  5. ahmaxed commented on Aug 7, 2023

    @ahmaxed
    Member

    Thanks for your interest, @Rahul-Palamarthi. There is a pull request associated with this issue. If you enjoy creating components, I recommend finding an available component from this issue and working on it.
    #44668

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    scope: tools/scriptsstatus: PR in works

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions