mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-10 02:54:15 +00:00
fix attachments
This commit is contained in:
parent
2de912fa5e
commit
8e8e7b314b
@ -28,8 +28,8 @@ import "react-responsive-carousel/lib/styles/carousel.min.css"
|
||||
import "plyr-react/dist/plyr.css"
|
||||
import "./index.less"
|
||||
|
||||
export default class PostAdditions extends React.PureComponent {
|
||||
getAdditions = (data) => {
|
||||
export default class PostAttachments extends React.PureComponent {
|
||||
getAttachments = (data) => {
|
||||
return data.map((addition, index) => {
|
||||
if (typeof addition === "string") {
|
||||
addition = {
|
||||
@ -109,14 +109,14 @@ export default class PostAdditions extends React.PureComponent {
|
||||
}
|
||||
|
||||
render() {
|
||||
return <div className="post_additions">
|
||||
return <div className="post_attachments">
|
||||
<Carousel
|
||||
showArrows={true}
|
||||
showStatus={false}
|
||||
showThumbs={false}
|
||||
showIndicators={this.props.additions?.length > 1 ?? false}
|
||||
showIndicators={this.props.attachments?.length > 1 ?? false}
|
||||
>
|
||||
{this.getAdditions(this.props.additions)}
|
||||
{this.getAttachments(this.props.attachments)}
|
||||
</Carousel>
|
||||
</div>
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
.post_additions {
|
||||
.post_attachments {
|
||||
position: relative;
|
||||
|
||||
display: flex;
|
@ -6,12 +6,12 @@ import { processString } from "utils"
|
||||
|
||||
import { Icons } from "components/Icons"
|
||||
|
||||
import PostAdditions from "../additions"
|
||||
import PostAttachments from "../attachments"
|
||||
|
||||
import "./index.less"
|
||||
|
||||
export default React.memo((props) => {
|
||||
let { message, additions, type, data } = props.data
|
||||
let { message, attachments, type, data } = props.data
|
||||
|
||||
if (typeof data === "string") {
|
||||
try {
|
||||
@ -99,7 +99,7 @@ export default React.memo((props) => {
|
||||
{message}
|
||||
</div>
|
||||
|
||||
{additions.length > 0 && <PostAdditions additions={additions} />}
|
||||
{attachments.length > 0 && <PostAttachments attachments={attachments} />}
|
||||
</>
|
||||
}
|
||||
}
|
||||
|
@ -100,7 +100,7 @@
|
||||
.post_content {
|
||||
height: 100%;
|
||||
|
||||
.post_additions {
|
||||
.post_attachments {
|
||||
.carousel-root {
|
||||
.carousel {
|
||||
height: 100%;
|
||||
|
Loading…
x
Reference in New Issue
Block a user