Skip to content

Commit

Permalink
refactor: arrow link to intros
Browse files Browse the repository at this point in the history
  • Loading branch information
mydearxym committed Dec 25, 2023
1 parent 727e8a9 commit 4927545
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 50 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ const IntroDigest: FC = () => {
</Digest>

<IntroItems />
{/* <UserCards /> */}
</Wrapper>
)
}
Expand Down
11 changes: 4 additions & 7 deletions src/app/Landing/ArticlesIntroTabs/MoreLink.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import { FC } from 'react'

import type { TColor } from '@/spec'
import { COLOR_NAME } from '@/constant/colors'
import ArrowButton from '@/widgets/Buttons/ArrowButton'

import { Wrapper } from '../styles/articles_intro_tabs/more_link'
import ArrowLinker from '@/widgets/ArrowLinker'

type TProps = {
title?: string
Expand All @@ -13,9 +10,9 @@ type TProps = {

const MoreLink: FC<TProps> = ({ title = '了解更多', href, color }) => {
return (
<Wrapper href={href}>
<ArrowButton color={color}>{title}</ArrowButton>
</Wrapper>
<ArrowLinker href="/" color={color} top={55} fontSize={14}>
{title}
</ArrowLinker>
)
}

Expand Down
39 changes: 0 additions & 39 deletions src/app/Landing/styles/articles_intro_tabs/more_link.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/widgets/ArrowLinker/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const ArrowLinker: FC<TProps> = ({

return (
<Link href={href} target={target}>
<Wrapper $testid={testid} {...restProps}>
<Wrapper $testid={testid} $color={primaryColor} {...restProps}>
<Title fontSize={fontSize} bold={bold} $color={primaryColor}>
{children}
</Title>
Expand Down
5 changes: 3 additions & 2 deletions src/widgets/ArrowLinker/styles/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { TTestable, TSpace, TColor } from '@/spec'

import styled, { css, rainbowLink } from '@/css'
import styled, { css, rainbow, rainbowLink } from '@/css'
import ArrowSVG from '@/icons/ArrowUpRight'

type TWrapper = TTestable & TSpace
type TWrapper = TTestable & TSpace & TColor

export const Wrapper = styled.article.attrs<TTestable>(({ $testid }) => ({
'data-test-id': $testid,
Expand All @@ -14,6 +14,7 @@ export const Wrapper = styled.article.attrs<TTestable>(({ $testid }) => ({
&:hover {
text-decoration: underline;
text-decoration-color: ${({ $color }) => rainbow($color)};
}
`

Expand Down

0 comments on commit 4927545

Please sign in to comment.