Skip to content

Commit

Permalink
fix: nav to ul
Browse files Browse the repository at this point in the history
  • Loading branch information
Arnaud AMBROSELLI committed Sep 8, 2023
1 parent cbb4452 commit daa8c8c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 19 deletions.
2 changes: 1 addition & 1 deletion dashboard/src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ const RestrictedRoute = ({ component: Component, _isLoggedIn, ...rest }) => {
padding: 0 !important;
overflow: initial;
*/}
<main className="tw-relative tw-flex tw-grow tw-basis-full tw-flex-col tw-overflow-auto tw-px-2 print:!tw-ml-0 print:tw-h-auto print:tw-max-w-full print:tw-overflow-visible print:tw-p-0 sm:tw-px-12 sm:tw-pt-4 sm:tw-pb-12">
<main className="tw-relative tw-flex tw-grow tw-basis-full tw-flex-col tw-overflow-auto tw-overflow-y-scroll tw-px-2 print:!tw-ml-0 print:tw-h-auto print:tw-max-w-full print:tw-overflow-visible print:tw-p-0 sm:tw-px-12 sm:tw-pt-4 sm:tw-pb-12">
<SentryRoute {...rest} render={(props) => (user ? <Component {...props} /> : <Redirect to={{ pathname: '/auth' }} />)} />
</main>
</div>
Expand Down
39 changes: 21 additions & 18 deletions dashboard/src/components/tailwind/TabsNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,27 @@ type TabsNavProps = {

export default function TabsNav({ tabs, className, onClick, activeTabIndex }: TabsNavProps) {
return (
<nav className={`noprint tw-flex tw-w-full sm:tw-space-x-4 ${className} tw-border-b tw-border-main tw-border-opacity-20`} aria-label="Tabs">
{tabs.map((tab, index) => (
<button
type="button"
key={tab}
onClick={() => {
onClick(tab, index);
}}
className={[
activeTabIndex === index ? 'tw-bg-main/10 tw-text-black' : 'tw-hover:text-gray-700 tw-text-main',
'tw-rounded-md tw-px-3 tw-py-2 tw-text-sm tw-font-medium',
]
.filter(Boolean)
.join(' ')}
aria-current={activeTabIndex ? 'page' : undefined}>
{tab}
</button>
))}
<nav className="noprint tw-flex tw-w-full" aria-label="Tabs">
<ul className={`tw-flex tw-w-full tw-list-none sm:tw-space-x-4 ${className} tw-border-b tw-border-main tw-border-opacity-20`}>
{tabs.map((tab, index) => (
<li key={tab}>
<button
type="button"
onClick={() => {
onClick(tab, index);
}}
className={[
activeTabIndex === index ? 'tw-bg-main/10 tw-text-black' : 'tw-hover:text-gray-700 tw-text-main',
'tw-rounded-md tw-px-3 tw-py-2 tw-text-sm tw-font-medium',
]
.filter(Boolean)
.join(' ')}
aria-current={activeTabIndex ? 'page' : undefined}>
{tab}
</button>
</li>
))}
</ul>
</nav>
);
}

0 comments on commit daa8c8c

Please sign in to comment.