Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
华为原神
pair-project
提交
1f5bd8ea
P
pair-project
项目概览
华为原神
/
pair-project
与 Fork 源项目一致
Fork自
影小薯 / pair-project
通知
2
Star
0
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
pair-project
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
1f5bd8ea
编写于
3月 22, 2024
作者:
式
式部
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix
上级
f0f0be7f
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
33 addition
and
27 deletion
+33
-27
222100414_222100415/src/common/api/api.ts
222100414_222100415/src/common/api/api.ts
+6
-17
222100414_222100415/src/component/mika-ui/Modal/Modal.tsx
222100414_222100415/src/component/mika-ui/Modal/Modal.tsx
+2
-2
222100414_222100415/src/component/mika-ui/Modal/ModalUtils.tsx
...0414_222100415/src/component/mika-ui/Modal/ModalUtils.tsx
+1
-1
222100414_222100415/src/page/DaliySchedule/DailySchedule.tsx
222100414_222100415/src/page/DaliySchedule/DailySchedule.tsx
+4
-5
222100414_222100415/vercel.json
222100414_222100415/vercel.json
+8
-0
222100414_222100415/vite.config.ts
222100414_222100415/vite.config.ts
+12
-2
未找到文件。
222100414_222100415/src/common/api/api.ts
浏览文件 @
1f5bd8ea
import
axios
from
'
axios
'
;
const
instance
=
axios
.
create
({
baseURL
:
'
https://swimming.abdecd.xyz
'
,
headers
:
{
'
Content-Type
'
:
'
application/json
'
}
});
const
httpGet
=
async
<
T
,
>
(
url
:
string
)
=>
{
return
await
instance
.
get
<
T
>
(
url
);
};
export
interface
Schedule
{
UtcDateTime
:
string
;
Date
:
string
;
...
...
@@ -19,8 +6,8 @@ export interface Schedule {
}
export
const
getSchedules
=
async
()
=>
{
const
response
=
await
httpGet
(
'
/api/fina/competitions/3337/schedule?discipline=
'
);
return
response
.
data
;
const
response
=
await
fetch
(
'
/api/fina/competitions/3337/schedule
'
);
return
response
.
json
()
;
};
export
interface
Competition
{
...
...
@@ -29,13 +16,14 @@ export interface Competition {
}
export
const
getCompetitions
=
async
():
Promise
<
Competition
[]
>
=>
{
const
response
=
await
fetch
(
'
/api/fina/competitions/3337/events
'
);
const
response
=
await
fetch
(
'
https://swimming.abdecd.xyz
/api/fina/competitions/3337/events
'
);
const
data
=
await
response
.
json
()
as
{
Sports
:
[{
DisciplineList
:
Competition
[]
}]
};
return
data
.
Sports
?.[
0
]?.
DisciplineList
;
};
getCompetitions
().
then
(
console
.
log
);
export
const
getResults
=
async
(
hash
:
string
)
=>
{
const
response
=
await
fetch
(
`/api/fina/events/
${
hash
}
`
);
const
response
=
await
fetch
(
`
https://swimming.abdecd.xyz
/api/fina/events/
${
hash
}
`
);
return
await
response
.
json
();
};
...
...
@@ -57,3 +45,4 @@ export const getMedalTable = async () => {
};
return
data
.
Medals
.
SportMedals
?.[
0
];
};
222100414_222100415/src/component/mika-ui/Modal/Modal.tsx
浏览文件 @
1f5bd8ea
import
React
,
{
forwardRef
,
memo
,
useCallback
,
useEffect
,
useRef
}
from
"
react
"
;
import
'
./Modal.less
'
;
import
{
fadeOutModal
}
from
"
./ModalUtils
.tsx
"
;
import
{
fadeOutModal
}
from
"
./ModalUtils
"
;
export
type
ModalController
=
{
...
...
@@ -160,4 +160,4 @@ const Modal = memo(forwardRef((props: ModalProps, ref: React.Ref<HTMLDivElement>
}));
export
default
Modal
;
\ No newline at end of file
export
default
Modal
;
222100414_222100415/src/component/mika-ui/Modal/ModalUtils.tsx
浏览文件 @
1f5bd8ea
import
React
,
{
useCallback
}
from
"
react
"
;
import
Modal
,
{
ModalController
,
ModalProps
}
from
"
./Modal
.tsx
"
;
import
Modal
,
{
ModalController
,
ModalProps
}
from
"
./Modal
"
;
import
{
createRoot
}
from
"
react-dom/client
"
;
export
const
fadeOutModal
=
(
modalRef
:
React
.
RefObject
<
HTMLDivElement
>
)
=>
{
modalRef
.
current
?.
classList
.
add
(
"
mika-modal-closing
"
);
...
...
222100414_222100415/src/page/DaliySchedule/DailySchedule.tsx
浏览文件 @
1f5bd8ea
...
...
@@ -42,11 +42,10 @@ const DailySchedule = (props: DailyScheduleProps) => {
>
<
Title
title
=
"Daily Schedule"
/>
<
Panel
>
<
div
>
<
div
className
=
"text-black text-4xl bg-white p-4 rounded-tl-lg rounded-tr-lg select-none mb-4"
>
{
new
Date
().
toLocaleDateString
()
}
</
div
>
<
div
className
=
"text-black text-4xl bg-white p-4 rounded-tl-lg rounded-tr-lg select-none mb-4"
>
{
new
Date
().
toLocaleDateString
()
}
</
div
>
<
div
className
=
"overflow-y-auto"
>
{
data
.
map
((
item
,
index
)
=>
(
<
DailyScheduleItem
key
=
{
index
}
title
=
{
item
.
title
}
data
=
{
item
.
data
}
/>
))
}
...
...
222100414_222100415/vercel.json
0 → 100644
浏览文件 @
1f5bd8ea
{
"rewrites"
:
[
{
"source"
:
"/api/(.*)"
,
"destination"
:
"https://api.worldaquatics.com/$1"
}
]
}
222100414_222100415/vite.config.ts
浏览文件 @
1f5bd8ea
import
{
defineConfig
}
from
'
vite
'
;
import
react
from
'
@vitejs/plugin-react
'
;
import
eslint
from
'
vite-plugin-eslint
'
;
// https://vitejs.dev/config/
export
default
defineConfig
({
plugins
:
[
react
()]
plugins
:
[
react
()],
server
:
{
proxy
:
{
'
/api
'
:
{
target
:
'
https://api.worldaquatics.com
'
,
changeOrigin
:
true
,
rewrite
:
(
path
)
=>
path
.
replace
(
/^
\/
api/
,
''
)
}
}
}
});
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录