Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Complete Task 1: Platform Switch for Gitee and Github Rankings #120

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion src/components/TablePanel.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { Row, Col, Radio, Switch, Input } from 'antd';
import { Row, Col, Radio, Switch, Input, Select } from 'antd';
import { t } from 'i18next';
import React from 'react';
import SwitchablePicker from './datePicker';

const { Search } = Input;
const { Option } = Select;

const TablePanel = (props) => {
return (
Expand Down Expand Up @@ -34,6 +35,19 @@ const TablePanel = (props) => {
<Radio value={'open_rank'}>{t('influence')}</Radio>
</Radio.Group>
</Col>
<Col>
<span className="myFontColor">{t('source')}</span>
<Radio.Group
onChange={(e) => {
props.setState({ source: e.target.value });
}}
value={props.source}
>
<Radio value={'all'}>All</Radio>
<Radio value={'github'}>Github</Radio>
<Radio value={'gitee'}>Gitee</Radio>
</Radio.Group>
</Col>
</Row>
<Row justify="space-between" style={{ minHeight: '50px' }} gutter={10}>
<Col>
Expand Down
3 changes: 3 additions & 0 deletions src/components/table.js
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,7 @@ function MyTable(props) {
year: null, // 字符串格式
month: null, // 整数格式,0表示1月,1表示2月..., null for year type time
type: 'month',
source: 'all',
search: null,
});

Expand Down Expand Up @@ -493,6 +494,7 @@ function MyTable(props) {
month,
year,
type,
source,
} = state;
return (
<div className="table">
Expand All @@ -505,6 +507,7 @@ function MyTable(props) {
}}
>
<TablePanel
source={source}
type={type}
setState={updateDate}
object={object}
Expand Down
1 change: 1 addition & 0 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"detail": "Detail: ",
"item": "Item: ",
"region": "Region: ",
"source": "Source: ",
"developer": "Developer",
"loading": "Loading",
"month": "Monthly",
Expand Down
1 change: 1 addition & 0 deletions src/locales/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"detail": "详情: ",
"item": "目标: ",
"region": "地区: ",
"source": "来源: ",
"developer": "开发者",
"loading": "加载中",
"month": "月度",
Expand Down
Loading