From 3b7a9f4a8de819fe5af20b78282c7611dd96420e Mon Sep 17 00:00:00 2001 From: yun-cheng Date: Wed, 27 Mar 2024 14:44:13 +0800 Subject: [PATCH 1/5] refactor: adjust HomePage UI for pixel-perfect --- src/components/common/Divider.tsx | 2 +- src/components/common/Input.tsx | 4 ++-- src/components/common/Slider/Slider.tsx | 14 +++++++++++++- src/pages/HomePage.tsx | 14 ++++++++------ 4 files changed, 24 insertions(+), 10 deletions(-) diff --git a/src/components/common/Divider.tsx b/src/components/common/Divider.tsx index 1fd0977..a0acfe6 100644 --- a/src/components/common/Divider.tsx +++ b/src/components/common/Divider.tsx @@ -8,5 +8,5 @@ type Props = { export default function Divider({ className = undefined }: Props): ReactElement { - return
+ return
} diff --git a/src/components/common/Input.tsx b/src/components/common/Input.tsx index c157774..1e4bcdd 100644 --- a/src/components/common/Input.tsx +++ b/src/components/common/Input.tsx @@ -12,8 +12,8 @@ function Input( ref={ref} className={cn( 'h-[60px] w-full', - 'rounded-md border-[3px] border-white/50 bg-transparent pl-[15px] focus:border-[#ff9b33] focus:ring-0', - 'text-sm/normal tracking-25', + 'rounded-md border-[3px] border-white/50 bg-transparent pl-[15px] pt-[9px] focus:border-[#ff9b33] focus:ring-0', + 'text-sm/normal tracking-25 placeholder:text-white/30', className )} // eslint-disable-next-line react/jsx-props-no-spreading diff --git a/src/components/common/Slider/Slider.tsx b/src/components/common/Slider/Slider.tsx index bb008f8..a1cceb3 100644 --- a/src/components/common/Slider/Slider.tsx +++ b/src/components/common/Slider/Slider.tsx @@ -5,6 +5,7 @@ import { type ComponentProps, type ReactElement } from 'react' +import cn from 'utils/cn' import generateMarks from './generateMarks' type Props = Omit, 'marks'> & { @@ -67,7 +68,10 @@ export default function Slider({ track: 'bg-gradient-to-r from-[#ff5c01] to-[#ffd25f] border-none', rail: 'bg-white/30', mark: 'hidden', - markLabel: 'mt-1 text-sm/normal tracking-25', + markLabel: cn( + 'mt-[3px] sm:mt-[5px]', + 'text-sm/normal tracking-25 sm:text-[16px] sm:font-medium sm:tracking-15' + ), thumb: 'h-[26px] w-[26px] border-[6px] border-[#ffd05d] bg-[#1b1b1b] ring-0 before:ring-0 hover:ring-0' }} @@ -84,3 +88,11 @@ export default function Slider({ /> ) } + +// font-weight: 500; +// font-size: 16px; +// letter-spacing: 0.15px; + +// font-weight: 400; +// font-size: 14px; +// letter-spacing: 0.25px; diff --git a/src/pages/HomePage.tsx b/src/pages/HomePage.tsx index 0d5cb5b..d3d583a 100644 --- a/src/pages/HomePage.tsx +++ b/src/pages/HomePage.tsx @@ -33,22 +33,24 @@ export default function HomePage(): ReactElement { )} >
-

Search

+

Search

- -

# Of Results Per Page

+ +

+ # Of Results Per Page +

{pageSize}
-
results
+
results
-
+
- +
Date: Wed, 27 Mar 2024 14:46:26 +0800 Subject: [PATCH 2/5] refactor: adjust FollowSection UI for pixel-perfect --- src/components/common/SmallButton.tsx | 2 +- src/components/common/Tabs.tsx | 2 +- src/components/follow/FollowUserItem.tsx | 8 +++++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/components/common/SmallButton.tsx b/src/components/common/SmallButton.tsx index 31a5b1f..aab023d 100644 --- a/src/components/common/SmallButton.tsx +++ b/src/components/common/SmallButton.tsx @@ -14,7 +14,7 @@ export default function SmallButton({ return (