-
Notifications
You must be signed in to change notification settings - Fork 14
Replace MUI tabs with Oasis UI Library component #2122
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
Changes from all commits
8289ae3
f367925
8e6c4a8
ad106a6
dddbc8e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Remove usage of MUI Tabs component |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,6 @@ | ||
| import { useLocation, Outlet, useMatches } from 'react-router-dom' | ||
| import { NonScrollingRouterLink } from '../NonScrollingRouterLink' | ||
| import Tabs from '@mui/material/Tabs' | ||
| import Tab from '@mui/material/Tab' | ||
| import { Tabs, TabsList, TabsTrigger } from '@oasisprotocol/ui-library/src/components/tabs' | ||
|
|
||
| type RouterTabsProps<Context> = { | ||
| tabs: { | ||
|
|
@@ -29,18 +28,18 @@ export function RouterTabs<Context>({ tabs, context }: RouterTabsProps<Context>) | |
|
|
||
| return ( | ||
| <> | ||
| <Tabs value={targetTab?.to} variant="scrollable" scrollButtons={false}> | ||
| {tabs | ||
| .filter(tab => tab === targetTab || tab.visible !== false) | ||
| .map(tab => ( | ||
| <Tab | ||
| key={tab.to} | ||
| component={NonScrollingRouterLink} | ||
| value={tab.to} | ||
| label={tab.label} | ||
| to={tab.to} | ||
| /> | ||
| ))} | ||
| <Tabs value={targetTab?.to}> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Future issue / UX regression: on mobile if there's not enough space https://explorer.dev.oasis.io/mainnet/sapphire/address/0x65524539A0Db2dB286b3a05E4E191eA810295CE2 Before: touch-scrollable
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. that needs to be fixed before merging |
||
| <TabsList variant="layout"> | ||
| {tabs | ||
| .filter(tab => tab === targetTab || tab.visible !== false) | ||
| .map(tab => ( | ||
| <TabsTrigger key={tab.to} value={tab.to} asChild> | ||
| <NonScrollingRouterLink to={tab.to} className="flex items-center"> | ||
| {tab.label} | ||
| </NonScrollingRouterLink> | ||
| </TabsTrigger> | ||
| ))} | ||
| </TabsList> | ||
| </Tabs> | ||
| <Outlet context={context} /> | ||
| </> | ||
|
|
||

Uh oh!
There was an error while loading. Please reload this page.