Skip to content

Commit 47bf815

Browse files
committed
Refactor configurations component layout with a list container and conditional hidden footer
- pinned and nonpinned should be held together in a container - in landscape, in configurations, 'no X configured yet' should be in the middle - for perfect spacing in the middle the text 'no x created yet', should add invisible 'add new' button on top ├── apps │ └── editor │ └── src │ └── views │ └── prompt │ └── frontend │ └── Main │ └── MainView │ ├── MainView.module.scss │ ├── MainView.tsx │ └── components │ ├── BrowserConnectionStatus │ │ ├── BrowserConnectionStatus.tsx │ │ └── index.ts │ ├── Header │ │ ├── Header.module.scss │ │ ├── Header.tsx │ │ └── index.ts │ └── PromptAttachments │ ├── PromptAttachments.tsx │ └── index.ts └── packages └── ui └── src └── components └── editor └── prompt └── Configurations ├── Configurations.module.scss └── Configurations.tsx
1 parent 1da724c commit 47bf815

2 files changed

Lines changed: 16 additions & 2 deletions

File tree

‎packages/ui/src/components/editor/prompt/Configurations/Configurations.module.scss‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,12 @@
106106
}
107107
}
108108

109+
.list {
110+
display: flex;
111+
flex-direction: column;
112+
flex: 1;
113+
}
114+
109115
.separator {
110116
height: 1px;
111117
background-color: var(--vscode-menu-separatorBackground);
@@ -123,7 +129,7 @@
123129
font-style: italic;
124130
justify-content: center;
125131
padding: 4px 12px 3px 12px;
126-
height: 100%;
132+
flex: 1;
127133
color: var(--cwc-text-color-dimmed);
128134

129135
@include modern-ui {

‎packages/ui/src/components/editor/prompt/Configurations/Configurations.tsx‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,15 @@ export const Configurations: React.FC<Configurations.Props> = (props) => {
145145

146146
return (
147147
<div className={styles.container}>
148-
<div>
148+
{props.configurations.length == 0 && (
149+
<div
150+
className={styles.footer}
151+
style={{ visibility: 'hidden', pointerEvents: 'none' }}
152+
>
153+
<Button>{props.translations.add_new}</Button>
154+
</div>
155+
)}
156+
<div className={styles.list}>
149157
{pinned_configurations.length > 0 && (
150158
<>
151159
<div className={styles.configurations}>

0 commit comments

Comments
 (0)