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 "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>
|
||||||
}
|
}
|
@ -1,4 +1,4 @@
|
|||||||
.post_additions {
|
.post_attachments {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
display: flex;
|
display: flex;
|
@ -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} />}
|
||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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%;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user