Skip to content

feat: Add Image component #1582

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 17, 2018
Merged

feat: Add Image component #1582

merged 1 commit into from
Nov 17, 2018

Conversation

iRoachie
Copy link
Collaborator

@iRoachie iRoachie commented Nov 17, 2018

Implements #1478

Motivation

Adds Image component that has support for placeholders. Basically takes out the FadeInImage component that @martinezguillaume wrote in react-native-training/react-native-elements@f8af41c and splits it into it's own component.

A follow-up PR will let the Avatar component use this.

API

import { ActivityIndicator } from 'react-native';
import { Image } from 'react-native-elements';

// Standard Image
<Image
  source={{ uri: image }}
  style={{ width: 200, height: 200 }}
/>


// Image with custom placeholder content
<Image
  source={{ uri: image }}
  style={{ width: 200, height: 200 }}
  PlaceholderContent={<ActivityIndicator />}
/>

Screenshots

img

@codecov
Copy link

codecov bot commented Nov 17, 2018

Codecov Report

Merging #1582 into next will increase coverage by 0.34%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##             next    #1582      +/-   ##
==========================================
+ Coverage   76.23%   76.58%   +0.34%     
==========================================
  Files          32       33       +1     
  Lines         606      615       +9     
  Branches       78       78              
==========================================
+ Hits          462      471       +9     
  Misses        125      125              
  Partials       19       19
Impacted Files Coverage Δ
src/image/Image.js 100% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1c50243...21e1331. Read the comment docs.

@iRoachie iRoachie merged commit 3663c0c into next Nov 17, 2018
@iRoachie iRoachie deleted the fadein-image branch November 17, 2018 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant