Skip to content

Commit f844524

Browse files
committed
Merge remote-tracking branch 'origin/UAT' into main
2 parents 20372df + 35ad3a5 commit f844524

File tree

1 file changed

+36
-109
lines changed
  • src/ui/layouts/stackComponents/StackDetail/Configuration

1 file changed

+36
-109
lines changed

src/ui/layouts/stackComponents/StackDetail/Configuration/index.tsx

Lines changed: 36 additions & 109 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,21 @@ import {
44
Box,
55
EditField,
66
Paragraph,
7-
Row,
8-
Col,
97
Container,
108
} from '../../../../components';
119
import styles from './index.module.scss';
1210
import { useService } from './useService';
1311

14-
1512
export const Configuration: React.FC<{ stackId: TId }> = ({ stackId }) => {
1613
const { stackComponent } = useService({
1714
stackId,
1815
});
1916

20-
2117
const titleCase = (s: any) =>
2218
s.replace(/^_*(.)|_+(.)/g, (s: any, c: string, d: string) =>
2319
c ? c.toUpperCase() : ' ' + d.toUpperCase(),
2420
);
2521

26-
2722
const getFormElement = (elementName: any, elementSchema: any) => {
2823
if (typeof elementSchema === 'string') {
2924
return (
@@ -52,7 +47,7 @@ export const Configuration: React.FC<{ stackId: TId }> = ({ stackId }) => {
5247
<EditField
5348
disabled
5449
onChangeText={() => console.log('')}
55-
label="key"
50+
label="Key"
5651
optional={false}
5752
value={key}
5853
placeholder=""
@@ -78,10 +73,7 @@ export const Configuration: React.FC<{ stackId: TId }> = ({ stackId }) => {
7873
}
7974
if (typeof elementSchema === 'boolean') {
8075
return (
81-
<Box
82-
// marginVertical="md"
83-
style={{ width: '100%' }}
84-
>
76+
<Box marginBottom={'xl'} style={{ width: '100%' }}>
8577
<Box>
8678
<FlexBox.Row justifyContent="space-between">
8779
<Paragraph>{titleCase(elementName)}</Paragraph>
@@ -97,10 +89,10 @@ export const Configuration: React.FC<{ stackId: TId }> = ({ stackId }) => {
9789
};
9890

9991
return (
100-
<FlexBox justifyContent='space-between' marginTop="xl" fullWidth>
101-
<Container>
102-
<Row>
103-
<Col xs={6}>
92+
<FlexBox.Column marginTop="xl" fullWidth>
93+
<FlexBox.Row>
94+
<Container>
95+
<Box style={{ width: '79%' }}>
10496
<EditField
10597
disabled
10698
onChangeText={() => console.log('')}
@@ -111,107 +103,42 @@ export const Configuration: React.FC<{ stackId: TId }> = ({ stackId }) => {
111103
hasError={false}
112104
className={styles.field}
113105
/>
106+
</Box>
107+
</Container>
108+
<Container>
109+
<FlexBox.Row justifyContent="space-between" style={{ width: '70%' }}>
110+
<Paragraph>Share Component with public</Paragraph>
111+
<label className={styles.switch}>
112+
<input type="checkbox" checked={stackComponent.isShared} />
113+
<span className={`${styles.slider} ${styles.round}`}></span>
114+
</label>
115+
</FlexBox.Row>
116+
</Container>
117+
</FlexBox.Row>
118+
<FlexBox.Row style={{ width: '40%' }}>
119+
<Container>
120+
{/* <Row>
121+
<Col xs={5}>
122+
114123
</Col>
115-
<Col xs={6} >
124+
<Col xs={5} style={{ marginLeft: '100px' }}>
116125
<FlexBox.Row justifyContent="space-between">
117126
<Paragraph>Share Component with public</Paragraph>
118-
<label className={styles.switch}>
119-
<input type="checkbox" checked={stackComponent.isShared} />
120-
<span className={`${styles.slider} ${styles.round}`}></span>
121-
</label>
127+
<label className={styles.switch}>
128+
<input type="checkbox" checked={stackComponent.isShared} />
129+
<span className={`${styles.slider} ${styles.round}`}></span>
130+
</label>
122131
</FlexBox.Row>
123132
</Col>
124-
133+
</Row> */}
134+
125135
{Object.keys(stackComponent?.configuration).map((key, ind) => (
126-
<Col xs={6} key={ind}>
127-
{getFormElement(key, stackComponent?.configuration[key])}
128-
</Col>
136+
// <Col xs={6} key={ind}>
137+
<>{getFormElement(key, stackComponent?.configuration[key])}</>
138+
// </Col>
129139
))}
130-
131-
</Row>
132-
</Container>
133-
134-
135-
{/* <FlexBox.Row>
136-
<Box style={{ width: '40%' }}>
137-
<Box>
138-
<EditField
139-
onChangeText={() => console.log('')}
140-
label="Flavour Name"
141-
optional={false}
142-
value=""
143-
placeholder=""
144-
hasError={false}
145-
className={styles.field}
146-
/>
147-
</Box>
148-
149-
<Box>
150-
<EditField
151-
onChangeText={() => console.log('')}
152-
label="Item 1"
153-
optional={true}
154-
value=""
155-
placeholder=""
156-
hasError={false}
157-
className={styles.field}
158-
/>
159-
</Box>
160-
<Box>
161-
<EditField
162-
onChangeText={() => console.log('')}
163-
label="Item 2"
164-
optional={true}
165-
value=""
166-
placeholder=""
167-
hasError={false}
168-
className={styles.field}
169-
/>
170-
</Box>
171-
<Box>
172-
<EditField
173-
onChangeText={() => console.log('')}
174-
label="Item 3"
175-
optional={true}
176-
value=""
177-
placeholder=""
178-
hasError={false}
179-
className={styles.field}
180-
/>
181-
</Box>
182-
<Box>
183-
<EditField
184-
onChangeText={() => console.log('')}
185-
label="Item 4"
186-
optional={true}
187-
value=""
188-
placeholder=""
189-
hasError={false}
190-
className={styles.field}
191-
/>
192-
</Box>
193-
</Box>
194-
195-
<Box style={{ width: '60%' }} marginTop="xl" marginHorizontal="xxl">
196-
<Box>
197-
<FlexBox.Row justifyContent="space-between">
198-
<Paragraph>Share Component with public</Paragraph> <CheckBox />
199-
</FlexBox.Row>
200-
</Box>
201-
<Box style={{ marginTop: '80px' }}>
202-
<FlexBox.Row justifyContent="space-between">
203-
<Paragraph>Auto Update</Paragraph> <CheckBox />
204-
</FlexBox.Row>
205-
</Box>
206-
<Box style={{ marginTop: '80px' }}>
207-
<FlexBox.Row justifyContent="space-between">
208-
<Paragraph>Notification update</Paragraph> <CheckBox />
209-
</FlexBox.Row>
210-
</Box>
211-
</Box>
212-
</FlexBox.Row> */}
213-
214-
{/* <Box style={{ marginLeft: 'auto' }} marginRight='lg' ><PrimaryButton>Register Component</PrimaryButton></Box> */}
215-
</FlexBox>
140+
</Container>
141+
</FlexBox.Row>
142+
</FlexBox.Column>
216143
);
217144
};

0 commit comments

Comments
 (0)