Skip to content

Commit

Permalink
fix(blog): Add articles more button
Browse files Browse the repository at this point in the history
  • Loading branch information
syfxlin committed Oct 16, 2024
1 parent 8769f4d commit 0ccd70f
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/components/templates/articles/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import { ArticleInfo } from "../../layouts/article-info";
import { Pagination } from "../../ui/pagination";
import { Renderer } from "../../docs";
import { t } from "../../../locales";
import { LinkButton } from "../../ui/button";
import { Iconify } from "../../ui/iconify";
import * as styles from "./styles.css";

export interface HeadingProps {
Expand Down Expand Up @@ -69,6 +71,11 @@ export const TemplateArticles: React.FC<TemplateArticlesProps> = (props) => {
<section>
<Heading>{t("articles.heading")}</Heading>
{props.articles.map(item => <ArticleInfo key={`article-${item.link}`} data={item} />)}
<LinkButton className={styles.more} aria-label={t("articles.more")} href="/page/1" tooltip={false}>
<Iconify icon="ri:arrow-right-double-line" />
{t("articles.more")}
<Iconify icon="ri:arrow-left-double-line" />
</LinkButton>
</section>
</div>
</Main>
Expand Down
11 changes: 11 additions & 0 deletions src/components/templates/articles/styles.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,14 @@ export const document = styled.css`
display: block;
}
`;

export const more = styled.css`
width: 100% !important;
font-size: ${theme.fontSize.calc(1)} !important;
line-height: ${theme.lineHeight.calc(1)} !important;
> .iconify {
width: ${theme.fontSize.calc(1.2)};
height: ${theme.fontSize.calc(1.2)};
}
`;
1 change: 1 addition & 0 deletions src/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export default {
"articles.name": "Article",
"articles.desc": "Article:{0}",
"articles.heading": "Recent Articles",
"articles.more": "And more",

"links.name": "Friends",
"links.desc": "{0} Friends × {1} Lost Friends",
Expand Down
1 change: 1 addition & 0 deletions src/locales/zh-hans.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export default {
"articles.name": "文章",
"articles.desc": "文章:{0}",
"articles.heading": "最近创作",
"articles.more": "还有更多",

"links.name": "友邻",
"links.desc": "{0} 友邻 × {1} 已失联友邻",
Expand Down
1 change: 1 addition & 0 deletions src/locales/zh-hant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export default {
"articles.name": "文章",
"articles.desc": "文章:{0}",
"articles.heading": "最近創作",
"articles.more": "還有更多",

"links.name": "友鄰",
"links.desc": "{0} 友鄰 × {1} 已失聯友鄰",
Expand Down

0 comments on commit 0ccd70f

Please sign in to comment.