Skip to content

Commit

Permalink
BUG-191: Usar Librería que usó Carlitos para subir Imagenes ( Registe…
Browse files Browse the repository at this point in the history
…r , Settings) && PB-248: Android: Loading State en Home
  • Loading branch information
jtvargas committed Feb 1, 2020
1 parent 8416afc commit 00038da
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion App/Components/Home/Home.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import PropTypes from 'prop-types';
import Moment from 'moment/min/moment-with-locales';
import Lodash from 'lodash';

import { colors, spacers, fonts, toBaseDesignPx } from '../../Core/Theme';
import { colors, spacers, fonts, toBaseDesignPx, constants } from '../../Core/Theme';
import Text from '../Common/Text';
import InLineComponent from '../Common/InLineComponent';
import Section from '../Common/Section';
Expand Down Expand Up @@ -126,6 +126,9 @@ class Home extends React.Component {
const { events, subjects, onMyCalendarPress, isLoading } = this.props;

if (isLoading) {
if (constants.isAndroid) {
return <LoadingState.Small />;
}
return (
<LoadingList
renderItem={this.renderEventCalendarLoadingState}
Expand Down
4 changes: 2 additions & 2 deletions App/Utils/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* eslint-disable no-undef */
/* eslint-disable import/prefer-default-export */
import * as mime from 'react-native-mime-types';
import { Platform } from 'react-native';

export const toUpperCaseFirsLetter = str => {
Expand All @@ -13,10 +14,9 @@ export const toUpperCaseFirsLetter = str => {

export const createFormDataPhoto = photo => {
const data = new FormData();

data.append('file', {
name: 'file',
type: 'image/jpg',
type: mime.lookup(photo),
uri: Platform.OS === 'android' ? photo : photo.replace('file://', ''),
});

Expand Down

0 comments on commit 00038da

Please sign in to comment.