Skip to content
This repository was archived by the owner on Nov 8, 2022. It is now read-only.

Commit 137cc36

Browse files
authored
fix(tags): icon hold with mistake (#1147)
1 parent 7329aff commit 137cc36

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

src/components/Switcher/Tabs/DesktopView.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ const Tabs: FC<TProps> = ({
7676

7777
const navRef = useRef(null)
7878

79+
console.log('--> layout: ', layout)
7980
// set initial slipbar with of active item
8081
// 给 slipbar 设置一个初始宽度
8182
useEffect(() => {

src/components/Switcher/Tabs/TabItem.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ const TabItem: FC<TProps> = ({
5757
setItemWidth?.(index, width)
5858
}, [setItemWidth, index])
5959

60-
const handleWrapperClick = useCallback(() => {
61-
clickableRef.current.click()
62-
}, [clickableRef])
60+
const handleWrapperClick = useCallback(() => clickableRef.current.click(), [
61+
clickableRef,
62+
])
6363

6464
const handleLabelClick = useCallback(
6565
(e) => {

src/components/Switcher/styles/tabs/tab_icon.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ import css from '@/utils/css'
77

88
export const Wrapper = styled.div`
99
${css.flex('align-center')};
10+
/* NOTE: the width and height here is a MUST, to hold the icon place, otherwise the width-calc will fail */
11+
width: 20px;
12+
height: 15px;
1013
1114
${css.media.mobile`
1215
display: none;
@@ -17,7 +20,6 @@ export const Icon = styled(Img)<TActive>`
1720
active ? theme('tabs.headerActive') : theme('tabs.header')};
1821
1922
${css.size(15)};
20-
margin-right: 5px;
2123
2224
${css.media.mobile`
2325
${css.size(13)};

utils/themes/skins/solarized_dark.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ const solarizedDark = {
290290
},
291291
tabs: {
292292
headerActive: primaryColor,
293-
header: darken(0.1, primaryColor),
293+
header: darken(0.05, primaryColor),
294294
contentBg: '#0F4553',
295295
headerBg: '#0d3a49',
296296
headerActiveTop: primaryColor,

0 commit comments

Comments
 (0)