Skip to content
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

Fix problems pointed by Eslint #48

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
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
4 changes: 0 additions & 4 deletions .eslintrc.js

This file was deleted.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
"devDependencies": {
"@babel/core": "^7.8.7",
"@babel/runtime": "^7.8.7",
"@react-native-community/eslint-config": "^0.0.7",
"babel-eslint": "^10.1.0",
"babel-jest": "^25.1.0",
"babel-plugin-root-import": "^6.4.1",
Expand Down
20 changes: 12 additions & 8 deletions src/components/ForecastDetails/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import {Animated} from 'react-native';
import {PanGestureHandler, State} from 'react-native-gesture-handler';
import { Animated } from 'react-native';
import { PanGestureHandler, State } from 'react-native-gesture-handler';

import LottieView from 'lottie-react-native';
import LottieAnimationJson from '~/assets/lottie-animations/sunny.json';
Expand Down Expand Up @@ -33,12 +33,12 @@ export default function ForecastDetails() {
},
},
],
{useNativeDriver: true},
{ useNativeDriver: true },
);

function onHandlerStateChanged(event) {
if (event.nativeEvent.oldState === State.ACTIVE) {
const {translationY} = event.nativeEvent;
const { translationY } = event.nativeEvent;
let opened = false;
offset += translationY;

Expand All @@ -65,7 +65,8 @@ export default function ForecastDetails() {
return (
<PanGestureHandler
onGestureEvent={animatedEvent}
onHandlerStateChange={onHandlerStateChanged}>
onHandlerStateChange={onHandlerStateChanged}
>
<Card
style={{
transform: [
Expand All @@ -77,15 +78,17 @@ export default function ForecastDetails() {
}),
},
],
}}>
}}
>
<Header
style={{
opacity: translateY.interpolate({
inputRange: [0, 400],
outputRange: [1, 0],
extrapolate: 'clamp',
}),
}}>
}}
>
Vreeland
</Header>
<Body
Expand All @@ -95,7 +98,8 @@ export default function ForecastDetails() {
outputRange: [1, 0],
extrapolate: 'clamp',
}),
}}>
}}
>
<WeatherInfoContainer>
<Wind>M7º / L5º</Wind>
<Temperature>5º</Temperature>
Expand Down
2 changes: 1 addition & 1 deletion src/components/ForecastDetails/styles.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Animated} from 'react-native';
import { Animated } from 'react-native';
import styled from 'styled-components/native';

export const Card = styled(Animated.View)`
Expand Down
1 change: 1 addition & 0 deletions src/config/ReactotronConfig.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable no-console */
import Reactotron from 'reactotron-react-native';

if (__DEV__) {
Expand Down
14 changes: 7 additions & 7 deletions src/pages/Main/index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React, {useEffect, useState} from 'react';
import React, { useEffect, useState } from 'react';

import {View, StyleSheet} from 'react-native';
import ForecastDetails from '~/components/ForecastDetails';
import { StyleSheet } from 'react-native';
import MapView from 'react-native-maps';
import {SafeAreaView} from 'react-navigation';
import { SafeAreaView } from 'react-navigation';
import RNLocation from 'react-native-location';
import ForecastDetails from '~/components/ForecastDetails';

const styles = StyleSheet.create({
container: {
Expand Down Expand Up @@ -32,9 +32,9 @@ const Main = () => {
});

if (granted) {
RNLocation.subscribeToLocationUpdates(locations => {
RNLocation.subscribeToLocationUpdates((locations) => {
if (locations.length > 0) {
const {latitude, longitude} = locations[0];
const { latitude, longitude } = locations[0];
setCurrentRegion({
latitude,
longitude,
Expand All @@ -54,7 +54,7 @@ const Main = () => {
{currentRegion.latitude && (
<MapView
initialRegion={currentRegion}
style={{...StyleSheet.absoluteFillObject}}
style={{ ...StyleSheet.absoluteFillObject }}
/>
)}
<ForecastDetails />
Expand Down
4 changes: 2 additions & 2 deletions src/routes.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {createAppContainer, createSwitchNavigator} from 'react-navigation';
import { createAppContainer, createSwitchNavigator } from 'react-navigation';

import Main from '~/pages/Main';

const Routes = createAppContainer(createSwitchNavigator({Main}));
const Routes = createAppContainer(createSwitchNavigator({ Main }));

export default Routes;
5 changes: 3 additions & 2 deletions src/services/api.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import axios from 'axios';

import {OPEN_WEATHER_MAP_APP_ID} from 'react-native-dotenv';
import { OPEN_WEATHER_MAP_APP_ID } from 'react-native-dotenv';

const api = axios.create({
baseURL: 'https://api.openweathermap.org/data/2.5/',
});

api.interceptors.request.use(config => {
api.interceptors.request.use((defaultConfig) => {
const config = defaultConfig;
config.params = config.params || {};

config.params.APPID = OPEN_WEATHER_MAP_APP_ID;
Expand Down