forked from trazyn/weweChat
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
185 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,6 +60,7 @@ label { | |
.link { | ||
padding: 0; | ||
margin: 0; | ||
outline: 0; | ||
text-decoration: none; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
|
||
import React, { Component, PropTypes } from 'react'; | ||
import clazz from 'classname'; | ||
|
||
import './style.global.css'; | ||
import TransitionPortal from 'components/TransitionPortal'; | ||
|
||
export default class Suggestion extends Component { | ||
static propTypes = { | ||
show: PropTypes.bool.isRequired, | ||
list: PropTypes.array.isRequired, | ||
}; | ||
|
||
renderContent() { | ||
var { show, list, selected } = this.props; | ||
|
||
if (!show) { | ||
return false; | ||
} | ||
|
||
console.log(window.event); | ||
|
||
return ( | ||
<div className="Suggestion"> | ||
{ | ||
list.map((e, index) => { | ||
return ( | ||
<div | ||
key={index} | ||
className={clazz('Suggestion-item', { | ||
'Suggestion--selected': e.UserName === selected | ||
})}> | ||
<img src={e.HeadImgUrl} /> | ||
|
||
<div className="Suggestion-user"> | ||
<p className="Suggestion-username" dangerouslySetInnerHTML={{__html: e.RemarkName || e.NickName}} /> | ||
</div> | ||
</div> | ||
); | ||
}) | ||
} | ||
</div> | ||
); | ||
} | ||
|
||
render() { | ||
return ( | ||
<TransitionPortal transitionEnterTimeout={0} transitionLeaveTimeout={150} transitionName="Suggestion"> | ||
{ | ||
this.renderContent() | ||
} | ||
</TransitionPortal> | ||
); | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
|
||
.Suggestion { | ||
position: fixed; | ||
bottom: 60px; | ||
left: 311px; | ||
height: calc(100vh - 200px); | ||
background: #fff; | ||
box-shadow: 0 0 24px 0 rgba(0, 0, 0, .2); | ||
border-radius: 1px; | ||
overflow: hidden; | ||
overflow-y: auto; | ||
} | ||
|
||
.Suggestion-item { | ||
display: flex; | ||
padding: 6px 12px; | ||
justify-content: flex-start; | ||
align-items: center; | ||
cursor: pointer; | ||
} | ||
|
||
.Suggestion--selected, | ||
.Suggestion-item:hover { | ||
background: #405de6; | ||
} | ||
|
||
.Suggestion--selected .Suggestion-username, | ||
.Suggestion-item:hover .Suggestion-username { | ||
color: #fff; | ||
} | ||
|
||
.Suggestion-item img { | ||
width: 24px; | ||
height: 24px; | ||
margin-right: 12px; | ||
} | ||
|
||
.Suggestion-username { | ||
padding: 0; | ||
margin: 0; | ||
} | ||
|
||
.Suggestion-username { | ||
color: #777; | ||
margin-bottom: 2px; | ||
} | ||
|
||
.Suggestion-enter { | ||
transform: translateY(24px); | ||
opacity: 0; | ||
transition: .2s cubic-bezier(.5, -.55, .4, 1.55); | ||
} | ||
|
||
.Suggestion-enter.Suggestion-enter-active { | ||
transform: translateY(0); | ||
opacity: 1; | ||
} | ||
|
||
.Suggestion-leave { | ||
opacity: 1; | ||
transition: .14s; | ||
} | ||
|
||
.Suggestion-leave.Suggestion-leave-active { | ||
transform: translateY(-24px); | ||
opacity: 0; | ||
} | ||
|
||
.Suggestion-input-user { | ||
display: flex; | ||
padding: 0 23px; | ||
margin: 0 2px; | ||
height: 32px; | ||
align-items: center; | ||
background: rgba(230, 230, 230, 1); | ||
color: #777; | ||
border-radius: 32px; | ||
white-space: nowrap; | ||
} | ||
|
||
.Suggestion-input-user img { | ||
height: 20px; | ||
width: 20px; | ||
margin-right: 2px; | ||
} | ||
|
||
.Suggestion-input-user * { | ||
display: inline-block; | ||
white-space: nowrap; | ||
} | ||
|
||
@media (width <= 800px) { | ||
.Suggestion { | ||
bottom: 48px; | ||
left: 280px; | ||
} | ||
|
||
.Suggestion-item { | ||
display: flex; | ||
padding: 6px 12px; | ||
} | ||
|
||
.Suggestion-item img { | ||
width: 24px; | ||
height: 24px; | ||
margin-right: 12px; | ||
} | ||
|
||
.Suggestion-username { | ||
margin-bottom: 2px; | ||
} | ||
|
||
.Suggestion-input-user { | ||
padding: 0 23px; | ||
margin: 0 2px; | ||
height: 32px; | ||
border-radius: 32px; | ||
} | ||
|
||
.Suggestion-input-user img { | ||
height: 20px; | ||
width: 20px; | ||
margin-right: 2px; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters