Skip to content

Commit 6e4aa1a

Browse files
committed
dev pull
2 parents f0fe794 + 63ee4e7 commit 6e4aa1a

File tree

9 files changed

+341
-233
lines changed

9 files changed

+341
-233
lines changed

src/ui/components/forms/index.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ export type FieldError = {
3636
};
3737

3838
export const FormTextField = (props: {
39+
autoFocus?: any;
3940
label: string;
4041
labelColor?: any;
4142
placeholder: string;
@@ -195,9 +196,11 @@ export const EditField = (
195196
/>
196197
}
197198
/>
198-
<Box style={{ position: 'absolute', right: '10px', top: '35px' }}>
199-
<icons.pen color={iconColors.grey} />
200-
</Box>
199+
{!props.disabled && (
200+
<Box style={{ position: 'absolute', right: '10px', top: '35px' }}>
201+
<icons.pen color={iconColors.grey} />
202+
</Box>
203+
)}
201204
</FlexBox>
202205
</FlexBox.Column>
203206
);

src/ui/components/inputs/index.tsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ export const InputWithLabel = ({
3737
export const BaseInput = ({
3838
onChange,
3939
value,
40-
defaultValue,
4140
placeholder,
4241
type,
4342
hasError,
@@ -46,8 +45,7 @@ export const BaseInput = ({
4645
...props
4746
}: {
4847
onChange: any;
49-
value: string;
50-
defaultValue?: any;
48+
value?: string;
5149
placeholder?: string;
5250
type: string;
5351
hasError?: boolean;
@@ -58,7 +56,6 @@ export const BaseInput = ({
5856
{...props}
5957
onChange={onChange}
6058
value={value}
61-
defaultValue={defaultValue}
6259
placeholder={placeholder}
6360
className={cn(styles.input, hasError ? styles.error : null, className)}
6461
type={type}
@@ -123,16 +120,14 @@ export const EmailInput = ({
123120
export const TextInput = ({
124121
onChangeText,
125122
value,
126-
defaultValue,
127123
placeholder,
128124
hasError,
129125
style,
130126
type = 'text',
131127
...props
132128
}: {
133129
onChangeText: any;
134-
value: string;
135-
defaultValue?: string;
130+
value?: string;
136131
placeholder?: string;
137132
hasError?: boolean;
138133
type?: string;
@@ -144,7 +139,6 @@ export const TextInput = ({
144139
onChange={(e: any): void => {
145140
onChangeText(e.target.value);
146141
}}
147-
defaultValue={defaultValue}
148142
value={value}
149143
placeholder={placeholder}
150144
type={type}

src/ui/layouts/common/CustomStackBox/index.tsx

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,18 @@ export const CustomStackBox: React.FC<{
1212
value?: any;
1313
onCheck: any;
1414
}> = ({ image, stackName, stackDesc, value, onCheck }) => {
15-
1615
return (
1716
<Box
18-
paddingHorizontal="sm2"
17+
paddingHorizontal="sm2"
1918
paddingVertical="sm2"
20-
className={styles.stackBox}
19+
className={styles.stackBox}
2120
>
22-
<input type='checkbox' className={styles.checkbox} checked={value} onClick={onCheck} />
21+
<input
22+
type="radio"
23+
className={styles.checkbox}
24+
checked={value}
25+
onClick={onCheck}
26+
/>
2327
<Box className={styles.imageWrapper}>
2428
<Box className={styles.imageContainer}>
2529
<img src={image} alt="by Zenml" />
@@ -28,7 +32,13 @@ export const CustomStackBox: React.FC<{
2832

2933
<Box style={{ marginTop: '8px' }}>
3034
<div data-tip data-for={stackName}>
31-
<Paragraph className={styles.stackName}>{stackName?.length > 14 ? <>{stackName?.slice(0, 15)}...</> : stackName}</Paragraph>
35+
<Paragraph className={styles.stackName}>
36+
{stackName?.length > 14 ? (
37+
<>{stackName?.slice(0, 15)}...</>
38+
) : (
39+
stackName
40+
)}
41+
</Paragraph>
3242
</div>
3343
<ReactTooltip id={stackName} place="top" effect="solid">
3444
<Paragraph color="white">{stackName}</Paragraph>
@@ -37,7 +47,13 @@ export const CustomStackBox: React.FC<{
3747

3848
<Box marginTop="xs">
3949
<div data-tip data-for={stackDesc}>
40-
<Paragraph className={styles.stackDesc}>{stackDesc?.length > 14 ? <>{titleCase(stackDesc?.slice(0, 15))}...</> : stackDesc}</Paragraph>
50+
<Paragraph className={styles.stackDesc}>
51+
{stackDesc?.length > 14 ? (
52+
<>{titleCase(stackDesc?.slice(0, 15))}...</>
53+
) : (
54+
stackDesc
55+
)}
56+
</Paragraph>
4157
</div>
4258
<ReactTooltip id={stackDesc} place="top" effect="solid">
4359
<Paragraph color="white">{titleCase(stackDesc)}</Paragraph>

src/ui/layouts/common/FormElement/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export function ToggleField(props: any) {
5454
const { name, value, onHandleChange, label, disabled } = props;
5555
return (
5656
<Box style={{ height: '68px' }}>
57-
<FlexBox.Row justifyContent="space-between" flexDirection='column'>
57+
<FlexBox.Row justifyContent="space-between" flexDirection="column">
5858
<Box>
5959
<Paragraph size="body" style={{ color: '#000' }}>
6060
{label}
@@ -65,6 +65,7 @@ export function ToggleField(props: any) {
6565
<label className={styles.switch}>
6666
<input
6767
type="checkbox"
68+
defaultChecked={value}
6869
onChange={(event) => onHandleChange(name, event.target.checked)}
6970
disabled={disabled}
7071
/>

0 commit comments

Comments
 (0)