parent
9042f31b7f
commit
be9c78966a
31 changed files with 140 additions and 71 deletions
@ -1,6 +1,6 @@ |
||||
import React, { Component } from 'react'; |
||||
import Carousel from 'react-elastic-carousel'; |
||||
import './ChatSuggest.scss'; |
||||
import './index.scss'; |
||||
export default function suggetbar({ suggest }) { |
||||
return ( |
||||
<div className="chat-suggest portrait-slider d-flex flex-column"> |
@ -1,7 +1,7 @@ |
||||
import React, { Component } from 'react'; |
||||
import Avatar from '@material-ui/core/Avatar'; |
||||
|
||||
import './Message2D.scss'; |
||||
import './index.scss'; |
||||
import { toast } from 'react-toastify'; |
||||
|
||||
export default class Message2D extends Component { |
@ -1,38 +0,0 @@ |
||||
import React, { Component } from 'react'; |
||||
|
||||
import NormalMessage from './NormalMessage/NormalMessage'; |
||||
import Message2D from './Message2D/Message2D'; |
||||
import DraggableMessage from './DraggableMessage/DraggableMessage'; |
||||
import SliderMessage from './SliderMessage/SliderMessage.js'; |
||||
import RadioMessage from './RadioMessage/RadioMessage.js'; |
||||
|
||||
export default class Message extends Component { |
||||
render() { |
||||
const { message, user, isSelf, file, document, prevUserId, isActive } = this.props; |
||||
return ( |
||||
<div style={{ marginTop: 5 }}> |
||||
<NormalMessage |
||||
prevUserId={prevUserId} |
||||
message={message} |
||||
user={user} |
||||
isSelf={isSelf} |
||||
file={file} |
||||
document={document} |
||||
> |
||||
{message.type === '2d' ? ( |
||||
<Message2D message={message} user={user} isSelf={isSelf} isActive={isActive} /> |
||||
) : null} |
||||
{message.type === 'draggable' ? ( |
||||
<DraggableMessage message={message} user={user} isSelf={isSelf} isActive={isActive} /> |
||||
) : null} |
||||
{message.type === 'slider' ? ( |
||||
<SliderMessage message={message} user={user} isSelf={isSelf} isActive={isActive} /> |
||||
) : null} |
||||
{message.type === 'radio' ? ( |
||||
<RadioMessage message={message} user={user} isSelf={isSelf} isActive={isActive} /> |
||||
) : null} |
||||
</NormalMessage> |
||||
</div> |
||||
); |
||||
} |
||||
} |
@ -0,0 +1,63 @@ |
||||
import React, { Component } from 'react'; |
||||
import ArrowRightAltIcon from '@material-ui/icons/ArrowRightAlt'; |
||||
import Avatar from '@material-ui/core/Avatar'; |
||||
import { toast } from 'react-toastify'; |
||||
|
||||
export default class RadioMessage extends Component { |
||||
constructor(props) { |
||||
super(props); |
||||
this.state = { |
||||
value: this.props.message.value, |
||||
}; |
||||
} |
||||
|
||||
handleRadioChange = (newValue) => { |
||||
if (this.props.isActive) |
||||
this.setState({ |
||||
value: newValue, |
||||
}); |
||||
}; |
||||
|
||||
render() { |
||||
const { message, user, isSelf, isActive } = this.props; |
||||
return ( |
||||
<div className="message-2d d-flex flex-column d-flex"> |
||||
<div className="message-2d__options d-flex flex-wrap justify-content-center"> |
||||
{message.options.map((row) => ( |
||||
<Row list={row} handleRadioChange={this.handleRadioChange} value={this.state.value} /> |
||||
))} |
||||
</div> |
||||
{isActive && ( |
||||
<button className="message-2d__submit" onClick={() => toast.success('ثبت شد')}> |
||||
ثبت |
||||
<ArrowRightAltIcon style={{ color: 'white', width: 32, height: 32, marginLeft: 10 }} /> |
||||
</button> |
||||
)} |
||||
</div> |
||||
); |
||||
} |
||||
} |
||||
|
||||
const Row = (props) => { |
||||
return ( |
||||
<div className="message-2d__options--row d-flex"> |
||||
{props.list.map((item) => ( |
||||
<Item item={item} {...props} /> |
||||
))} |
||||
</div> |
||||
); |
||||
}; |
||||
|
||||
const Item = (props) => { |
||||
return ( |
||||
<div |
||||
onClick={() => props.handleRadioChange(props.item.name)} |
||||
style={{ |
||||
backgroundColor: props.item.name === props.value ? '#6f42c1' : 'rgb(181 224 252 / 47%)', |
||||
color: props.item.name === props.value ? 'white' : 'black', |
||||
}} |
||||
> |
||||
{props.item.name} |
||||
</div> |
||||
); |
||||
}; |
@ -0,0 +1,36 @@ |
||||
import React, { Component } from 'react'; |
||||
import Normal from './Normal'; |
||||
import Inline from './Inline'; |
||||
import Sort from './Sort'; |
||||
import Slider from './Slider'; |
||||
import Select from './Select'; |
||||
import MultiSelect from './MultiSelect'; |
||||
import './index.scss'; |
||||
const types = { |
||||
normal: <></>, |
||||
sort: Sort, |
||||
inline: Inline, |
||||
silder: Slider, |
||||
select: Select, |
||||
multiselect: MultiSelect, |
||||
}; |
||||
export default class Message extends Component { |
||||
render() { |
||||
const { message, user, isSelf, file, document, prevUserId, isActive } = this.props; |
||||
const Key = types[message.type]; |
||||
return ( |
||||
<div className="Message"> |
||||
<Normal |
||||
prevUserId={prevUserId} |
||||
message={message} |
||||
user={user} |
||||
isSelf={isSelf} |
||||
file={file} |
||||
document={document} |
||||
> |
||||
<Key message={message} isSelf={isSelf} isActive={isActive} /> |
||||
</Normal> |
||||
</div> |
||||
); |
||||
} |
||||
} |
@ -0,0 +1,5 @@ |
||||
@media screen and (max-width: 4500px) { |
||||
.Message { |
||||
margin-top: 2px; |
||||
} |
||||
} |
@ -1,6 +1,6 @@ |
||||
import React, { Component } from 'react'; |
||||
|
||||
import './FileTabs.scss'; |
||||
import './index.scss'; |
||||
export default class FileTabs extends Component { |
||||
constructor(props) { |
||||
super(props); |
@ -1,12 +1,10 @@ |
||||
import React, { Component } from 'react'; |
||||
import ChatIcon from '@material-ui/icons/Chat'; |
||||
|
||||
import FileTabs from './FileTabs/FileTabs'; |
||||
import Gallery from './Gallery/Gallery.js'; |
||||
|
||||
import FileTabs from './FileTabs'; |
||||
import Gallery from './Gallery'; |
||||
import user2 from '../../../assets/images/user2.png'; |
||||
|
||||
import './ChatInfo.scss'; |
||||
import './index.scss'; |
||||
export default class ChatInfo extends Component { |
||||
constructor(props) { |
||||
super(props); |
Loading…
Reference in new issue