-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: 大致完成排行榜页面的开发,实现来源与仓库搜索功能。月份功能待优化。其他布局待优化
Signed-off-by: Bruce-Jay <[email protected]>
- Loading branch information
Showing
13 changed files
with
757 additions
and
241 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
import { Select, Input, Button, Space, DatePicker, ConfigProvider } from "antd"; | ||
import type { DatePickerProps } from "antd"; | ||
import { useContext, useState } from "react"; | ||
|
||
interface BannerProps { | ||
setPlatform: (value: string) => void; | ||
setRepo: (value: string) => void; | ||
setDate: (date: any) => void; | ||
} | ||
|
||
const Banner = ({ setPlatform, setRepo, setDate }: BannerProps) => { | ||
const [searchRepo, setSearchRepo] = useState<string>("X-lab2017/open-digger"); | ||
|
||
const handlePlatformChange = (value: string) => { | ||
setPlatform(value); | ||
console.log(value); | ||
}; | ||
|
||
const handleRepoChange = (e: React.ChangeEvent<HTMLInputElement>) => { | ||
setSearchRepo(e.target.value); | ||
}; | ||
|
||
const handleRepoSearch = () => { | ||
setRepo(searchRepo); | ||
}; | ||
|
||
const handleDateChange: DatePickerProps["onChange"] = (date, dateString) => { | ||
setDate(date); | ||
console.log(date, dateString); | ||
}; | ||
return ( | ||
<div className="banner-box"> | ||
<div className="banner-title">OpenRank贡献度排行榜</div> | ||
<div className="banner-content"> | ||
<Select | ||
defaultValue="github" | ||
style={{ width: 120 }} | ||
options={[ | ||
{ value: "github", label: "GitHub" }, | ||
{ value: "gitee", label: "Gitee" }, | ||
{ value: "gitlab", label: "GitLab" }, | ||
]} | ||
onChange={handlePlatformChange} | ||
/> | ||
<div> | ||
<Space.Compact style={{ width: "300px" }}> | ||
<Input | ||
defaultValue="X-lab2017/open-digger" | ||
onChange={handleRepoChange} | ||
/> | ||
<Button type="primary" onClick={handleRepoSearch}> | ||
查询 | ||
</Button> | ||
</Space.Compact> | ||
</div> | ||
<ConfigProvider | ||
theme={{ | ||
components: { | ||
DatePicker: { | ||
cellHeight: 52, | ||
cellWidth: 23, | ||
}, | ||
}, | ||
}} | ||
> | ||
<DatePicker onChange={handleDateChange} picker="month" /> | ||
</ConfigProvider> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Banner; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.