Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI & UX optimization #48

Merged
merged 2 commits into from
Jan 1, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/app/home/Main.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export function HomeMain({data}) {
<button className="max-md:w-full max-md:font-normal h-14 text-lg btn btn-outline btn-primary hover:bg-gray hover:text-white md:mr-3 px-9">🎉 Join Community</button>
</a>
<Link href="/learn/courses">
<button className="max-md:relative max-md:mt-3 max-md:w-full max-md:font-normal h-14 text-lg relative btn btn-primary text-white pl-9 pr-2 hover:!opacity-90">
<button className="max-md:relative max-md:mt-3 max-md:w-full max-md:font-normal h-14 text-lg relative btn btn-primary text-white pl-9 max-md:pl-0 pr-2 max-md:pr-0 hover:!opacity-90">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Get Started
<span className="max-md:absolute max-md:top-3 max-md:right-3 p-2 bg-white rounded ml-14">
<svg width="13" height="13" viewBox="0 0 13 13" fill="none" xmlns="http://www.w3.org/2000/svg">
Expand Down
6 changes: 3 additions & 3 deletions src/app/learn/[type]/[id]/Author.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ export function Author({ data }) {
<div className="flex justify-between pb-6 mt-6">
<div className="flex items-center" suppressHydrationWarning>
<Avatar size={56} user={data?.team_user} />
<div className="ml-4">
<h4 className="text-sm font-bold md:text-lg">
<div className="ml-4 flex-1">
<h4 className="text-sm font-bold md:text-lg max-md:text-lg">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不用加 max-md:text-lg,去掉 text-sm 并把 md:text-lg 改成 text-lg 就行。

<a href={`/u/${data?.team_user?.user_handle}`}>{data?.team_user?.user_nick_name}</a>
</h4>
<p className="text-xs text-gray-500 md:text-sm">
<p className="text-xs text-gray-500 md:text-sm max-md:text-sm">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不用加 max-md:text-sm,去掉 text-xs 并把 md:text-sm 改成 text-sm 就行。

Posted on <span className="text-gray-50">{formatTime(Number(data?.base?.cs_created_at) * 1000, 'MMM D, YYYY HH:mm')}</span> · Latest update on{' '}
<span className="text-gray-50">{formatTime(data?.base?.cs_updated_at * 1000, 'MMM D, YYYY')}</span>
</p>
Expand Down
6 changes: 3 additions & 3 deletions src/entry/components/Header/account.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ export function Account() {

return (
<div className="flex">
{(status === 'loading' || (status === 'authenticated' && info === null)) && <div className="flex flex-col gap-4 w-40">
{(status === 'loading' || (status === 'authenticated' && info === null)) && <div className="flex flex-col gap-4 w-40 max-md:w-auto">
<div className="flex gap-1 items-center">
<div className="skeleton w-8 h-8 rounded-full shrink-0"></div>
<div className="flex flex-col gap-1">
<div className="flex flex-col gap-1 max-md:hidden">
<div className="skeleton h-4 w-20 rounded-md"></div>
<div className="skeleton h-4 w-24 rounded-md"></div>
</div>
Expand All @@ -75,7 +75,7 @@ export function Account() {
src={mediaUrl + info.base.user_avatar}
/>
)}
<div className="mr-8">
<div className="mr-8 max-md:hidden">
<p className="text-sm font-semibold">{info.base.user_nick_name}</p>
<p className="text-xs mt-[2px]">
<span className="opacity-40">{shortenAddress(address)}</span>
Expand Down
4 changes: 2 additions & 2 deletions src/entry/components/Header/nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,14 @@ export function Navs({data}) {
onClick={() => setOpenMenu(!openMenu)}
href={i.link}
>
<li className="flex justify-between items-center font-bold h-14 text-sm">
<li className="flex justify-between items-center font-bold h-14 text-base">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

文档默认就是 16px,且祖先节点中没有单独设置过字号,所以去掉 text-base 直接利用 CSS 的继承机制就行。

{i.name}
<ChevronRightIcon className="h-4 w-4 opacity-60" />
</li>
</Link> : (
<div key={`header-menu-${k}`} className="collapse">
<input type="radio" name={`my-accordion-${k}`} checked="checked" readOnly />
<div className="collapse-title collapse-title-sm min-h-0 h-14 text-sm font-bold flex justify-between items-center">
<div className="collapse-title collapse-title-sm min-h-0 h-14 text-base font-bold flex justify-between items-center">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同上面评论

{i.name}
<ChevronDownIcon className="h-4 w-4 opacity-60" />
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/entry/layouts/default/Footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,11 @@ export function Footer() {
key={`footer-menus-${k}`}
className="max-md:mb-4 max-md:border-t max-md:border-[rgba(255,255,255,0.06)] max-md:pt-6 md:ml-[64px]"
>
<h4 className="mb-0 text-sm font-semibold max-md:mb-2 md:mb-12 md:text-lg">{i.name}</h4>
<h4 className="mb-0 text-sm font-semibold max-md:mb-2 md:mb-12 md:text-lg max-md:text-base">{i.name}</h4>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不用加 max-md:text-base,去掉 text-sm 即可,同样是利用 CSS 继承机制。

<ul>
{i.items.map(subItem => (
<li
className="text-xs leading-7 transition-all duration-300 hover:text-green hover:underline md:text-sm md:leading-10"
className="text-xs leading-7 transition-all duration-300 hover:text-green hover:underline md:text-sm max-md:leading-7 max-md:text-sm md:leading-10"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不用加 max-md:leading-7max-md:text-sm,去掉 text-xs 并把 md:text-sm 改为 text-sm 就行。

key={`footer-menus-sub-${subItem.name}`}
>
{/* href={subItem.link} */}
Expand Down
10 changes: 10 additions & 0 deletions src/shared/components/Select/ReactSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,16 @@ export function ReactSelect({
borderRadius: '8px',
...(styles && isFunction(styles.control) && styles.control())
}),
option: (styles) => ({
...styles,
whiteSpace: 'nowrap',
overflow: 'hidden',
textOverflow: 'ellipsis',
}),
menu: (styles) => ({
...styles,
width: '100%!important',
}),
}}
isSearchable={isSearchable}
components={{ MultiValueRemove, ClearIndicator, DropdownIndicator }}
Expand Down