Skip to content

Commit

Permalink
AC-253 AC in name, precipitation chart changed to the first position …
Browse files Browse the repository at this point in the history
…and id country in an env file
  • Loading branch information
Minotriz02 authored and Minotriz02 committed Sep 26, 2024
1 parent 20bbca0 commit df9ef31
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 15 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: Build and Deploy
on: [push]
permissions:
contents: write
env:
REACT_APP_COUNTRY_ID: ${{secrets.REACT_APP_COUNTRY_ID}}
jobs:
build-and-deploy:
concurrency: ci-${{ github.ref }} # Recommended if you intend to make multiple deployments in quick succession.
Expand All @@ -15,10 +17,11 @@ jobs:
CI: false
run: |
cd ./src
echo "REACT_APP_COUNTRY_ID=${{env.REACT_APP_COUNTRY_ID}}" > .env
npm ci
npm run build
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: src/build # The folder the action should deploy.
folder: src/build # The folder the action should deploy.
1 change: 1 addition & 0 deletions src/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
REACT_APP_COUNTRY_ID='651437a78a8437279ea6ca2c'
2 changes: 1 addition & 1 deletion src/src/components/menu/Menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function Menu() {
alt="Aclimate Monitoring Logo"
className="d-inline-block align-top"
/>
Aclimate Monitoring
AClimate Monitoring
</Link>

<Navbar.Toggle aria-controls="responsive-navbar-nav" />
Expand Down
22 changes: 11 additions & 11 deletions src/src/pages/dashboard/Dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,33 +211,33 @@ const Dashboard = () => {
</Col>
<Row>
<WeatherChart
title="Temperatura Máxima"
data={data.tempMax}
unit="°C"
title="Precipitación"
data={data.precipitation}
unit="mm"
chartOptions={chartOptions}
chartConfig={chartConfig}
days={selectedDays}
color="rgba(163, 36, 36, 1)"
color="rgba(26, 51, 237, 1)"
/>
<WeatherChart
title="Temperatura Mínima"
data={data.tempMin}
title="Temperatura Máxima"
data={data.tempMax}
unit="°C"
chartOptions={chartOptions}
chartConfig={chartConfig}
days={selectedDays}
color="rgba(54, 227, 224, 1)"
color="rgba(163, 36, 36, 1)"
/>
</Row>
<Row>
<WeatherChart
title="Precipitación"
data={data.precipitation}
unit="mm"
title="Temperatura Mínima"
data={data.tempMin}
unit="°C"
chartOptions={chartOptions}
chartConfig={chartConfig}
days={selectedDays}
color="rgba(26, 51, 237, 1)"
color="rgba(54, 227, 224, 1)"
/>
<WeatherChart
title="Radiación Solar"
Expand Down
4 changes: 2 additions & 2 deletions src/src/services/Services.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import axios from "axios";
import Configuration from "../conf/Configuration";

const NICARAGUA_ID = "651437a78a8437279ea6ca2c";
const COUNTRY_ID = process.env.REACT_APP_COUNTRY_ID;

// Create an Axios instance with the base URL
const apiClient = axios.create({
Expand All @@ -15,7 +15,7 @@ class Services {
* @throws Will throw an error if the request fails.
*/
async getAllWeatherStations() {
const url = `/geographic/${NICARAGUA_ID}/WeatherStations/json`;
const url = `/geographic/${COUNTRY_ID}/WeatherStations/json`;
try {
const response = await apiClient.get(url);
return response.data;
Expand Down

0 comments on commit df9ef31

Please sign in to comment.