first commit
This commit is contained in:
19
src/components/widget/AuthWidget.tsx
Normal file
19
src/components/widget/AuthWidget.tsx
Normal file
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* Created by 叶子 on 2017/7/31.
|
||||
*/
|
||||
import { Component } from 'react';
|
||||
import { connectAlita } from 'redux-alita';
|
||||
|
||||
type AuthWidgetProps = {
|
||||
auth: any;
|
||||
children: (param: any) => React.ReactElement;
|
||||
};
|
||||
|
||||
class AuthWidget extends Component<AuthWidgetProps> {
|
||||
render() {
|
||||
const { auth = {} } = this.props;
|
||||
return this.props.children(auth.data || {});
|
||||
}
|
||||
}
|
||||
|
||||
export default connectAlita(['auth'])(AuthWidget);
|
||||
Reference in New Issue
Block a user