Skip to content

Commit

Permalink
ci(typos): enable check filename (#2851)
Browse files Browse the repository at this point in the history
* ci(typos): enable check filename

* chore: fix typo

* chore: actions/checkout@v4
  • Loading branch information
liweijie0812 authored Apr 19, 2024
1 parent 240b4d1 commit 3ca67e9
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pr-spelling.template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
name: Spell Check with Typos
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Check spelling
uses: crate-ci/typos@master
with:
Expand Down
11 changes: 4 additions & 7 deletions .github/workflows/typos-config.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
default.check-filename = true

[default.extend-words]
actived = "actived"
formated = "formated"
formate = "formate"
ba = "ba"
Contrl = "Contrl"
thead = "thead"
actived="actived"

[files]
extend-exclude = ["CHANGELOG.md"]
extend-exclude = ["CHANGELOG.md", "*.snap"]
12 changes: 6 additions & 6 deletions src/pagination/Pagination.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ const Pagination = forwardRef<HTMLDivElement, PaginationProps>((originalProps, r
}
};

const { totalContrl } = useTotal({ totalContent, pageSize, current, total });
const { totalControl } = useTotal({ totalContent, pageSize, current, total });

const { firstPageJumper, lastPageJumper } = useBoundaryJumper({
disabled,
Expand All @@ -132,7 +132,7 @@ const Pagination = forwardRef<HTMLDivElement, PaginationProps>((originalProps, r
changeCurrent,
});

const { pageNumberContrl } = usePageNumber({
const { pageNumberControl } = usePageNumber({
showPageNumber,
maxPageBtn,
disabled,
Expand All @@ -147,7 +147,7 @@ const Pagination = forwardRef<HTMLDivElement, PaginationProps>((originalProps, r
setJumpValue(current);
}, [current]);

const pageSizeContrl =
const pageSizeControl =
showPageSize && pageSizeOptions.length ? (
<div className={`${name}__select`}>
<Select
Expand Down Expand Up @@ -201,15 +201,15 @@ const Pagination = forwardRef<HTMLDivElement, PaginationProps>((originalProps, r
{...restProps}
>
{/* 总数据 */}
{totalContrl}
{totalControl}
{/* 分页器 */}
{pageSizeContrl}
{pageSizeControl}
{/* 首页跳转 */}
{firstPageJumper}
{/* 上一页跳转 */}
{prevJumper}
{/* 常规版 */}
{theme === 'default' && pageNumberContrl}
{theme === 'default' && pageNumberControl}
{/* 极简版 */}
{theme === 'simple' && Jumper}
{/* 下一页跳转 */}
Expand Down
4 changes: 2 additions & 2 deletions src/pagination/hooks/usePageNumber.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export default function usePageNumber(props) {

const isFolded = pageCount > maxPageBtn; // 判断是否为需要折叠

const pageNumberContrl = showPageNumber && (
const pageNumberControl = showPageNumber && (
<ul className={`${name}__pager`}>
{isFolded && isMidEllipsis && (
<>
Expand Down Expand Up @@ -133,5 +133,5 @@ export default function usePageNumber(props) {
</ul>
);

return { pageNumberContrl };
return { pageNumberControl };
}
8 changes: 4 additions & 4 deletions src/pagination/hooks/useTotal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ export default function useTotal(props) {

const { totalContent, pageSize, current, total } = props;

let totalContrl = null;
let totalControl = null;

if (totalContent === false) return { totalContrl };
if (totalContent === false) return { totalControl };

// 渲染total相关逻辑
const renderTotalContent = () => {
Expand All @@ -27,7 +27,7 @@ export default function useTotal(props) {
return totalContent;
};

totalContrl = <div className={`${name}__total`}>{renderTotalContent()}</div>;
totalControl = <div className={`${name}__total`}>{renderTotalContent()}</div>;

return { totalContrl };
return { totalControl };
}

0 comments on commit 3ca67e9

Please sign in to comment.