Skip to content

Commit 131db17

Browse files
committed
链接页面改为循环
增加关注的博客
1 parent aa9951d commit 131db17

File tree

3 files changed

+69
-36
lines changed

3 files changed

+69
-36
lines changed

src/components/Urls/UrlsCategorySection.jsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import React from 'react';
22
import CustomCardList from './CustomCardList';
33

4-
const ToolsCategorySection = ({title, data}) => {
4+
const ToolsCategorySection = ({title, data, describe}) => {
55
return (
66
<div className="w-full">
77
<h2 className="mb-6 text-xl font-bold mt-10">{title}</h2>
8+
<h3 className="mb-6 text-ml font-bold">{describe}</h3>
89
<div className="mb-6">
910
<CustomCardList data={data}/>
1011
</div>

src/components/Urls/index.jsx

+12-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {motion} from "framer-motion";
33
import {Button} from "@douyinfe/semi-ui";
44
import {IoIosArrowBack} from "react-icons/io";
55
import {useNavigate} from "react-router-dom";
6-
import {frindsList, pageVariants} from "../../config";
6+
import {pageVariants, urlList} from "../../config";
77
import ToolsCategorySection from "./UrlsCategorySection";
88

99
const Index = () => {
@@ -28,7 +28,17 @@ const Index = () => {
2828
</Button>
2929
</div>
3030

31-
<ToolsCategorySection title="Friends" data={frindsList} />
31+
{Object.keys(urlList).map((categoryKey) => {
32+
const category = urlList[categoryKey];
33+
return (
34+
<ToolsCategorySection
35+
key={categoryKey}
36+
title={category.title}
37+
describe={category.describe}
38+
data={category.data}
39+
/>
40+
);
41+
})}
3242

3343
</motion.div>
3444
);

src/config.js

+55-33
Original file line numberDiff line numberDiff line change
@@ -25,43 +25,65 @@ export const apiList = {
2525
}
2626

2727
export const pageVariants = {
28-
initial: { opacity: 0, x: -100 },
29-
animate: { opacity: 1, x: 0 },
30-
exit: { opacity: 0, x: 100 },
28+
initial: {opacity: 0, x: -100},
29+
animate: {opacity: 1, x: 0},
30+
exit: {opacity: 0, x: 100},
3131
};
3232

33-
export const frindsList = [
34-
{
35-
title: '声控烤箱',
36-
src: 'https://blog.kazoottt.top/',
37-
describe: '毛怪俱乐部前端',
38-
img_src: 'https://img.tteam.icu/i/2024/11/30/114ctsb-3.webp'
39-
},
40-
{
41-
title: '行走在云端',
42-
src: 'https://hexo.tomsawyer2.xyz/',
43-
describe: '毛怪俱乐部前端',
44-
img_src: 'https://img.tteam.icu/i/2024/11/30/116en4y-3.webp'
45-
},
46-
{
47-
title: 'Poivre',
48-
src: 'https://blog.poivrehxx.site/',
49-
describe: '毛怪俱乐部前端',
50-
img_src: 'https://img.tteam.icu/i/2024/12/01/xu5aoq-3.webp'
51-
},
52-
{
53-
title: 'Roi\'s Blog',
54-
src: 'https://roi.moe/',
55-
describe: '毛怪俱乐部运维',
56-
img_src: 'https://img.tteam.icu/i/2024/12/01/r8p265-3.webp'
33+
export const urlList = {
34+
friends: {
35+
title: 'Friends',
36+
describe: 'friends and guys',
37+
data: [
38+
{
39+
title: '声控烤箱',
40+
src: 'https://blog.kazoottt.top/',
41+
describe: '毛怪俱乐部前端',
42+
img_src: 'https://img.tteam.icu/i/2024/11/30/114ctsb-3.webp'
43+
},
44+
{
45+
title: '行走在云端',
46+
src: 'https://hexo.tomsawyer2.xyz/',
47+
describe: '毛怪俱乐部前端',
48+
img_src: 'https://img.tteam.icu/i/2024/11/30/116en4y-3.webp'
49+
},
50+
{
51+
title: 'Poivre',
52+
src: 'https://blog.poivrehxx.site/',
53+
describe: '毛怪俱乐部前端',
54+
img_src: 'https://img.tteam.icu/i/2024/12/01/xu5aoq-3.webp'
55+
},
56+
{
57+
title: 'Roi\'s Blog',
58+
src: 'https://roi.moe/',
59+
describe: '毛怪俱乐部运维',
60+
img_src: 'https://img.tteam.icu/i/2024/12/01/r8p265-3.webp'
61+
},
62+
{
63+
title: '思无道siudao',
64+
src: 'https://siwudao.github.io/',
65+
describe: '毛怪俱乐部切片',
66+
img_src: 'https://img.tteam.icu/i/2024/11/30/12e1ezb-3.webp'
67+
}
68+
]
5769
},
58-
{
59-
title: '思无道siudao',
60-
src: 'https://siwudao.github.io/',
61-
describe: '毛怪俱乐部切片',
62-
img_src: 'https://img.tteam.icu/i/2024/11/30/12e1ezb-3.webp'
70+
favorite_blogs: {
71+
title: 'Favorite Blogs',
72+
describe: 'I usually read',
73+
data: [
74+
{
75+
title: '星露谷值班站长',
76+
src: 'https://www.aityp.com/',
77+
img_src: 'https://img.tteam.icu/i/2024/12/02/1144rd1-3.webp'
78+
},
79+
{
80+
title: '我不是咕咕鸽',
81+
src: 'https://blog.laoda.de/',
82+
img_src: 'https://img.tteam.icu/i/2024/12/02/1142pyt-3.webp'
83+
}
84+
]
6385
}
64-
]
86+
}
6587

6688
export const softwareTools = {
6789
development: {

0 commit comments

Comments
 (0)