Skip to content

Commit ef52f1e

Browse files
committed
stack and toggle update
1 parent 6e4aa1a commit ef52f1e

File tree

5 files changed

+36
-45
lines changed

5 files changed

+36
-45
lines changed

src/ui/layouts/NonEditableConfig/index.tsx

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -108,21 +108,11 @@ export const NonEditableConfig: React.FC<{ details: any }> = ({ details }) => {
108108
return (
109109
<Box marginVertical={'md'} style={{ width: '100%' }}>
110110
<ToggleField
111-
name={titleCase(elementName)}
112111
value={elementSchema}
113112
onHandleChange={() => {}}
114113
label={titleCase(elementName)}
115114
disabled={true}
116115
/>
117-
{/* <Box>
118-
<FlexBox.Row justifyContent="space-between">
119-
<Paragraph>{titleCase(elementName)}</Paragraph>
120-
<label className={styles.switch}>
121-
<input type="checkbox" checked={elementSchema} />
122-
<span className={`${styles.slider} ${styles.round}`}></span>
123-
</label>
124-
</FlexBox.Row>
125-
</Box> */}
126116
</Box>
127117
);
128118
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export function TextField(props: any) {
5151
// }
5252

5353
export function ToggleField(props: any) {
54-
const { name, value, onHandleChange, label, disabled } = props;
54+
const { value, onHandleChange, label, disabled } = props;
5555
return (
5656
<Box style={{ height: '68px' }}>
5757
<FlexBox.Row justifyContent="space-between" flexDirection="column">
@@ -65,8 +65,8 @@ export function ToggleField(props: any) {
6565
<label className={styles.switch}>
6666
<input
6767
type="checkbox"
68-
defaultChecked={value}
69-
onChange={(event) => onHandleChange(name, event.target.checked)}
68+
checked={value}
69+
onChange={onHandleChange}
7070
disabled={disabled}
7171
/>
7272
<span className={`${styles.sliderBlue} ${styles.round}`}></span>

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

Lines changed: 13 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import {
2222
stackComponentsActions,
2323
} from '../../../../../redux/actions';
2424
import { toasterTypes } from '../../../../../constants';
25+
import { ToggleField } from '../../../common/FormElement';
2526

2627
export const Configuration: React.FC<{ stackId: TId }> = ({ stackId }) => {
2728
const { stackComponent, flavor } = useService({
@@ -449,21 +450,12 @@ export const Configuration: React.FC<{ stackId: TId }> = ({ stackId }) => {
449450
return (
450451
<Box marginVertical={'md'} style={{ width: '100%' }}>
451452
<Box>
452-
{console.log(elementSchema, elementName, 'asdasdasda2222sdasd')}
453-
<FlexBox.Row justifyContent="space-between">
454-
<Paragraph>{titleCase(elementName)}</Paragraph>
455-
<label className={styles.switch}>
456-
<input
457-
disabled
458-
type="checkbox"
459-
defaultChecked={elementSchema}
460-
onChange={() =>
461-
onChangeToggle(!elementSchema, 'other', elementName)
462-
}
463-
/>
464-
<span className={`${styles.slider} ${styles.round}`}></span>
465-
</label>
466-
</FlexBox.Row>
453+
<ToggleField
454+
value={elementSchema}
455+
onHandleChange={() => onChangeToggle(!elementSchema, 'other', elementName)}
456+
label={titleCase(elementName)}
457+
disabled={true}
458+
/>
467459
</Box>
468460
</Box>
469461
);
@@ -518,22 +510,12 @@ export const Configuration: React.FC<{ stackId: TId }> = ({ stackId }) => {
518510
</Box>
519511
</Container>
520512
<Container>
521-
<FlexBox.Row justifyContent="space-between" style={{ width: '70%' }}>
522-
<Paragraph>Share Component with public</Paragraph>
523-
<label className={styles.switch}>
524-
{console.log(stackComponent, 'asdasdasda2222122sdasd')}
525-
<input
526-
type="checkbox"
527-
disabled
528-
defaultChecked={stackComponent.isShared}
529-
// checked={stackComponent.isShared}
530-
onChange={() =>
531-
onChangeToggle(!stackComponent.isShared, 'share')
532-
}
533-
/>
534-
<span className={`${styles.slider} ${styles.round}`}></span>
535-
</label>
536-
</FlexBox.Row>
513+
<ToggleField
514+
value={stackComponent.isShared}
515+
onHandleChange={() => onChangeToggle(!stackComponent.isShared, 'share')}
516+
label='Share Component with public'
517+
disabled={true}
518+
/>
537519
</Container>
538520
</FlexBox.Row>
539521
<FlexBox.Row style={{ width: '40%' }}>

src/ui/layouts/stacks/CreateStack/ListForAll/index.module.scss

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,19 @@
3131
accent-color: #431D93;
3232
position: absolute;
3333
top: 5px
34+
}
35+
36+
.stackFooter {
37+
width: 100%;
38+
height: 70px;
39+
position: sticky;
40+
bottom: 0;
41+
background-color: #fff;
42+
background: #fff;
43+
display: flex;
44+
justify-content: flex-end;
45+
}
46+
.stackFooterButton {
47+
margin-top: 15px !important;
48+
right: 2rem;
3449
}

src/ui/layouts/stacks/CreateStack/ListForAll/index.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { useState } from 'react';
22
import styles from './index.module.scss';
3-
import { Box, FlexBox, H2, FormTextField } from '../../../../components';
3+
import { Box, FlexBox, H2, FormTextField, PrimaryButton } from '../../../../components';
44
import { ToggleField } from '../../../common/FormElement';
55

66
import {
@@ -258,6 +258,10 @@ export const ListForAll: React.FC<Props> = () => {
258258
})}
259259
</FlexBox.Column>
260260

261+
<Box className={styles.stackFooter}>
262+
<PrimaryButton className={styles.stackFooterButton}>Register</PrimaryButton>
263+
</Box>
264+
261265
{showPopup && (
262266
<SidePopup
263267
isCreate={true}

0 commit comments

Comments
 (0)