mirror of
https://github.com/ToolJet/ToolJet
synced 2026-04-27 00:17:18 +00:00
* feat: enhance LeftSidebarInspector with InspectorHeader and search functionality * feat: update Debugger component to use onClose and darkMode props, enhance SidebarDebugger with tab functionality and styling * feat: enhance GlobalSettings component with header, refactor layout and styles for better organization * Added Rupak's changes for the leftsidebar * feat: enhance UI components with new panel headers, improved tab functionality, and updated styles for better alignment with design specifications * feat: add transparent background to driver page overlay for improved UI interaction * feat: adjust layout properties for improved header alignment and spacing in container configuration * feat: add placeholder styling for RichTextEditor and update DatepickerInput styles for better UX * feat: remove unnecessary divider from container header and maintain border styling * Refactor: Update headerDividerColor to use cc-weak-border variable for consistency * Fix: Correctly reset unreadErrorCount in debugger state on clearLogs * Add hideSearch prop to InspectorHeader and implement detail view logic in LeftSidebarInspector * Fix: Update default left sidebar width and adjust background colors for consistency
51 lines
1.7 KiB
JavaScript
51 lines
1.7 KiB
JavaScript
import React from 'react';
|
|
import ToggleGroup from '@/ToolJetUI/SwitchGroup/ToggleGroup';
|
|
import ToggleGroupItem from '@/ToolJetUI/SwitchGroup/ToggleGroupItem';
|
|
import { useTranslation } from 'react-i18next';
|
|
import useAppDarkMode from '@/_hooks/useAppDarkMode';
|
|
import useStore from '@/AppBuilder/_stores/store';
|
|
import { shallow } from 'zustand/shallow';
|
|
|
|
export const APP_MODES = [
|
|
{ label: 'Auto', value: 'auto' },
|
|
{ label: 'Light', value: 'light' },
|
|
{ label: 'Dark', value: 'dark' },
|
|
];
|
|
|
|
const AppModeToggle = ({ darkMode }) => {
|
|
const { onAppModeChange, appMode } = useAppDarkMode();
|
|
const { t } = useTranslation();
|
|
|
|
const setResolvedGlobals = useStore((state) => state.setResolvedGlobals);
|
|
|
|
return (
|
|
<div className="canvas-settings-row">
|
|
<span className="canvas-settings-label" data-cy={`label-padding-mode`}>
|
|
{t('leftSidebar.Settings.appMode', 'Padding')}
|
|
</span>
|
|
<div className="canvas-settings-input-wrapper">
|
|
<div className="canvas-toggle-container">
|
|
<ToggleGroup
|
|
onValueChange={(value) => {
|
|
let exposedTheme = value;
|
|
if (value === 'auto') {
|
|
exposedTheme = darkMode ? 'dark' : 'light';
|
|
}
|
|
onAppModeChange({ appMode: value });
|
|
setResolvedGlobals('theme', { name: exposedTheme });
|
|
}}
|
|
defaultValue={appMode}
|
|
>
|
|
{APP_MODES.map((appMode) => (
|
|
<ToggleGroupItem key={appMode.value} value={appMode.value}>
|
|
{appMode.label}
|
|
</ToggleGroupItem>
|
|
))}
|
|
</ToggleGroup>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default AppModeToggle;
|