mirror of
https://github.com/vercel/commerce.git
synced 2025-07-22 20:26:49 +00:00
Merge branch 'm4-sonnguyen' of github.com:KieIO/grocery-vercel-commerce into m5-datnguyen
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
import React, { RefObject, useEffect } from "react"
|
import React, { RefObject, useEffect } from "react"
|
||||||
import s from './TabCommon.module.scss'
|
import s from './TabCommon.module.scss'
|
||||||
|
|
||||||
import TabItem from './TabItem/TabItem'
|
import TabItem from './components/TabItem/TabItem'
|
||||||
|
|
||||||
interface TabCommonProps {
|
interface TabCommonProps {
|
||||||
tabs: {ref:RefObject<HTMLLIElement>, tabName: string, active: boolean, onClick: (tabIndex: number, tabPane?: string) => void}[];
|
tabs: {ref:RefObject<HTMLLIElement>, tabName: string, active: boolean, onClick: (tabIndex: number, tabPane?: string) => void}[];
|
||||||
|
@@ -0,0 +1,23 @@
|
|||||||
|
@import '../../../../../../styles/utilities';
|
||||||
|
|
||||||
|
.tabPane {
|
||||||
|
@apply hidden;
|
||||||
|
animation-duration: 0.6s;
|
||||||
|
animation-name: appear;
|
||||||
|
@keyframes appear {
|
||||||
|
from {
|
||||||
|
margin-left: 100%;
|
||||||
|
width: 200%;
|
||||||
|
}
|
||||||
|
|
||||||
|
to {
|
||||||
|
margin-left: 0%;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
&.active {
|
||||||
|
@apply block;
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,20 @@
|
|||||||
|
import classNames from "classnames"
|
||||||
|
import React from "react"
|
||||||
|
import s from './TabPane.module.scss'
|
||||||
|
|
||||||
|
interface TabPaneProps {
|
||||||
|
active: string;
|
||||||
|
children?: React.ReactNode;
|
||||||
|
}
|
||||||
|
|
||||||
|
const TabPane = ({ active="", children } : TabPaneProps) => {
|
||||||
|
return (
|
||||||
|
<section className={classNames(s.tabPane, {
|
||||||
|
[s[active]] : active
|
||||||
|
})}>
|
||||||
|
{children}
|
||||||
|
</section>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default TabPane
|
Reference in New Issue
Block a user