Skip to content

Commit

Permalink
AC-258 dashboard, station's popup and footer updated
Browse files Browse the repository at this point in the history
  • Loading branch information
Minotriz02 committed Nov 12, 2024
1 parent 07ec660 commit d8f7e8d
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
5 changes: 3 additions & 2 deletions src/src/components/footer/Footer.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
.item-footer {
.item-footer > a {
transition: all 0.3s ease-in-out;
width: fit-content;
}

.item-footer:hover {
.item-footer > a:hover {
text-decoration: underline;
}
4 changes: 2 additions & 2 deletions src/src/components/footer/Footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ function Footer() {
<ul className="nav flex-column">
<li className="nav-item mb-2 item-footer">
<a
href="mailto: J.R.Villegas@cgiar.org"
href="mailto: a.i.martinez@cgiar.org"
className="nav-link text-light"
>
J.R.Villegas@cgiar.org
A.i.martinez@cgiar.org
</a>
</li>
</ul>
Expand Down
2 changes: 1 addition & 1 deletion src/src/components/stationPopup/StationPopup.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function StationPopup({ station, lastData }) {
aria-label="Data"
>
<IconChartDonut stroke={2} className="me-2" />
Data
Datos
</Link>
</div>
</Popup>
Expand Down
11 changes: 10 additions & 1 deletion src/src/pages/dashboard/Dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const Dashboard = () => {
const [isChartLoading, setIsChartLoading] = useState(false);
const [startDate, setStartDate] = useState();
const [endDate, setEndDate] = useState();
const [endDataDate, setEndDataDate] = useState();
const { idWS } = useParams();
const navigate = useNavigate();

Expand Down Expand Up @@ -64,6 +65,7 @@ const Dashboard = () => {
.toISOString()
.split("T")[0];
setEndDate(formattedEndDate);
setEndDataDate(formattedEndDate);

const startDate = new Date(lastDataAvailable[0].date);
startDate.setDate(startDate.getDate() - 7);
Expand Down Expand Up @@ -155,6 +157,11 @@ const Dashboard = () => {
setStartDate(newStartDate);
};

const handleEndDateChange = (e) => {
const newEndDate = e.target.value;
setEndDate(newEndDate);
};

const chartConfig = (label, data, color) => ({
labels: data.map((item) => item.label),
datasets: [
Expand Down Expand Up @@ -238,7 +245,9 @@ const Dashboard = () => {
type="date"
aria-label="Fecha de fin"
value={endDate}
disabled
onChange={handleEndDateChange}
min={startDate}
max={endDataDate}
/>
</div>
</Form.Group>
Expand Down

0 comments on commit d8f7e8d

Please sign in to comment.