Skip to content

Commit

Permalink
✨ feat: 增加 classname props
Browse files Browse the repository at this point in the history
  • Loading branch information
arvinxx committed Sep 21, 2021
1 parent b17dc86 commit c88da1d
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
3 changes: 2 additions & 1 deletion packages/user-panel/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@
"dependencies": {
"@ant-design/icons": "^4.x",
"@ant-design/pro-form": "^1.x",
"antd": "^4.x",
"@arvinxu/i18n": "1.0.1",
"antd": "^4.x",
"classnames": "^2.3.1",
"react-router": "*"
}
}
6 changes: 5 additions & 1 deletion packages/user-panel/src/layout/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import React, { CSSProperties } from 'react';
import type { FC } from 'react';
import cls from 'classnames';

import type { FooterProps, HeaderProps } from '../components';
import { IntlProvider, Header, Footer } from '../components';
import './style.less';
Expand All @@ -10,6 +12,7 @@ export interface LayoutProps extends FooterProps, HeaderProps {
*/
showFooter?: boolean;
style?: CSSProperties;
className?: string;
}

const Layout: FC<LayoutProps> = ({
Expand All @@ -21,10 +24,11 @@ const Layout: FC<LayoutProps> = ({
type,
onRegisterClick,
style,
className,
}) => {
return (
<IntlProvider>
<div className="avx-user-panel-container" style={style}>
<div className={cls('avx-user-panel-container', className)} style={style}>
<Header type={type} logo={logo} logoUrl={logoUrl} />
{children}
{(onWechatLoginClick || onRegisterClick) && showFooter ? (
Expand Down
18 changes: 17 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2181,7 +2181,7 @@
dependencies:
regenerator-runtime "^0.13.4"

"@babel/runtime@^7.2.0":
"@babel/runtime@^7.12.13", "@babel/runtime@^7.2.0":
version "7.15.4"
resolved "https://registry.nlark.com/@babel/runtime/download/@babel/runtime-7.15.4.tgz#fd17d16bfdf878e6dd02d19753a39fa8a8d9c84a"
integrity sha1-/RfRa/34eObdAtGXU6OfqKjZyEo=
Expand Down Expand Up @@ -19175,6 +19175,22 @@ react-router-dom@5.2.0, react-router-dom@^5.1.2:
tiny-invariant "^1.0.2"
tiny-warning "^1.0.0"

react-router@*:
version "5.2.1"
resolved "https://registry.nlark.com/react-router/download/react-router-5.2.1.tgz#4d2e4e9d5ae9425091845b8dbc6d9d276239774d"
integrity sha1-TS5OnVrpQlCRhFuNvG2dJ2I5d00=
dependencies:
"@babel/runtime" "^7.12.13"
history "^4.9.0"
hoist-non-react-statics "^3.1.0"
loose-envify "^1.3.1"
mini-create-react-context "^0.4.0"
path-to-regexp "^1.7.0"
prop-types "^15.6.2"
react-is "^16.6.0"
tiny-invariant "^1.0.2"
tiny-warning "^1.0.0"

react-router@5.2.0:
version "5.2.0"
resolved "https://registry.npm.taobao.org/react-router/download/react-router-5.2.0.tgz#424e75641ca8747fbf76e5ecca69781aa37ea293"
Expand Down

0 comments on commit c88da1d

Please sign in to comment.