Rev 3320 |
|
Comparar con el anterior |
Ultima modificación |
Ver Log
|
Rev |
Autor |
Línea Nro. |
Línea |
3719 |
stevensc |
1 |
import React from 'react';
|
|
|
2 |
import { Outlet, useParams } from 'react-router-dom';
|
|
|
3 |
|
|
|
4 |
import { useMyProgress } from '@hooks';
|
|
|
5 |
|
|
|
6 |
import HabitProgressProvider from '@providers/habits/habit-progress';
|
|
|
7 |
|
|
|
8 |
export default function HabitProgressLayout() {
|
|
|
9 |
const { uuid } = useParams();
|
|
|
10 |
const { getHabitById } = useMyProgress();
|
|
|
11 |
|
|
|
12 |
const currentHabit = getHabitById(uuid);
|
|
|
13 |
|
|
|
14 |
return (
|
|
|
15 |
<HabitProgressProvider url={currentHabit?.link} name={currentHabit?.name ?? ''}>
|
|
|
16 |
<Outlet />
|
|
|
17 |
</HabitProgressProvider>
|
|
|
18 |
);
|
|
|
19 |
}
|