Skip to content

Commit c1b74d5

Browse files
fixed
1 parent 555ae81 commit c1b74d5

File tree

1 file changed

+37
-105
lines changed
  • src/ui/layouts/stackComponents/StackDetail/Configuration

1 file changed

+37
-105
lines changed

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

Lines changed: 37 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,16 @@ import {
1111
import styles from './index.module.scss';
1212
import { useService } from './useService';
1313

14-
1514
export const Configuration: React.FC<{ stackId: TId }> = ({ stackId }) => {
1615
const { stackComponent } = useService({
1716
stackId,
1817
});
1918

20-
2119
const titleCase = (s: any) =>
2220
s.replace(/^_*(.)|_+(.)/g, (s: any, c: string, d: string) =>
2321
c ? c.toUpperCase() : ' ' + d.toUpperCase(),
2422
);
2523

26-
2724
const getFormElement = (elementName: any, elementSchema: any) => {
2825
if (typeof elementSchema === 'string') {
2926
return (
@@ -78,9 +75,9 @@ export const Configuration: React.FC<{ stackId: TId }> = ({ stackId }) => {
7875
}
7976
if (typeof elementSchema === 'boolean') {
8077
return (
81-
<Box
82-
// marginVertical="md"
83-
style={{ width: '100%' }}
78+
<Box
79+
// marginVertical="md"
80+
style={{ width: '100%' }}
8481
>
8582
<Box>
8683
<FlexBox.Row justifyContent="space-between">
@@ -97,10 +94,10 @@ export const Configuration: React.FC<{ stackId: TId }> = ({ stackId }) => {
9794
};
9895

9996
return (
100-
<FlexBox justifyContent='space-between' marginTop="xl" fullWidth>
101-
<Container>
102-
<Row>
103-
<Col xs={6}>
97+
<FlexBox.Column marginTop="xl" fullWidth>
98+
<FlexBox.Row>
99+
<Container>
100+
<Box style={{ width: '79%' }}>
104101
<EditField
105102
disabled
106103
onChangeText={() => console.log('')}
@@ -111,107 +108,42 @@ export const Configuration: React.FC<{ stackId: TId }> = ({ stackId }) => {
111108
hasError={false}
112109
className={styles.field}
113110
/>
111+
</Box>
112+
</Container>
113+
<Container>
114+
<FlexBox.Row justifyContent="space-between" style={{ width: '70%' }}>
115+
<Paragraph>Share Component with public</Paragraph>
116+
<label className={styles.switch}>
117+
<input type="checkbox" checked={stackComponent.isShared} />
118+
<span className={`${styles.slider} ${styles.round}`}></span>
119+
</label>
120+
</FlexBox.Row>
121+
</Container>
122+
</FlexBox.Row>
123+
<FlexBox.Row style={{ width: '40%' }}>
124+
<Container>
125+
{/* <Row>
126+
<Col xs={5}>
127+
114128
</Col>
115-
<Col xs={6} >
129+
<Col xs={5} style={{ marginLeft: '100px' }}>
116130
<FlexBox.Row justifyContent="space-between">
117131
<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>
132+
<label className={styles.switch}>
133+
<input type="checkbox" checked={stackComponent.isShared} />
134+
<span className={`${styles.slider} ${styles.round}`}></span>
135+
</label>
122136
</FlexBox.Row>
123137
</Col>
124-
138+
</Row> */}
139+
125140
{Object.keys(stackComponent?.configuration).map((key, ind) => (
126-
<Col xs={6} key={ind}>
127-
{getFormElement(key, stackComponent?.configuration[key])}
128-
</Col>
141+
// <Col xs={6} key={ind}>
142+
<>{getFormElement(key, stackComponent?.configuration[key])}</>
143+
// </Col>
129144
))}
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>
145+
</Container>
146+
</FlexBox.Row>
147+
</FlexBox.Column>
216148
);
217149
};

0 commit comments

Comments
 (0)