Skip to content

Commit

Permalink
WIP: inline images
Browse files Browse the repository at this point in the history
  • Loading branch information
seavan committed Oct 17, 2017
1 parent 600d713 commit 1d9d45c
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions app/components/files/file-inline-image.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,30 @@
import React from 'react';
import { observer } from 'mobx-react/native';
import { observable } from 'mobx';
import { View, Image, Text } from 'react-native';
import SafeComponent from '../shared/safe-component';

const OPTIMAL_WIDTH = 300;
const OPTIMAL_HEIGHT = 200;

@observer
export default class FileInlineImage extends SafeComponent {
@observable width = 10;
@observable height = 10;

componentWillMount() {
Image.getSize(this.props.image, (width, height) => {

});
}

renderThrow() {
const { image } = this.props;
const { width, height } = this;
const source = { uri: image };
return (
<View>
<Text>{image}</Text>
<Image source={source} style={{ width: 100, height: 100 }} />
<Image source={source} style={{ width, height }} />
</View>
);
}
Expand Down

0 comments on commit 1d9d45c

Please sign in to comment.