From 7f8b95d42efc0c09bdd91bc2b2c92c11df4679e7 Mon Sep 17 00:00:00 2001 From: LordMathis Date: Fri, 27 Sep 2024 13:01:59 +0200 Subject: [PATCH] Improve settings layout --- frontend/src/App.scss | 20 ++++++++--- frontend/src/components/Settings.js | 56 ++++++++++++++--------------- 2 files changed, 42 insertions(+), 34 deletions(-) diff --git a/frontend/src/App.scss b/frontend/src/App.scss index faa99a0..b855b5f 100644 --- a/frontend/src/App.scss +++ b/frontend/src/App.scss @@ -1,5 +1,4 @@ // Variables -$border-color: #eaeaea; $padding: 20px; $navbar-height: 64px; // Adjust this value based on your preference @@ -9,11 +8,9 @@ $navbar-height: 64px; // Adjust this value based on your preference justify-content: space-between; padding: 0 $padding; height: $navbar-height; - border-bottom: 1px solid $border-color; } .sidebar { - border-right: 1px solid $border-color; overflow-y: auto; padding: $padding; } @@ -29,7 +26,6 @@ $navbar-height: 64px; // Adjust this value based on your preference justify-content: space-between; align-items: center; padding: $padding; - border-bottom: 1px solid $border-color; .breadcrumbs-container { flex-grow: 1; @@ -46,6 +42,21 @@ $navbar-height: 64px; // Adjust this value based on your preference } } +.disabled { + opacity: 0.6; + cursor: not-allowed; +} + +.setting-group { + margin-bottom: 1rem; +} +.setting-item { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 0.5rem; +} + .content-body { flex-grow: 1; overflow: hidden; @@ -59,7 +70,6 @@ $navbar-height: 64px; // Adjust this value based on your preference padding: $padding; } -// Ensure CodeMirror takes full height of its container .editor-container { height: 100%; diff --git a/frontend/src/components/Settings.js b/frontend/src/components/Settings.js index 153a338..acd70a4 100644 --- a/frontend/src/components/Settings.js +++ b/frontend/src/components/Settings.js @@ -1,47 +1,45 @@ import React, { useState } from 'react'; -import { Modal, Input, Toggle, Spacer, Button, Text } from '@geist-ui/core'; +import { Modal, Text, Toggle, Tooltip, Input, Spacer, Button, useTheme } from '@geist-ui/core'; -const Settings = ({ visible, onClose, currentTheme, onThemeChange }) => { +const Settings = ({ visible, onClose, currentTheme, onThemeChange, onSettingsChange }) => { + const theme = useTheme(); const [fontSize, setFontSize] = useState('14'); const [autoSave, setAutoSave] = useState(false); const handleSubmit = () => { - const settings = { - fontSize, - autoSave, - }; - console.log('Settings to be sent to backend:', settings); - // TODO: Implement API call to send settings to backend + onSettingsChange({ fontSize, autoSave }); onClose(); }; + const disabledMessage = "This feature is not yet implemented"; + return ( Settings - Theme - onThemeChange()} - > - Dark Mode - - - setFontSize(e.target.value)} - /> - - setAutoSave(e.target.checked)} - > - Auto Save - +
+ Appearance +
+ Dark Mode + onThemeChange()} + /> +
+
+ +
+ Editor + +
+ Auto Save + +
+
+
Cancel - Submit + Save Changes
); };