Skip to content

Commit

Permalink
WIP FlickrSDK
Browse files Browse the repository at this point in the history
  • Loading branch information
Swizec committed May 14, 2017
1 parent 6a4ee1f commit 279847b
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 7 deletions.
1 change: 1 addition & 0 deletions MusicApp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
},
"dependencies": {
"@shoutem/ui": "^0.14.2",
"flickr-sdk": "^2.1.0",
"react": "16.0.0-alpha.6",
"react-native": "0.43.0"
},
Expand Down
47 changes: 40 additions & 7 deletions MusicApp/src/Genres.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,51 @@

import React, { Component } from 'react';
import { ListView, GridView, GridRow, TouchableOpacity, Card, Image, View, Subtitle } from '@shoutem/ui';
import { ListView, GridView, GridRow, TouchableOpacity, Card, Image, View, Subtitle, Spinner } from '@shoutem/ui';

// <Image source={genre.image} styleName="medium-wide" />
import Flickr from 'flickr-sdk';

const flickr = new Flickr({
apiKey: "8dacb3c2a9b8ff4016fab4a76df1441c",
apiSecret: "47a16c5f9512dbf8"
});

class GenreArt extends Component {
state = {
uri: null
}

componentDidMount() {

}

render() {
const { uri } = this.state;

if (uri) {
return (
<Card styleName="flexible">
<Image source={{uri: uri}} styleName="medium-wide" />
</Card>
);
}else{
return (
<Card styleName="flexible">
<Spinner />
</Card>
);
}
}
}

class Genres extends Component {
renderRow(rowData, sectionId, index) {
const cellViews = rowData.map((genre, id) => (
<TouchableOpacity key={id} styleName="flexible">
<Card styleName="flexible">
<Image source={require('./media/alternative_rock.jpg')} styleName="medium-wide" />
</Card>
<View styleName="content">
<Subtitle numberOfLines={1}>{genre.name}</Subtitle>
<View>
<GenreArt />
<View styleName="content">
<Subtitle numberOfLines={1}>{genre.name}</Subtitle>
</View>
</View>
</TouchableOpacity>
));
Expand Down

0 comments on commit 279847b

Please sign in to comment.