Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
ant-design-pro
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
duanledexianxianxian
ant-design-pro
Commits
2a11d9ac
Commit
2a11d9ac
authored
Mar 03, 2018
by
jim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix review warning
parent
e9d8e007
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
3 deletions
+44
-3
src/routes/UserProfile/Userinfo/Info.js
src/routes/UserProfile/Userinfo/Info.js
+36
-3
src/routes/UserProfile/Userinfo/Info.less
src/routes/UserProfile/Userinfo/Info.less
+8
-0
No files found.
src/routes/UserProfile/Userinfo/Info.js
View file @
2a11d9ac
...
...
@@ -25,8 +25,16 @@ export default class Info extends Component {
key
=
menuMap
[
key
]
?
key
:
'
base
'
;
this
.
state
=
{
selectKey
:
key
,
mode
:
'
inline
'
,
};
}
componentDidMount
()
{
window
.
addEventListener
(
'
resize
'
,
this
.
resize
);
this
.
resize
();
}
componentWillUnmount
()
{
window
.
removeEventListener
(
'
resize
'
,
this
.
resize
);
}
getmenu
=
()
=>
{
return
Object
.
keys
(
menuMap
).
map
(
item
=>
(
<
Item
key
=
{
item
}
>
{
menuMap
[
item
]}
<
/Item
>
...
...
@@ -41,16 +49,37 @@ export default class Info extends Component {
selectKey
:
key
,
});
};
resize
=
()
=>
{
if
(
!
this
.
main
)
{
return
;
}
let
mode
=
'
inline
'
;
const
{
offsetWidth
}
=
this
.
main
;
if
(
this
.
main
.
offsetWidth
<
641
&&
offsetWidth
>
400
)
{
mode
=
'
horizontal
'
;
}
if
(
window
.
innerWidth
<
768
&&
offsetWidth
>
400
)
{
mode
=
'
horizontal
'
;
}
this
.
setState
({
mode
,
});
};
render
()
{
const
{
match
,
routerData
,
currentUser
}
=
this
.
props
;
if
(
!
currentUser
.
userid
)
{
return
''
;
}
return
(
<
div
className
=
{
styles
.
main
}
>
<
div
className
=
{
styles
.
main
}
ref
=
{(
ref
)
=>
{
this
.
main
=
ref
;
}}
>
<
div
className
=
{
styles
.
leftmenu
}
>
<
Menu
mode
=
"
inline
"
mode
=
{
this
.
state
.
mode
}
selectedKeys
=
{[
this
.
state
.
selectKey
]}
onClick
=
{
this
.
selectKey
}
>
...
...
@@ -70,7 +99,11 @@ export default class Info extends Component {
exact
=
{
item
.
exact
}
/
>
))}
<
Redirect
exact
from
=
"
/user-profile/userinfo
"
to
=
"
/user-profile/userinfo/base
"
/>
<
Redirect
exact
from
=
"
/user-profile/userinfo
"
to
=
"
/user-profile/userinfo/base
"
/>
<
Redirect
to
=
"
/exception/404
"
/>
<
/Switch
>
<
/div
>
...
...
src/routes/UserProfile/Userinfo/Info.less
View file @
2a11d9ac
...
...
@@ -15,6 +15,9 @@
.ant-menu-inline {
border: none;
}
.ant-menu:not(.ant-menu-horizontal) .ant-menu-item-selected {
font-weight: bold;
}
}
}
.right {
...
...
@@ -31,6 +34,11 @@
margin-bottom: 12px;
}
}
:global {
.ant-list-split .ant-list-item:last-child {
border-bottom: 1px solid #e8e8e8;
}
}
}
:global {
.ant-list-item-meta {
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment