-
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: add repo sort and page pagination (#345)
Signed-off-by: laixingyou <[email protected]>
- Loading branch information
1 parent
4c8badd
commit e941761
Showing
4 changed files
with
164 additions
and
74 deletions.
There are no files selected for viewing
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,21 @@ | ||
import React, { useEffect, useState } from 'react'; | ||
import { Pagination, ConfigProvider } from 'antd'; | ||
import getLocale from '@common/utils/getLocale'; | ||
import zhCN from 'antd/locale/zh_CN'; | ||
import enUS from 'antd/locale/en_US'; | ||
|
||
const MyTable = (props) => { | ||
const [local, setLocale] = useState(enUS); | ||
useEffect(() => { | ||
const l = getLocale(); | ||
setLocale(l === 'zh' ? zhCN : enUS); | ||
}, []); | ||
return ( | ||
<div> | ||
<ConfigProvider locale={local}> | ||
<Pagination {...props} /> | ||
</ConfigProvider> | ||
</div> | ||
); | ||
}; | ||
export default MyTable; |
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