-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Docs(web-react): Add Tabs demo #DS-909
- Tabs demo in web-react is now same as demo in web and web-twig
- Loading branch information
1 parent
b16595c
commit a56fbdb
Showing
8 changed files
with
46 additions
and
112 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
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
35 changes: 35 additions & 0 deletions
35
packages/web-react/src/components/Tabs/demo/TabsDefault.tsx
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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import React, { useState } from 'react'; | ||
import { TabId } from '../../../types'; | ||
import Tabs from '../Tabs'; | ||
import TabList from '../TabList'; | ||
import TabItem from '../TabItem'; | ||
import TabLink from '../TabLink'; | ||
import TabContent from '../TabContent'; | ||
import TabPane from '../TabPane'; | ||
|
||
const TabsDefault = () => { | ||
const [selectedTabId, setSelectedTabId] = useState<TabId>(1); | ||
|
||
const selectTab = (tabId: TabId) => { | ||
setSelectedTabId(tabId); | ||
}; | ||
|
||
return ( | ||
<Tabs selectedTab={selectedTabId} toggle={selectTab}> | ||
<TabList> | ||
<TabItem forTab={1}>Item 1</TabItem> | ||
<TabItem forTab={2}>Item 2</TabItem> | ||
<TabLink href="https://www.example.com">Item link</TabLink> | ||
<TabLink href="https://www.example.com" UNSAFE_className="d-none d-desktop-block" className="test"> | ||
Item link, desktop only | ||
</TabLink> | ||
</TabList> | ||
<TabContent> | ||
<TabPane tabId={1}>Pane 1 content</TabPane> | ||
<TabPane tabId={2}>Pane 2 content</TabPane> | ||
</TabContent> | ||
</Tabs> | ||
); | ||
}; | ||
|
||
export default TabsDefault; |
23 changes: 0 additions & 23 deletions
23
packages/web-react/src/components/Tabs/demo/UncontrolledTabs.tsx
This file was deleted.
Oops, something went wrong.
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