fix attachments

This commit is contained in:
srgooglo 2022-10-13 21:57:09 +02:00
parent 2de912fa5e
commit 8e8e7b314b
4 changed files with 10 additions and 10 deletions

View File

@ -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>
}

View File

@ -1,4 +1,4 @@
.post_additions {
.post_attachments {
position: relative;
display: flex;

View File

@ -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} />}
</>
}
}

View File

@ -100,7 +100,7 @@
.post_content {
height: 100%;
.post_additions {
.post_attachments {
.carousel-root {
.carousel {
height: 100%;