Skip to content

Commit

Permalink
feat: export sider context from layout for v4 (#45947)
Browse files Browse the repository at this point in the history
* feat: export sider context from layout for v4

Signed-off-by: Peach <scdzwyxst@gmail.com>

* chore: ci ignore peer deps

Signed-off-by: Peach <scdzwyxst@gmail.com>

* chore: ci ignore peer deps

* chore: ci ignore peer deps

* chore: use npmrc for ignore peer deps

* chore: update eslint config

* chore: correct eslintrc

* chore: codesandbox ci node version

---------

Signed-off-by: Peach <scdzwyxst@gmail.com>
  • Loading branch information
PeachScript committed Nov 21, 2023
1 parent 6695e7d commit 0e6fe5f
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .codesandbox/ci.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"sandboxes": ["antd-reproduction-template-y9vgcf"],
"node": "14"
"node": "18"
}
25 changes: 12 additions & 13 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,18 @@ components/**/*.jsx
!.*.js
~*
# Docs templates
site/theme/template/Color/ColorPicker.jsx
site/theme/template/IconDisplay/*.js
site/theme/template/IconDisplay/*.jsx
site/theme/template/IconDisplay/fields.js
site/theme/template/Home/**/*.jsx
site/theme/template/utils.jsx
site/theme/template/Layout/**/*.jsx
site/theme/template/Layout/Footer.jsx
site/theme/template/Content/Article.jsx
site/theme/template/Content/EditButton.jsx
site/theme/template/Resources/*.jsx
site/theme/template/Resources/**/*.jsx
site/theme/template/NotFound.jsx
site/theme/template/Color/ColorPicker.tsx
site/theme/template/IconDisplay/*.ts
site/theme/template/IconDisplay/*.tsx
site/theme/template/IconDisplay/fields.ts
site/theme/template/Home/**/*.tsx
site/theme/template/utils.tsx
site/theme/template/Layout/**/*.tsx
site/theme/template/Content/Article.tsx
site/theme/template/Content/EditButton.tsx
site/theme/template/Resources/*.tsx
site/theme/template/Resources/**/*.tsx
site/theme/template/NotFound.tsx
typings
es/**/*
lib/**/*
Expand Down
6 changes: 6 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ module.exports = {
'react/no-unstable-nested-components': 0,
},
},
{
files: ['components/pagination/Pagination.tsx'],
rules: {
'jsx-a11y/control-has-associated-label': 0,
},
},
],
rules: {
'react/jsx-one-expression-per-line': 0,
Expand Down
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
legacy-peer-deps=true
5 changes: 4 additions & 1 deletion components/layout/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import InternalLayout, { Content, Footer, Header } from './layout';
import Sider from './Sider';
import Sider, { SiderContext } from './Sider';

export { BasicProps as LayoutProps } from './layout';
export { SiderProps } from './Sider';
Expand All @@ -11,6 +11,8 @@ type CompoundedComponent = InternalLayoutType & {
Footer: typeof Footer;
Content: typeof Content;
Sider: typeof Sider;
/** @private Internal Context. Do not use in your production. */
_InternalSiderContext: typeof SiderContext;
};

const Layout = InternalLayout as CompoundedComponent;
Expand All @@ -19,5 +21,6 @@ Layout.Header = Header;
Layout.Footer = Footer;
Layout.Content = Content;
Layout.Sider = Sider;
Layout._InternalSiderContext = SiderContext;

export default Layout;

0 comments on commit 0e6fe5f

Please sign in to comment.