diff --git a/src/HomePage.jsx b/src/HomePage.jsx index 8c9cd69..e4ceb21 100644 --- a/src/HomePage.jsx +++ b/src/HomePage.jsx @@ -10,35 +10,35 @@ import { FieldHeader } from "./components/FieldHeader/FieldHeader"; function HomePage() { // for testing with npm run dev please uncomment this block - // const appConfig = { - // spawners: { - // "test": { - // last_activity: "2024-11-24T15:48:29.604740Z", - // url: "/user/test", - // active: true, - // ready: false, - // }, - // "test1": { - // last_activity: "2024-11-24T15:46:56.719146Z", - // url: "/user/test1", - // active: false, - // ready: false, - // }, - // ...Array.from({ length: 50 }, (_, i) => `spawner${i + 1}`).reduce((acc, spawner) => { - // acc[spawner] = { - // last_activity: new Date().toISOString(), - // url: `/user/${spawner}`, - // active: Math.random() < 0.5, // Randomly set active status - // ready: Math.random() < 0.5, // Randomly set ready status - // }; - // return acc; - // }, {}) - // }, - // default_server_active: false, - // url: "http://localhost", - // userName: "dev", - // xsrf: "sample-xsrf-token", - // }; + const appConfig = { + spawners: { + "test": { + last_activity: "2024-11-24T15:48:29.604740Z", + url: "/user/test", + active: true, + ready: false, + }, + "test1": { + last_activity: "2024-11-24T15:46:56.719146Z", + url: "/user/test1", + active: false, + ready: false, + }, + ...Array.from({ length: 50 }, (_, i) => `spawner${i + 1}`).reduce((acc, spawner) => { + acc[spawner] = { + last_activity: new Date().toISOString(), + url: `/user/${spawner}`, + active: Math.random() < 0.5, // Randomly set active status + ready: Math.random() < 0.5, // Randomly set ready status + }; + return acc; + }, {}) + }, + default_server_active: false, + url: "http://localhost", + userName: "dev", + xsrf: "sample-xsrf-token", + }; const [spawners, setSpawners] = useState(appConfig.spawners); const [defaultServerActive, setDefaultServerActive] = useState( @@ -148,9 +148,13 @@ function HomePage() { {Object.entries(spawners).map(([name, spawner], dropdownIndex) => ( - setActiveDropdownIndex(dropdownIndex)} > @@ -185,7 +189,7 @@ function HomePage() { )} - + ))} diff --git a/src/components/Button/Button.css b/src/components/Button/Button.css index 2e6d576..66f112e 100644 --- a/src/components/Button/Button.css +++ b/src/components/Button/Button.css @@ -9,7 +9,7 @@ .btn--primary { background-color: var(--primary-color); color: white; - padding: 1rem; + padding: 0.6rem; border: none; cursor: pointer; text-align: center; @@ -36,7 +36,7 @@ .btn--secondary { background-color: rgb(117, 5, 5); color: white; - padding: 1rem; + padding: 0.6rem; border: none; cursor: pointer; text-align: center; diff --git a/src/components/DropDownButton/DropDownButton.css b/src/components/DropDownButton/DropDownButton.css index 4b6ee92..9d612b2 100644 --- a/src/components/DropDownButton/DropDownButton.css +++ b/src/components/DropDownButton/DropDownButton.css @@ -1,8 +1,30 @@ .dropdown { position: relative; display: flex; - width: 100%; flex-direction: column; + width: 100%; + padding: 0.6rem; +} + +.activeText { + /*margin-left: auto;*/ + grid-area: text; + /*margin: 0;*/ + font-size: 16px; +} + + .title { + grid-area: title; + /*margin: 0;*/ + /* margin-left: auto;*/ + /* justify-self: left;*/ + font-size: 16px; +} + + .icon { + grid-area: icon; + /*margin: 0;*/ + font-size: 16px; } .dropbtn--primary { @@ -17,8 +39,12 @@ margin-bottom: 4px; - display: flex; justify-content: space-between; + + display: grid; + grid-template-areas: "title . text . icon"; + grid-template-columns: auto 25fr auto 1fr auto; + } .dropbtn--primary.selected { diff --git a/src/components/DropDownButton/DropDownButton.tsx b/src/components/DropDownButton/DropDownButton.tsx index 24d62ac..cb066c6 100644 --- a/src/components/DropDownButton/DropDownButton.tsx +++ b/src/components/DropDownButton/DropDownButton.tsx @@ -16,6 +16,7 @@ interface DropDownButtonProps { hasIcon: boolean; isSelected: boolean; onActivate: () => void; + activeText?: string; } export const DropDownButton: React.FC = ({ @@ -24,8 +25,10 @@ export const DropDownButton: React.FC = ({ children, primary = true, isActive = false, + activeText = "", hasIcon = false, isSelected = false, + onActivate = () => {}, }) => { const [isOpen, setIsOpen] = useState(false); @@ -47,10 +50,12 @@ export const DropDownButton: React.FC = ({ className={`dropbtn--${primary ? "primary" : "secondary"} ${isOpen ? "active" : ""} ${isSelected ? "selected" : ""}`} onClick={toggleDropdown} > - {title} - {infoText && } - {hasIcon && !isOpen && } - {hasIcon && isOpen && } + {title} + {activeText} + {/*{activeText}*/} + {infoText && } + {hasIcon && !isOpen && } + {hasIcon && isOpen && } {isOpen && {children}} diff --git a/src/components/FieldHeader/FieldHeader.css b/src/components/FieldHeader/FieldHeader.css index b421952..ca4fb7f 100644 --- a/src/components/FieldHeader/FieldHeader.css +++ b/src/components/FieldHeader/FieldHeader.css @@ -1,7 +1,7 @@ .field-header { background-color: var(--primary-color); color: white; - padding: 1rem; + padding: 0.6rem; font-size: 16px; border: none; text-align: left; @@ -9,6 +9,12 @@ margin-bottom: 0.25rem; display: flex; justify-content: space-between; + align-items: center; /* Ensures vertical alignment */ +} + +.field-header .activeText { + font-size: 18px; + margin-left: auto; } .field-children { diff --git a/src/components/FieldHeader/FieldHeader.tsx b/src/components/FieldHeader/FieldHeader.tsx index f47fc00..648f950 100644 --- a/src/components/FieldHeader/FieldHeader.tsx +++ b/src/components/FieldHeader/FieldHeader.tsx @@ -5,12 +5,14 @@ import { InfoBox } from "../InfoBox/InfoBox"; interface FieldHeaderProps { infoText?: string; title: string; + activeText?: string; children: React.ReactNode; } export const FieldHeader: React.FC = ({ title = "", infoText = "", + activeText= "", children, }) => { const info = ; @@ -18,8 +20,11 @@ export const FieldHeader: React.FC = ({ return ( - {title} - {infoText !== "" && info} + {title} + {activeText} + {infoText !== "" && info} + + {/*{activeText}*/} {children} diff --git a/src/components/Form/ProgressiveForm.css b/src/components/Form/ProgressiveForm.css index e31b995..4b471ac 100644 --- a/src/components/Form/ProgressiveForm.css +++ b/src/components/Form/ProgressiveForm.css @@ -1,7 +1,7 @@ .form-wrap { display: flex; flex-direction: column; - gap: 1.25rem; + gap: 0rem; } .btns_wrap {
{activeText}
{title}
{infoText !== "" && info}