Skip to content

Commit e17b2c3

Browse files
committed
Fixed auto format.
1 parent fd692dc commit e17b2c3

File tree

3 files changed

+60
-60
lines changed

3 files changed

+60
-60
lines changed

src/components/admin/Admin.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
.panel-container {
66
padding: 24px 24px 24px 34px;
77
min-width: 768px;
8-
}
8+
}

src/components/admin/Admin.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export class Admin extends React.PureComponent<AdminProps> {
3838
<Menu
3939
mode="inline"
4040
selectedKeys={[current]}
41-
style={{ height: '100%', width: '215px'}}
41+
style={{ height: '100%', width: '215px' }}
4242
>
4343
<Menu.Item key="overview"><Link to="/admin">Overview</Link></Menu.Item>
4444
<Menu.ItemGroup key="articles" title="文章管理">

src/components/parts/UserMenu.tsx

Lines changed: 58 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -11,79 +11,79 @@ import { resizeGoogleAvatar } from '../../libs/utils';
1111
import { auth2 } from '../../libs/googleAuth2';
1212

1313
interface UserMenuProps extends RouteComponentProps<{}> {
14-
user: User;
15-
logout(): void;
14+
user: User;
15+
logout(): void;
1616
}
1717

1818
class UserMenu extends React.Component<UserMenuProps> {
19-
logout = () => {
20-
// Perform AJAX request here
21-
localStorage.authToken = '';
19+
logout = () => {
20+
// Perform AJAX request here
21+
localStorage.authToken = '';
2222

23-
auth2
24-
.then(api => api.getAuthInstance().signOut())
25-
.catch(() => 0) // Do nothing
26-
.then(this.props.logout); // Always
27-
};
23+
auth2
24+
.then(api => api.getAuthInstance().signOut())
25+
.catch(() => 0) // Do nothing
26+
.then(this.props.logout); // Always
27+
};
2828

29-
render() {
30-
const { user } = this.props;
29+
render() {
30+
const { user } = this.props;
3131

32-
if (user === null) {
33-
return (
34-
<Link to={{ pathname: '/login', state: { from: location.pathname } }}>
35-
<Button type="dashed" className="login-btn">
36-
登录
32+
if (user === null) {
33+
return (
34+
<Link to={{ pathname: '/login', state: { from: location.pathname } }}>
35+
<Button type="dashed" className="login-btn">
36+
登录
3737
</Button>
38-
</Link>
39-
);
40-
}
41-
42-
return (
43-
<Dropdown
44-
trigger={['click']}
45-
placement="bottomRight"
46-
overlay={
47-
<Menu>
48-
<Menu.Item>Signed in as {user.name}</Menu.Item>
49-
<Menu.Divider />
50-
<Menu.Item>
51-
<Link to={'/user/' + user.id}>个人主页</Link>
52-
</Menu.Item>
53-
<Menu.Item>
54-
<a onClick={this.logout}>注销</a>
55-
</Menu.Item>
56-
</Menu>
38+
</Link>
39+
);
5740
}
58-
>
59-
{user.avatar ? (
60-
<Avatar
61-
className="user-avatar"
62-
src={resizeGoogleAvatar(user.avatar, 32)}
63-
/>
64-
) : (
65-
<Avatar className="user-avatar" icon="user" />
66-
)}
67-
</Dropdown>
68-
);
69-
}
41+
42+
return (
43+
<Dropdown
44+
trigger={['click']}
45+
placement="bottomRight"
46+
overlay={
47+
<Menu>
48+
<Menu.Item>Signed in as {user.name}</Menu.Item>
49+
<Menu.Divider />
50+
<Menu.Item>
51+
<Link to={'/user/' + user.id}>个人主页</Link>
52+
</Menu.Item>
53+
<Menu.Item>
54+
<a onClick={this.logout}>注销</a>
55+
</Menu.Item>
56+
</Menu>
57+
}
58+
>
59+
{user.avatar ? (
60+
<Avatar
61+
className="user-avatar"
62+
src={resizeGoogleAvatar(user.avatar, 32)}
63+
/>
64+
) : (
65+
<Avatar className="user-avatar" icon="user" />
66+
)}
67+
</Dropdown>
68+
);
69+
}
7070
}
7171

7272
const mapStateToProps = (state: State) => ({
73-
user: state.auth.user
73+
user: state.auth.user
7474
});
7575

7676
const mapDispatchToProps = (dispatch: Dispatch<State>) => ({
77-
logout() {
78-
dispatch({
79-
type: AUTH_RESET
80-
});
81-
}
77+
logout() {
78+
dispatch({
79+
type: AUTH_RESET
80+
});
81+
}
8282
});
8383

8484
export default withRouter(
85-
connect(
86-
mapStateToProps,
87-
mapDispatchToProps
88-
)(UserMenu)
85+
connect(
86+
mapStateToProps,
87+
mapDispatchToProps
88+
)(UserMenu)
8989
);

0 commit comments

Comments
 (0)