Skip to content

Commit

Permalink
Develop (#42)
Browse files Browse the repository at this point in the history
* Merge

* Fix: env not loaded in build
  • Loading branch information
titi0267 committed Mar 4, 2024
1 parent a672093 commit d379940
Show file tree
Hide file tree
Showing 11 changed files with 22 additions and 46 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,9 @@ jobs:
overwrite: true
body: |
Release version ${{steps.version.outputs.prop}}
Fetures:
Features:
- Itinerary from users position
- User shown on the map
Fix:
- Itinerary infite loading
- Secrets not loading
1 change: 0 additions & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
apply plugin: "com.android.application"
apply plugin: "com.facebook.react"
apply from: project(':react-native-config').projectDir.getPath() + "/dotenv.gradle"

import com.android.build.OutputFile
import groovy.json.JsonSlurper
Expand Down
18 changes: 2 additions & 16 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "gas-prices",
"version": "0.0.4",
"versionCode": 10,
"versionCode": 11,
"private": true,
"scripts": {
"android": "react-native run-android --variant=debug",
Expand All @@ -24,7 +24,6 @@
"npm": "^10.4.0",
"react": "18.2.0",
"react-native": "0.71.7",
"react-native-config": "^1.5.1",
"react-native-dotenv": "^3.4.8",
"react-native-elements": "^3.4.3",
"react-native-linear-gradient": "^2.8.3",
Expand Down
15 changes: 3 additions & 12 deletions src/Pages/GasPumps/index.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,11 @@
import {
FlatList,
Image,
ScrollView,
StyleSheet,
Text,
View,
} from 'react-native';
import {Card, Button} from 'react-native-paper';
import {FlatList, StyleSheet, Text, View} from 'react-native';
import CustomCard from '../../Components/Card';
import {useIsFocused, useRoute} from '@react-navigation/native';
import {GasPump, GasPumpFields, GasPumpsRouteParams} from '../../Types';
import {useIsFocused} from '@react-navigation/native';
import {GasPump, GasPumpFields} from '../../Types';
import {useEffect, useState} from 'react';
import asyncStorageService from '../../services/asyncStorage.service';

const GasPumps = () => {
const route = useRoute();
const [gasStations, setGasStations] = useState<Array<GasPump>>([]);
const [gasType, setGasType] = useState<string | null>(null);
const isFocused = useIsFocused();
Expand Down
6 changes: 3 additions & 3 deletions src/Pages/Map/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ import gasStationsService from '../../services/gasStations.service';
import asyncStorageService from '../../services/asyncStorage.service';
import CustomCard from '../../Components/Card';
import circle from '@turf/circle';
import Config from 'react-native-config';
import {JAWG_API_KEY, MAPBOX_API_KEY} from '@env';

Mapbox.setAccessToken(Config.MAPBOX_API_KEY as string);
Mapbox.setAccessToken(MAPBOX_API_KEY as string);

const Map = () => {
const route = useRoute();
Expand Down Expand Up @@ -195,7 +195,7 @@ const Map = () => {
logoEnabled={false}
attributionEnabled={false}
onRegionIsChanging={handleRegionDidChange}
styleURL={`https://tile.jawg.io/jawg-streets.json?access-token=${Config.JAWG_API_KEY}`}>
styleURL={`https://tile.jawg.io/jawg-streets.json?access-token=${JAWG_API_KEY}`}>
{isLoading == false || (!end && !start) ? (
<Mapbox.Camera
centerCoordinate={[location.longitude, location.latitude]}
Expand Down
6 changes: 3 additions & 3 deletions src/services/cities.service.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import Config from 'react-native-config';
import {CityPosition} from '../Types';
import {HOST} from '@env';

const fetchCityNames = async (
body: {adress: string},
setResults: (value: string[]) => void,
setLoading: (value: boolean) => void,
) => {
setLoading(true);
const res = await fetch(`${Config.HOST}/cityName`, {
const res = await fetch(`${HOST}/cityName`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Expand All @@ -31,7 +31,7 @@ const fetchCityPosition = async (
body: {adress: string},
setPosition: (value: {label: string; geometry: string}) => void,
) => {
const res = await fetch(`${Config.HOST}/cityData`, {
const res = await fetch(`${HOST}/cityData`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Expand Down
4 changes: 2 additions & 2 deletions src/services/departmentCode.service.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import Config from 'react-native-config';
import {HOST} from '@env';

const fetchDepartmentCode = async (body: {
coords: number[];
}): Promise<string> => {
const res = await fetch(`${Config.HOST}/geoCode`, {
const res = await fetch(`${HOST}/geoCode`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Expand Down
4 changes: 2 additions & 2 deletions src/services/gasStations.service.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Config from 'react-native-config';
import {HOST} from '@env';

const fetchGasStationList = async (body: {code_department: string}) => {
const res = await fetch(`${Config.HOST}/gasStations`, {
const res = await fetch(`${HOST}/gasStations`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Expand Down
4 changes: 2 additions & 2 deletions src/services/geoJson.service.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Config from 'react-native-config';
import {HOST} from '@env';

const fetchGeoJsonResults = async (
body: {
Expand All @@ -9,7 +9,7 @@ const fetchGeoJsonResults = async (
setIsLoading: (value: boolean) => void,
) => {
console.log(body);
const res = await fetch(`${Config.HOST}/geoJson`, {
const res = await fetch(`${HOST}/geoJson`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Expand Down
4 changes: 2 additions & 2 deletions src/services/updateApp.service.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import Config from 'react-native-config';
import {HOST} from '@env';

const updateApp = async (setVersion: (value: any) => void) => {
const pj = require('../../package.json');
const body = {version: pj.version};
const res = await fetch(`${Config.HOST}/update`, {
const res = await fetch(`${HOST}/update`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Expand Down

0 comments on commit d379940

Please sign in to comment.