Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
roienatan committed Dec 4, 2023
1 parent cdff22f commit 823e965
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 22 deletions.
5 changes: 0 additions & 5 deletions src/shared/components/Tabs/Tab/Tab.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, { useCallback, FC, ReactNode } from "react";
import classNames from "classnames";
import { useLongPress } from "use-long-press";
import { useTabContext } from "../context";
import { getPanelId, getLabelId } from "../helpers";
import "./index.scss";
Expand Down Expand Up @@ -31,8 +30,6 @@ const Tab: FC<TabProps> = (props) => {
const panelId = getPanelId(value, panelIdTemplate);
const labelId = getLabelId(panelId);

const getLongPressProps = useLongPress(null);

const handleChange = useCallback(() => {
onChange(value, labelId);
}, [onChange, value, labelId]);
Expand All @@ -56,8 +53,6 @@ const Tab: FC<TabProps> = (props) => {
aria-selected={isActive}
aria-controls={panelId}
onClick={handleChange}
onContextMenu={(e) => e.preventDefault()}
{...getLongPressProps()}
>
{withIcons && icon}
{label}
Expand Down
32 changes: 15 additions & 17 deletions src/shared/components/Tabs/Tab/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,6 @@
--tab-color: var(--tab-inactive-hover-color);
}

@media (hover: hover) and (pointer: fine) {
&:hover {
--tab-color: var(--tab-inactive-hover-color);
}
}

&:first-child {
--tab-ml: 0;
}
Expand All @@ -56,17 +50,6 @@
--tab-bb-color: var(--secondary-text);
--tab-color: var(--secondary-text);
}

@media (hover: hover) and (pointer: fine) {
&:hover {
--tab-bb-color: var(--secondary-text);
--tab-color: var(--secondary-text);
}
}
// &:hover {
// --tab-bb-color: var(--secondary-text);
// --tab-color: var(--secondary-text);
// }
}
.custom-tab--with-icon {
--tab-pb: 0;
Expand All @@ -76,3 +59,18 @@
align-items: center;
border: 0;
}

@media (hover: hover) and (pointer: fine) {
.custom-tab {
&:hover {
--tab-color: var(--tab-inactive-hover-color);
}
}

.custom-tab--active {
&:hover {
--tab-bb-color: var(--secondary-text);
--tab-color: var(--secondary-text);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ const LayoutTabs: FC<LayoutTabsProps> = (props) => {

const handleTabChange = (value: unknown) => {
if (activeTab === value) {
console.log("SAME TAB. DO NOTHING");
return;
}

Expand Down

0 comments on commit 823e965

Please sign in to comment.