mirror of
https://github.com/legop3/MultiRoombaRover.git
synced 2026-09-19 02:50:46 -04:00
big overhaul for server and webui feature matching, things default to disabled and disappear from UI when disabled.
This commit is contained in:
@@ -2,12 +2,19 @@
|
||||
// Purpose: Defines the Social Buttons Grid module and the local helpers/components used in this file.
|
||||
// Scope: Keeps behavior unchanged while isolating this concern into a clear, single-responsibility unit.
|
||||
import { useSessionSelector } from '../../context/SessionContext.jsx';
|
||||
import { isFeatureEnabled } from '../../lib/features.js';
|
||||
import SocialButton from '../SocialButton/index.jsx';
|
||||
|
||||
export default function SocialButtonsGrid({ className = '' }) {
|
||||
const enabled = useSessionSelector((state) => isFeatureEnabled(state, 'socials'));
|
||||
const socials = useSessionSelector((state) => state.session?.socials ?? []).slice(0, 4);
|
||||
|
||||
if (!socials.length) return null;
|
||||
/*
|
||||
The Links panel owns its feature visibility. Even if the server config has
|
||||
link entries, `socials.enabled: false` makes the server advertise the
|
||||
feature as disabled, and this component disappears completely.
|
||||
*/
|
||||
if (!enabled || !socials.length) return null;
|
||||
|
||||
return (
|
||||
<div className={`grid grid-cols-2 grid-rows-2 gap-0.5 ${className}`}>
|
||||
|
||||
Reference in New Issue
Block a user