-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🚩 Remove feature flag on tabs #1378
- Loading branch information
1 parent
571d35f
commit 3b29d96
Showing
5 changed files
with
58 additions
and
160 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,12 @@ | ||
import { forwardRef } from 'react' | ||
import { TabList as CTabList, TabListProps as CTabListProps } from '@chakra-ui/react' | ||
import { TabList as RTabList, TabListProps as RTabListProps } from '@reach/tabs' | ||
import { Flags } from '../../../common/helpers/datasetHelpers' | ||
|
||
export type TabListProps = RTabListProps | ||
export type TabListProps = CTabListProps | ||
|
||
export type ChakraTabListProps = CTabListProps | ||
|
||
export const TabList = Flags.IS_DEV | ||
? forwardRef<HTMLDivElement, ChakraTabListProps>(function TabList({ children, ...rest }, ref) { | ||
return ( | ||
<CTabList ref={ref} {...rest} style={{ border: 'none', flexWrap: 'wrap' }}> | ||
{children} | ||
</CTabList> | ||
) | ||
}) | ||
: forwardRef<HTMLDivElement, TabListProps>(function TabList({ children, ...rest }, ref) { | ||
return ( | ||
<RTabList ref={ref} {...rest}> | ||
{children} | ||
</RTabList> | ||
) | ||
}) | ||
export const TabList = forwardRef<HTMLDivElement, TabListProps>(function TabList({ children, ...rest }, ref) { | ||
return ( | ||
<CTabList ref={ref} {...rest} style={{ border: 'none', flexWrap: 'wrap' }}> | ||
{children} | ||
</CTabList> | ||
) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,12 @@ | ||
import { forwardRef } from 'react' | ||
import { TabPanel as RTabPanel, TabPanelProps as RTabPanelProps } from '@reach/tabs' | ||
import { TabPanel as CTabPanel, TabPanelProps as CTabPanelProps } from '@chakra-ui/react' | ||
import { Flags } from '../../../common/helpers/datasetHelpers' | ||
|
||
export type TabPanelProps = RTabPanelProps | ||
export type TabPanelProps = CTabPanelProps | ||
|
||
export type ChakraTabPanelProps = CTabPanelProps | ||
|
||
export const TabPanel = Flags.IS_DEV | ||
? forwardRef<HTMLDivElement, ChakraTabPanelProps>(function TabPanel({ children, ...rest }, ref) { | ||
return ( | ||
<CTabPanel ref={ref} {...rest}> | ||
{children} | ||
</CTabPanel> | ||
) | ||
}) | ||
: forwardRef<HTMLDivElement, TabPanelProps>(function TabPanel({ children, ...rest }, ref) { | ||
return ( | ||
<RTabPanel ref={ref} {...rest}> | ||
{children} | ||
</RTabPanel> | ||
) | ||
}) | ||
export const TabPanel = forwardRef<HTMLDivElement, TabPanelProps>(function TabPanel({ children, ...rest }, ref) { | ||
return ( | ||
<CTabPanel ref={ref} {...rest}> | ||
{children} | ||
</CTabPanel> | ||
) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,12 @@ | ||
import { forwardRef } from 'react' | ||
import { TabPanels as RTabPanels, TabPanelsProps as RTabPanelsProps } from '@reach/tabs' | ||
import { TabPanels as CTabPanels, TabPanelsProps as CTabPanelsProps } from '@chakra-ui/react' | ||
import { Flags } from '../../../common/helpers/datasetHelpers' | ||
|
||
export type TabPanelsProps = RTabPanelsProps | ||
export type TabPanelsProps = CTabPanelsProps | ||
|
||
export type ChakraTabPanelsProps = CTabPanelsProps | ||
|
||
export const TabPanels = Flags.IS_DEV | ||
? forwardRef<HTMLDivElement, ChakraTabPanelsProps>(function TabPanels({ children, ...rest }, ref) { | ||
return ( | ||
<CTabPanels ref={ref} {...rest}> | ||
{children} | ||
</CTabPanels> | ||
) | ||
}) | ||
: forwardRef<HTMLDivElement, TabPanelsProps>(function TabPanels({ children, ...rest }, ref) { | ||
return ( | ||
<RTabPanels ref={ref} {...rest}> | ||
{children} | ||
</RTabPanels> | ||
) | ||
}) | ||
export const TabPanels = forwardRef<HTMLDivElement, TabPanelsProps>(function TabPanels({ children, ...rest }, ref) { | ||
return ( | ||
<CTabPanels ref={ref} {...rest}> | ||
{children} | ||
</CTabPanels> | ||
) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,12 @@ | ||
import { forwardRef } from 'react' | ||
|
||
import { Tabs as CTabs, TabsProps as CTabsProps } from '@chakra-ui/react' | ||
import { Tabs as RTabs, TabsProps as RTabsProps } from '@reach/tabs' | ||
import { Flags } from '../../../common/helpers/datasetHelpers' | ||
|
||
export type ChakraTabsProps = CTabsProps | ||
|
||
export type TabsProps = RTabsProps | ||
export type TabsProps = CTabsProps | ||
|
||
export const Tabs = Flags.IS_DEV | ||
? forwardRef<HTMLDivElement, ChakraTabsProps>(function Tabs({ children, ...rest }, ref) { | ||
return ( | ||
<CTabs ref={ref} {...rest}> | ||
{children} | ||
</CTabs> | ||
) | ||
}) | ||
: forwardRef<HTMLDivElement, TabsProps>(function Tabs({ children, ...rest }, ref) { | ||
return ( | ||
<RTabs ref={ref} {...rest}> | ||
{children} | ||
</RTabs> | ||
) | ||
}) | ||
export const Tabs = forwardRef<HTMLDivElement, TabsProps>(function Tabs({ children, ...rest }, ref) { | ||
return ( | ||
<CTabs ref={ref} {...rest}> | ||
{children} | ||
</CTabs> | ||
) | ||
}) |