mirror of
https://github.com/orangecoding/fredy.git
synced 2026-06-16 12:31:07 +00:00
Listing management (#223)
* upgrading dependencies, fixing image placeholder * improving processing times label and hide when screen width is too low * aligning run now button * renaming settings -> general settings * smaller security and memory improvements * improving footer * preparing listing management * improve filtering for listings * preparing new settings page * preparing new settings page * storing settings in db * next release version
This commit is contained in:
committed by
GitHub
parent
5cfa674d7f
commit
3e5cd97400
15
ui/src/hooks/featureHook.js
Normal file
15
ui/src/hooks/featureHook.js
Normal file
@@ -0,0 +1,15 @@
|
||||
import { useSelector } from '../services/state/store.js';
|
||||
|
||||
export function useFeature(name) {
|
||||
const currentFeatureFlags = useSelector((state) => state.features);
|
||||
if (Object.keys(currentFeatureFlags || {}).length === 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (currentFeatureFlags[name] == null) {
|
||||
console.warn(`Feature flag with name ${name} is unknown.`);
|
||||
return null;
|
||||
}
|
||||
|
||||
return currentFeatureFlags[name];
|
||||
}
|
||||
Reference in New Issue
Block a user