fix: adjust padding for tab indicator
This commit is contained in:
parent
a33a54b1de
commit
68d0c85dd2
2 changed files with 2 additions and 3 deletions
|
|
@ -72,7 +72,6 @@ export default function KindFilter({
|
||||||
<Button
|
<Button
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
size="titlebar-icon"
|
size="titlebar-icon"
|
||||||
className="mr-1"
|
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (isSmallScreen) {
|
if (isSmallScreen) {
|
||||||
setOpen(true)
|
setOpen(true)
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ export default function Tabs({
|
||||||
if (activeIndex >= 0 && tabRefs.current[activeIndex]) {
|
if (activeIndex >= 0 && tabRefs.current[activeIndex]) {
|
||||||
const activeTab = tabRefs.current[activeIndex]
|
const activeTab = tabRefs.current[activeIndex]
|
||||||
const { offsetWidth, offsetLeft } = activeTab
|
const { offsetWidth, offsetLeft } = activeTab
|
||||||
const padding = 48 // 24px padding on each side
|
const padding = 24 // 12px padding on each side
|
||||||
setIndicatorStyle({
|
setIndicatorStyle({
|
||||||
width: offsetWidth - padding,
|
width: offsetWidth - padding,
|
||||||
left: offsetLeft + padding / 2
|
left: offsetLeft + padding / 2
|
||||||
|
|
@ -67,7 +67,7 @@ export default function Tabs({
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={cn(
|
className={cn(
|
||||||
'sticky flex justify-between top-12 bg-background z-30 w-full transition-transform',
|
'sticky flex justify-between top-12 bg-background z-30 px-1 w-full transition-transform',
|
||||||
deepBrowsing && lastScrollTop > threshold ? '-translate-y-[calc(100%+12rem)]' : ''
|
deepBrowsing && lastScrollTop > threshold ? '-translate-y-[calc(100%+12rem)]' : ''
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue