Skip to content

Commit 2f3c142

Browse files
committed
UX improvements
1 parent aed1209 commit 2f3c142

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@codifycli/ink-form",
33
"type": "module",
4-
"version": "0.0.7",
4+
"version": "0.0.8",
55
"description": "Complex user-friendly form component for Codify",
66
"main": "lib/index.js",
77
"exports": "./lib/index.js",

src/Form.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ export const Form: React.FC<FormProps> = props => {
135135

136136
setSections(newTabs);
137137
setValue([...value]);
138-
onChangeTab(Math.min(currentTab, sections.length - 2));
138+
onChangeTab(Math.max(currentTab - 1, 0));
139139
}
140140

141141
const upperFirstLetter = (s?: string): string | undefined => {
@@ -198,7 +198,7 @@ export const Form: React.FC<FormProps> = props => {
198198
{!editingField && (
199199
<Box flexDirection='column' marginTop={1}>
200200
<Box flexDirection="row">
201-
<Button label="[D]uplicate resource" id={'addButton'} onClicked={() => duplicateCurrentSection()}/>
201+
<Button label="[A]dd resource" id={'addButton'} onClicked={() => duplicateCurrentSection()}/>
202202
<Button label="[R]emove resource" id={'removeButton'} isEnabled={sections.length > 1} onClicked={() => removeCurrentSection()}/>
203203
<SubmitButton canSubmit={canSubmitForm} onSubmit={onSubmitForm}/>
204204
</Box>

src/FormHeader.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,12 @@ export const FormHeader: React.FC<
2929
);
3030

3131
return (
32-
<Box borderStyle="double" width="100%" flexDirection="column" ref={props.headerRef}>
33-
<Box width="100%">
32+
<Box
33+
borderStyle="single"
34+
width="100%"
35+
flexDirection="column"
36+
ref={props.headerRef}>
37+
<Box width="100%" marginBottom={1}>
3438
<Box flexGrow={1}>
3539
<Text>
3640
<Text bold>{props.form.title}</Text>
@@ -40,7 +44,7 @@ export const FormHeader: React.FC<
4044
</Text>
4145
</Box>
4246
</Box>
43-
<Box width="100%">
47+
<Box width="100%" marginBottom={0}>
4448
<Box flexWrap='wrap'>
4549
{!props.editingField ? (
4650
sections.map((section, id) => (

src/demo/Test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export function Test() {
4141
}}
4242
form={{
4343
title: "Need more info to identify resources for import",
44-
description: 'multiples could exist',
44+
description: 'multiples could exist on the system',
4545
sections: [
4646
{
4747
title: "asdf-global",

0 commit comments

Comments
 (0)