mirror of
https://github.com/nagaoo0/HabbitGrid.git
synced 2026-01-11 23:44:55 +00:00
EditMenuDB
This commit is contained in:
@@ -9,6 +9,12 @@ import { useToast } from '../components/ui/use-toast';
|
|||||||
import ColorPicker from '../components/ColorPicker';
|
import ColorPicker from '../components/ColorPicker';
|
||||||
import { getHabits, saveHabit, updateHabit } from '../lib/datastore';
|
import { getHabits, saveHabit, updateHabit } from '../lib/datastore';
|
||||||
|
|
||||||
|
// Local helper to get habit by id from localStorage
|
||||||
|
function getHabit(id) {
|
||||||
|
const habits = JSON.parse(localStorage.getItem('habitgrid_data') || '[]');
|
||||||
|
return habits.find(h => h.id === id);
|
||||||
|
}
|
||||||
|
|
||||||
const AddEditHabitPage = () => {
|
const AddEditHabitPage = () => {
|
||||||
const { id } = useParams();
|
const { id } = useParams();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|||||||
Reference in New Issue
Block a user