fix: buttons not working
This commit is contained in:
19
src/App.css
19
src/App.css
@@ -117,3 +117,22 @@ pre {
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@keyframes dashboard-row-glow {
|
||||||
|
0% {
|
||||||
|
background-color: rgba(59, 130, 246, 0.25);
|
||||||
|
box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.45);
|
||||||
|
}
|
||||||
|
60% {
|
||||||
|
background-color: rgba(59, 130, 246, 0.15);
|
||||||
|
box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.15);
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
background-color: transparent;
|
||||||
|
box-shadow: 0 0 0 0 transparent;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.dashboard-row-highlight {
|
||||||
|
animation: dashboard-row-glow 2.5s ease forwards;
|
||||||
|
}
|
||||||
|
|||||||
26
src/App.js
26
src/App.js
@@ -1,4 +1,4 @@
|
|||||||
import React, { useState, useEffect, useCallback, useMemo } from 'react';
|
import React, { useState, useEffect, useCallback, useMemo, useRef } from 'react';
|
||||||
import { BrowserRouter as Router, Routes, Route, Navigate } from 'react-router-dom';
|
import { BrowserRouter as Router, Routes, Route, Navigate } from 'react-router-dom';
|
||||||
import { startOfDay } from 'date-fns';
|
import { startOfDay } from 'date-fns';
|
||||||
import './App.css';
|
import './App.css';
|
||||||
@@ -40,6 +40,10 @@ function App() {
|
|||||||
const [activeRangePicker, setActiveRangePicker] = useState(null);
|
const [activeRangePicker, setActiveRangePicker] = useState(null);
|
||||||
const [notificationPanelOpen, setNotificationPanelOpen] = useState(false);
|
const [notificationPanelOpen, setNotificationPanelOpen] = useState(false);
|
||||||
const [focusedStoreId, setFocusedStoreId] = useState(null);
|
const [focusedStoreId, setFocusedStoreId] = useState(null);
|
||||||
|
const configRef = useRef(config);
|
||||||
|
useEffect(() => {
|
||||||
|
configRef.current = config;
|
||||||
|
}, [config]);
|
||||||
const minSelectableDate = useMemo(() => startOfDay(new Date()), []);
|
const minSelectableDate = useMemo(() => startOfDay(new Date()), []);
|
||||||
|
|
||||||
const weekdays = ['Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag', 'Sonntag'];
|
const weekdays = ['Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag', 'Sonntag'];
|
||||||
@@ -681,16 +685,16 @@ function App() {
|
|||||||
};
|
};
|
||||||
}, [isDirty]);
|
}, [isDirty]);
|
||||||
|
|
||||||
const persistConfigUpdate = async (updater, successMessage, { autoCommit = false } = {}) => {
|
const persistConfigUpdate = useCallback(
|
||||||
if (!session?.token) {
|
async (updater, successMessage, { autoCommit = false } = {}) => {
|
||||||
|
const baseConfig = configRef.current;
|
||||||
|
const nextConfigState = typeof updater === 'function' ? updater(baseConfig) : updater;
|
||||||
|
if (!nextConfigState) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let nextConfigState;
|
setConfig(nextConfigState);
|
||||||
setConfig((prev) => {
|
if (!session?.token) {
|
||||||
nextConfigState = typeof updater === 'function' ? updater(prev) : updater;
|
setIsDirty(true);
|
||||||
return nextConfigState;
|
|
||||||
});
|
|
||||||
if (!nextConfigState) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!autoCommit) {
|
if (!autoCommit) {
|
||||||
@@ -721,7 +725,9 @@ function App() {
|
|||||||
setIsDirty(true);
|
setIsDirty(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
},
|
||||||
|
[authorizedFetch, session?.token]
|
||||||
|
);
|
||||||
|
|
||||||
const deleteEntry = async (entryId) => {
|
const deleteEntry = async (entryId) => {
|
||||||
const confirmed = await askConfirmation({
|
const confirmed = await askConfirmation({
|
||||||
|
|||||||
@@ -43,17 +43,14 @@ const DashboardView = ({
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
row.scrollIntoView({ behavior: 'smooth', block: 'center' });
|
row.scrollIntoView({ behavior: 'smooth', block: 'center' });
|
||||||
row.classList.add('ring-4', 'ring-blue-400', 'bg-blue-50', 'transition');
|
row.classList.add('dashboard-row-highlight', 'ring-4', 'ring-blue-400');
|
||||||
row.style.transition = 'background-color 0.8s ease, box-shadow 0.8s ease';
|
|
||||||
const timeout = setTimeout(() => {
|
const timeout = setTimeout(() => {
|
||||||
row.classList.remove('ring-4', 'ring-blue-400');
|
row.classList.remove('dashboard-row-highlight', 'ring-4', 'ring-blue-400');
|
||||||
row.style.backgroundColor = 'transparent';
|
onClearFocus();
|
||||||
setTimeout(onClearFocus, 600);
|
}, 2500);
|
||||||
}, 2200);
|
|
||||||
return () => {
|
return () => {
|
||||||
clearTimeout(timeout);
|
clearTimeout(timeout);
|
||||||
row.classList.remove('ring-4', 'ring-blue-400');
|
row.classList.remove('dashboard-row-highlight', 'ring-4', 'ring-blue-400');
|
||||||
row.style.backgroundColor = 'transparent';
|
|
||||||
};
|
};
|
||||||
}, [focusedStoreId, onClearFocus]);
|
}, [focusedStoreId, onClearFocus]);
|
||||||
const {
|
const {
|
||||||
|
|||||||
Reference in New Issue
Block a user