mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-14 08:42:08 +10:00
add mouse wheel scroll into tabBar
This commit is contained in:
@ -16,6 +16,8 @@ const TabBar = ({ tabs, currentTab, setCurrentTab }) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const wheelScrollBy = e => scrollBy(e.deltaY);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="mx-4 mb-6 flex items-center">
|
<div className="mx-4 mb-6 flex items-center">
|
||||||
<div
|
<div
|
||||||
@ -25,7 +27,7 @@ const TabBar = ({ tabs, currentTab, setCurrentTab }) => {
|
|||||||
<i className="material-icons">chevron_left</i>
|
<i className="material-icons">chevron_left</i>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ul id="tabs" ref={tabsRef} className="flex overflow-x-scroll">
|
<ul id="tabs" ref={tabsRef} className="flex overflow-x-scroll" onWheel={wheelScrollBy}>
|
||||||
{tabs.map(tab =>
|
{tabs.map(tab =>
|
||||||
currentTab === tab.key ? (
|
currentTab === tab.key ? (
|
||||||
<li key={tab.key} className="mx-1 list-none">
|
<li key={tab.key} className="mx-1 list-none">
|
||||||
|
|||||||
Reference in New Issue
Block a user