Skip to content

Conversation

@mistscale
Copy link

My reflections on how this week's project turned out:

Things I'd like to have clarified or explained in more detail:

Copy link

@Kras053 Kras053 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job with the project this week! : D It works perfectly when I checked it on the phone fetching the famous quote, and very well implemented using the StyleSheet styling object!
Your code is clear and easy to follow and is really nicely structured.
Well done!! ⭐😃

Comment on lines 8 to 10
<Container>
<Title>This is your cool app!</Title>
<Title>Go to App.js and start coding</Title>
<Title>💅💅💅</Title>
<RandomQuote />
</Container>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice and clean approach in app.js with only RandomQuote :)

Comment on lines +4 to +15
const RandomQuote = () => {
const [quote, setQuote] = useState({});

const generateQuote = () => {
fetch('https://api.quotable.io/random')
.then((res) => res.json())
.then((data) => setQuote(data));
};

useEffect(() => {
generateQuote();
}, []);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well doe with the fetch, it works perfectly on my phone! : D

Comment on lines +17 to +27
return (
<View style={styles.container}>
<TouchableOpacity style={styles.btn} onPress={generateQuote}>
<Text style={styles.btnText}>New Quote</Text>
</TouchableOpacity>
<Text style={styles.quote}>"{quote.content}"</Text>
<Text style={styles.author}>{quote.author}</Text>
</View>
);
};

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job implementing the Stylesheet object for styling the fetched quotes and author now that we had the opportunity to try it! ^__^

Comment on lines +1 to +26
import data from '../albums.json';
import React, { useEffect, useState } from 'react';
import { View, Text } from 'react-native';

const Albums = () => {
const [album, setAlbum] = useState({});
console.log(data.items[2].name);

const generateAlbum = () => {
fetch('../albums.json')
.then((res) => res.json())
.then((data) => setAlbum(data));
};

useEffect(() => {
generateAlbum();
});

return (
<View>
<Text>{JSON.stringify(data.items[2].name)} </Text>
</View>
);
};

export default Albums;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might have missed this from the classes since we did not do the same project, but I can't see it imported somewhere so just wanted to comment in case it is not used :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants