Skip to content

Commit 73fb75d

Browse files
docs: add README
1 parent 335c223 commit 73fb75d

File tree

10 files changed

+72
-2
lines changed

10 files changed

+72
-2
lines changed

.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
OPENWEATHER_API_KEY=

.github/day.png

207 KB
Loading

.github/night.png

204 KB
Loading

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ DerivedData
2020
*.hmap
2121
*.ipa
2222
*.xcuserstate
23+
.env
2324

2425
# Android/IntelliJ
2526
#

README.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<h1 align="center">
2+
Weatherapp
3+
</h1>
4+
5+
<h3 align="center">Weatherapp - aplicação simples desenvolvida com React Native que mostra os dados do clima com base nas cordenadas do usuário.</h3>
6+
7+
<p align="center">
8+
<img align="center" src=".github/day.png" border="0" height="300"/>
9+
10+
<img align="center" src=".github/night.png" border="0" height="300"/>
11+
</p>
12+
13+
## 🛠 Tecnologias
14+
15+
As seguintes ferramentas foram usadas na construção do projeto:
16+
17+
- [React Native](https://reactnative.dev/)
18+
- [react-native-community/geolocation](https://github.com/react-native-community/react-native-geolocation)
19+
- [styled-components](https://styled-components.com/)
20+
- [axios](https://github.com/axios/axios)
21+
- [date-fns](https://date-fns.org/)
22+
- [react-native-vector-icons](https://github.com/oblador/react-native-vector-icons)
23+
- [react-native-linear-gradient](https://github.com/react-native-community/react-native-linear-gradient)
24+
25+
26+
27+
## Pré-requisitos
28+
29+
Antes de começar, você vai precisar ter instalado em sua máquina as seguintes ferramentas:
30+
[Git](https://git-scm.com), [Node.js](https://nodejs.org/en/), [Expo](https://expo.io/), [Yarn](https://classic.yarnpkg.com/lang/en/).
31+
Além disto é bom ter um editor para trabalhar com o código como [VSCode](https://code.visualstudio.com/)
32+
33+
## 💾 Instalação
34+
35+
```bash
36+
# Acesse a pasta do projeto no terminal/cmd
37+
$ cd weatherapp
38+
39+
# Instale as dependências
40+
$ yarn
41+
42+
# Instale o app no emuulador
43+
$ yarn android
44+
45+
# Execute a aplicação
46+
$ yarn start
47+
```
48+
49+
---
50+
By Rodrigo Sakamoto
51+
52+
[![Linkedin Badge](https://img.shields.io/badge/-Rodrigo%20Sakamoto-9146ff?style=flat-square&logo=Linkedin&logoColor=white&link=https://www.linkedin.com/in/rodrigo-sakamoto/)](https://www.linkedin.com/in/rodrigo-sakamoto/)
53+
[![Gmail Badge](https://img.shields.io/badge/-rodosakamoto@gmail.com-9146ff?style=flat-square&logo=Gmail&logoColor=white&link=mailto:rodosakamoto@gmail.com)](mailto:rodosakamoto@gmail.com)

babel.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
module.exports = {
22
presets: ['module:metro-react-native-babel-preset'],
3+
plugins: ['module:react-native-dotenv'],
34
};

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"date-fns": "^2.15.0",
1616
"react": "16.13.1",
1717
"react-native": "0.63.2",
18+
"react-native-dotenv": "^2.3.0",
1819
"react-native-linear-gradient": "^2.5.6",
1920
"react-native-vector-icons": "^7.0.0",
2021
"styled-components": "^5.1.1"

src/pages/Home/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import Icon from 'react-native-vector-icons/Feather';
33
import {format} from 'date-fns';
44
import ptBR from 'date-fns/locale/pt-BR';
55
import Geolocation from '@react-native-community/geolocation';
6+
import {OPENWEATHER_API_KEY} from '@env';
67

78
import WeatherDetailsItem from '../../components/WeatherDetailsItem';
89

@@ -40,7 +41,7 @@ const Home = () => {
4041
params: {
4142
lon: longitude,
4243
lat: latitude,
43-
appid: 'c1b0e433f08ff834b80bb722bf8cdad8',
44+
appid: OPENWEATHER_API_KEY,
4445
lang: 'pt_br',
4546
units: 'metric',
4647
},

src/pages/Home/styles.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import styled from 'styled-components/native';
22
import LinearGradient from 'react-native-linear-gradient';
33

44
export const Background = styled(LinearGradient).attrs((props) => ({
5-
colors: props.hour > 18 ? ['#7159c1', '#333'] : ['#7159c1', '#19c3fb'],
5+
colors: props.hour >= 18 ? ['#7159c1', '#333'] : ['#7159c1', '#19c3fb'],
66
}))`
77
flex: 1;
88
`;

yarn.lock

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2421,6 +2421,11 @@ domexception@^1.0.1:
24212421
dependencies:
24222422
webidl-conversions "^4.0.2"
24232423

2424+
dotenv@^8.0.0:
2425+
version "8.2.0"
2426+
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-8.2.0.tgz#97e619259ada750eea3e4ea3e26bceea5424b16a"
2427+
integrity sha512-8sJ78ElpbDJBHNeBzUbUVLsqKdccaa/BXF1uPTw3GrvQTBgrQrtObr2mUrE38vzYd8cEv+m/JBfDLioYcfXoaw==
2428+
24242429
ecc-jsbn@~0.1.1:
24252430
version "0.1.2"
24262431
resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9"
@@ -5532,6 +5537,13 @@ react-is@^16.12.0, react-is@^16.7.0, react-is@^16.8.1, react-is@^16.8.4, react-i
55325537
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4"
55335538
integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==
55345539

5540+
react-native-dotenv@^2.3.0:
5541+
version "2.3.0"
5542+
resolved "https://registry.yarnpkg.com/react-native-dotenv/-/react-native-dotenv-2.3.0.tgz#5c41bb06879616e9222f998446c4e401447c0638"
5543+
integrity sha512-I+qChtJT8U8EXSr91O1cMC7uU4Xaalg3aVFtRb1b47DX+30PMK+I8sCOMGnZcJW6YQyUaf0fjqlVXmmaMOcfWg==
5544+
dependencies:
5545+
dotenv "^8.0.0"
5546+
55355547
react-native-linear-gradient@^2.5.6:
55365548
version "2.5.6"
55375549
resolved "https://registry.yarnpkg.com/react-native-linear-gradient/-/react-native-linear-gradient-2.5.6.tgz#96215cbc5ec7a01247a20890888aa75b834d44a0"

0 commit comments

Comments
 (0)