Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 30 additions & 7 deletions App.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,47 @@
import React from 'react';
import styled from 'styled-components/native';
import TechyApi from './components/TechyApi';


const Container = styled.View`
flex: 1;
background-color: papayawhip;
justify-content: center;
align-items: center;
`;
margin-top: 20px;
`;

const Title = styled.Text`
font-size: 24px;
color: palevioletred;
font-size: 20px;
color: darkgreen;
`;

const ContainerText = styled.View`
flex: 1;
justify-content: center;
align-items: center;
width: 80%;
padding-left: 20px;
padding-right: 20px;
padding-top: 20px;
`;

const Technician = styled.Image`
width: 40%;
height: 40%;
background: black;
margin-top: 20px;
padding: 10px;
`;

const App = () => {
return (
<Container>
<Title>This is your cool app!</Title>
<Title>Go to App.js and start coding</Title>
<Title>💅💅💅</Title>
<Technician source={require('./assets/technicians-at-work.jpg')} />

Choose a reason for hiding this comment

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

Great that you made it work!

Copy link
Author

Choose a reason for hiding this comment

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

😊

<ContainerText>
<Title>Want to sound like you know what you are talking about?
Try these techy expressions: 👩‍💻</Title>
</ContainerText>
<TechyApi/>
</Container>
);
};
Expand Down
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
# Project React Native App 📱

Replace this readme with your own information about your project.

Start by briefly describing the assignment in a sentence or two. Keep it short and to the point.
This week we should build a mobile app.
We had one week to be done with the assignment and learn all the new tools used.

## The problem

Describe how you approached to problem, and what tools and techniques you used to solve it. How did you plan? What technologies did you use? If you had more time, what would be next?
I found an API that I wanted to use. I used styled components and had a button with TouchableOpacity to generate the technical quotes from the API.

## View it live
You can see the app here:
https://snack.expo.dev/@sjolanders/native-app

Every project should be deployed somewhere. Be sure to include the link to the deployed project so that the viewer can click around and see what it's all about.
2 changes: 1 addition & 1 deletion app.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
}
},
"web": {
"favicon": "./assets/favicon.png"
"favicon": "./assets/favicon.png"
}
}
}
Binary file modified assets/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/technicians-at-work.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
57 changes: 57 additions & 0 deletions components/TechyApi.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import React, { useState, useEffect } from 'react';
import { Text } from 'react-native';
import styled from 'styled-components/native';

const TechyApi = () => {
const [techwords, setTechwords] = useState({})

const generateTechWords = () => {

Choose a reason for hiding this comment

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

Nice API, I should try to learn some sentences ;)

fetch('https://techy-api.vercel.app/api/json')
.then(response => response.json())
.then((data) => setTechwords(data))
}

const Container = styled.View`
flex: 1;
justify-content: center;
align-items: center;
margin: 20px;
width: 80%;
padding-left: 20px;
padding-right: 20px;

`;

const Quote = styled.Text`
font-size: 15px;
color: black;
font-style: italic;
`;

const APIButton= styled.TouchableOpacity`
font-weight: 700;
width: 40%;
background-color: lightgrey;
margin-top: 20px;
border-radius: 10px;
border: 2px solid darkgrey;
padding: 5px;
`;


useEffect(() => {
generateTechWords();
}, []);

return (
<Container>
<Quote>
{techwords.message}</Quote>
<APIButton onPress={generateTechWords}>
<Text>New sentence</Text>
</APIButton>
</Container>
)
}

export default TechyApi;
Loading