Skip to content

Commit 0cf1896

Browse files
committed
Making tabs component scrollable
1 parent 57dd33a commit 0cf1896

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/components/atoms/Tabs.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const Tabs = () => {
1717
const activeTabStyles =
1818
'before:absolute before:h-[0.25rem] before:w-full before:bg-slate-300 before:content-[""] before:bottom-0 before:left-0';
1919
const tabCommonStyles =
20-
'tab flex items-center gap-x-2 border-r border-neutral-300 bg-transparent pr-0 tracking-[0.15em] transition duration-500 ease-in text-sm';
20+
'tab flex items-center gap-x-2 border-r border-neutral-300 bg-transparent pr-0 tracking-[0.15em] transition duration-500 ease-in text-sm flex-nowrap';
2121
const messageForConfirmActionModal = 'You have unsaved changes in the flowtest, are you sure you want to close it?';
2222

2323
const handleCloseTab = (event, tab) => {
@@ -39,9 +39,10 @@ const Tabs = () => {
3939
};
4040

4141
return (
42-
<div role='tablist' className='tabs tabs-lg'>
42+
<div role='tablist' className='overflow-scroll tabs tabs-lg'>
4343
{tabs
4444
// tabs belonging to one collection will be shown at a time
45+
.reverse()
4546
.filter((t) => t.collectionId === focusTab.collectionId)
4647
.map((tab, index) => {
4748
return (
@@ -56,14 +57,14 @@ const Tabs = () => {
5657
data-id={tab.id}
5758
data-collection-id={tab.collectionId}
5859
>
59-
<a>{tab.name}</a>
60+
<a className='text-nowrap'>{tab.name}</a>
6061
{/* close needs to be a separate clickable component other wise it gets confused with above */}
6162
<div
62-
className='flex h-full items-center px-2 hover:rounded hover:rounded-l-none hover:bg-slate-200'
63+
className='flex items-center h-full px-2 hover:rounded hover:rounded-l-none hover:bg-slate-200'
6364
data-tab-id={tab.id}
6465
onClick={(e) => handleCloseTab(e, tab)}
6566
>
66-
<XMarkIcon className='h-4 w-4' />
67+
<XMarkIcon className='w-4 h-4' />
6768
</div>
6869
</div>
6970
);

src/components/molecules/headers/WorkspaceHeader.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const WorkspaceHeader = () => {
1515

1616
return (
1717
<div className='flex items-center justify-between gap-8 border-b border-neutral-300 bg-slate-100 pr-4'>
18-
<div className='flex items-center'>
18+
<div className='flex items-center overflow-scroll'>
1919
<Tabs />
2020
<button className='flex cursor-not-allowed flex-col items-center bg-slate-100 p-3.5 text-center text-slate-400'>
2121
<Tippy content='Coming Soon!' placement='right'>

0 commit comments

Comments
 (0)