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 "plyr-react/dist/plyr.css"
import "./index.less" import "./index.less"
export default class PostAdditions extends React.PureComponent { export default class PostAttachments extends React.PureComponent {
getAdditions = (data) => { getAttachments = (data) => {
return data.map((addition, index) => { return data.map((addition, index) => {
if (typeof addition === "string") { if (typeof addition === "string") {
addition = { addition = {
@ -109,14 +109,14 @@ export default class PostAdditions extends React.PureComponent {
} }
render() { render() {
return <div className="post_additions"> return <div className="post_attachments">
<Carousel <Carousel
showArrows={true} showArrows={true}
showStatus={false} showStatus={false}
showThumbs={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> </Carousel>
</div> </div>
} }

View File

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

View File

@ -6,12 +6,12 @@ import { processString } from "utils"
import { Icons } from "components/Icons" import { Icons } from "components/Icons"
import PostAdditions from "../additions" import PostAttachments from "../attachments"
import "./index.less" import "./index.less"
export default React.memo((props) => { export default React.memo((props) => {
let { message, additions, type, data } = props.data let { message, attachments, type, data } = props.data
if (typeof data === "string") { if (typeof data === "string") {
try { try {
@ -99,7 +99,7 @@ export default React.memo((props) => {
{message} {message}
</div> </div>
{additions.length > 0 && <PostAdditions additions={additions} />} {attachments.length > 0 && <PostAttachments attachments={attachments} />}
</> </>
} }
} }

View File

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