Rename media gallery items
This commit is contained in:
parent
5d0469adef
commit
cb94d09ef9
6 changed files with 15 additions and 21 deletions
52
ts/components/conversation/media-gallery/MediaGridItem.tsx
Normal file
52
ts/components/conversation/media-gallery/MediaGridItem.tsx
Normal file
|
@ -0,0 +1,52 @@
|
|||
/**
|
||||
* @prettier
|
||||
*/
|
||||
import React from 'react';
|
||||
|
||||
import { LoadingIndicator } from './LoadingIndicator';
|
||||
import { Message } from './propTypes/Message';
|
||||
|
||||
interface Props {
|
||||
message: Message;
|
||||
}
|
||||
|
||||
const size = {
|
||||
width: 94,
|
||||
height: 94,
|
||||
};
|
||||
const styles = {
|
||||
container: {
|
||||
...size,
|
||||
backgroundColor: '#f3f3f3',
|
||||
marginRight: 4,
|
||||
marginBottom: 4,
|
||||
},
|
||||
image: {
|
||||
...size,
|
||||
backgroundSize: 'cover',
|
||||
},
|
||||
};
|
||||
|
||||
export class MediaGridItem extends React.Component<Props, {}> {
|
||||
public renderContent() {
|
||||
const { message } = this.props;
|
||||
|
||||
if (!message.objectURL) {
|
||||
return <LoadingIndicator />;
|
||||
}
|
||||
|
||||
return (
|
||||
<div
|
||||
style={{
|
||||
...styles.container,
|
||||
...styles.image,
|
||||
backgroundImage: `url("${message.objectURL}")`,
|
||||
}}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
public render() {
|
||||
return <div style={styles.container}>{this.renderContent()}</div>;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue