Skip to content

Commit 98b7573

Browse files
committed
organization modals update
1 parent 141166a commit 98b7573

File tree

14 files changed

+476
-224
lines changed

14 files changed

+476
-224
lines changed

src/redux/reducers/rolesReducer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const newState = (roles: Roles[]): State => ({
2323
const rolesReducer = (state: State = initialState, action: Action): State => {
2424
switch (action.type) {
2525
case rolesActionTypes.getRoles.success: {
26-
const roles: Roles[] = camelCaseArray(action.payload as RolesPayload);
26+
const roles: Roles[] = camelCaseArray(action.payload?.items as RolesPayload);
2727

2828
return { ...newState(roles) };
2929
}

src/services/locales/zu.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,11 +217,11 @@
217217
"text": "Change the username, role and password of",
218218
"form": {
219219
"username": {
220-
"label": "username",
220+
"label": "Username",
221221
"placeholder": "username"
222222
},
223223
"password": {
224-
"label": "password",
224+
"label": "Password",
225225
"placeholder": "password"
226226
}
227227
},

src/ui/components/forms/index.tsx

Lines changed: 92 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
Box,
1111
LinkBox,
1212
icons,
13-
DropdownInput,
13+
DropdownInput
1414
} from '..';
1515
import { handleUpdateNumericInput } from '../../../utils/input';
1616
import { iconColors } from '../../../constants/icons';
@@ -118,8 +118,9 @@ export const CopyField = (
118118
labelColor: any;
119119
placeholder: any;
120120
value: string;
121+
showTokField: any;
121122
} & any,
122-
): JSX.Element => {
123+
): any => {
123124
const [copied, setCopied] = useState(false);
124125
const handleClick = () => {
125126
navigator.clipboard.writeText(props.value);
@@ -130,26 +131,38 @@ export const CopyField = (
130131
};
131132

132133
return (
133-
<FlexBox.Column fullWidth style={{ height: '100px' }}>
134+
<FlexBox.Column fullWidth>
134135
<FlexBox alignItems="center" fullWidth style={{ position: 'relative' }}>
135136
<InputWithLabel
136137
name={props.name}
137138
label={props.label}
138139
labelColor={props.labelColor}
139140
InputComponent={
140-
<TextInput
141-
{...props}
142-
value={`${props.value.slice(0, 60)}...`}
143-
placeholder={props.placeholder}
144-
/>
145-
}
141+
props.showTokField ?
142+
<TextInput
143+
{...props}
144+
style={{ background: 'rgba(168, 168, 168, 0.2)', border: '1px solid #C9CBD0' }}
145+
value={`${props.value.slice(0, 30)}...`}
146+
placeholder={props.placeholder}
147+
/>
148+
:
149+
<TextInput
150+
{...props}
151+
style={{ background: 'rgba(168, 168, 168, 0.2)', border: '1px solid #C9CBD0' }}
152+
value='Token'
153+
placeholder={props.placeholder}
154+
/>
155+
}
146156
/>
147-
<LinkBox
148-
style={{ position: 'absolute', right: '10px', top: '30px' }}
149-
onClick={handleClick}
150-
>
151-
<icons.copy color={iconColors.grey} />
152-
</LinkBox>
157+
158+
{props.showTokField && (
159+
<LinkBox
160+
style={{ position: 'absolute', right: '10px', top: '40px' }}
161+
onClick={handleClick}
162+
>
163+
<icons.copy color={iconColors.grey} />
164+
</LinkBox>
165+
)}
153166
</FlexBox>
154167
{copied && (
155168
<div style={{ marginTop: '20px', textAlign: 'right' }}>
@@ -169,6 +182,70 @@ export const CopyField = (
169182
);
170183
};
171184

185+
186+
export const GenerateTokenField = (
187+
props: {
188+
label: string;
189+
labelColor: any;
190+
placeholder: any;
191+
value: string;
192+
handleClick: any;
193+
loading: boolean;
194+
hideButton: boolean;
195+
} & any,
196+
): any => {
197+
return (
198+
<FlexBox.Column fullWidth>
199+
<FlexBox alignItems="center" fullWidth style={{ position: 'relative' }}>
200+
<InputWithLabel
201+
optional={props.required}
202+
name={props.name}
203+
label={props.label}
204+
labelColor={props.labelColor}
205+
InputComponent={
206+
<TextInput
207+
{...props}
208+
style={props.style}
209+
placeholder={props.placeholder}
210+
hasError={props.error?.hasError}
211+
value={props.value}
212+
onChangeText={props.onChange}
213+
/>
214+
}
215+
/>
216+
{!props.hideButton && (
217+
<Box
218+
style={{
219+
position: 'absolute',
220+
right: '0',
221+
top: '38px',
222+
display: 'flex',
223+
justifyContent: 'center',
224+
textAlign: 'center',
225+
}} >
226+
<Box style={{ width: '120px', borderLeft: '1px solid #C9CBD0' }}>
227+
<div style={{
228+
fontFamily: 'Rubik',
229+
fontSize: '16px',
230+
color: '#443E99',
231+
marginTop: '3px',
232+
cursor: 'pointer'
233+
}}
234+
onClick={props.handleClick}
235+
>
236+
{props.loading ? <>Submitting...</> : <>Generate</>}
237+
</div>
238+
</Box>
239+
</Box>
240+
)}
241+
</FlexBox>
242+
</FlexBox.Column>
243+
);
244+
};
245+
246+
247+
248+
172249
export const EditField = (
173250
props: {
174251
label: string;

src/ui/layouts/common/PopupSmall/index.module.scss

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22

33
.dimmer {
44
position: fixed;
5-
background: #424240;
6-
opacity: 0.5;
5+
// background: #424240;
6+
// opacity: 0.5;
7+
background: rgba(217, 217, 217, 0.2);
8+
backdrop-filter: blur(4px);
79
height: 100vh;
810
width: 100vw;
911
top: 0;

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

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@ import styles from './index.module.scss';
77

88
const Dimmer: React.FC = () => <Box className={styles.dimmer}></Box>;
99

10-
export const PopupSmall: React.FC<{ onClose: () => void }> = ({
10+
export const PopupSmall: React.FC<{ width?: string, showCloseIcon?: any, onClose: () => void }> = ({
1111
children,
12+
width,
13+
showCloseIcon,
1214
onClose,
1315
}) => (
1416
<>
@@ -18,14 +20,16 @@ export const PopupSmall: React.FC<{ onClose: () => void }> = ({
1820
justifyContent="center"
1921
className={styles.popupContainer}
2022
>
21-
<Box className={styles.popup}>
23+
<Box className={styles.popup} style={{ width }}>
2224
<OutsideClickHandler onOutsideClick={onClose}>
23-
<Box className={styles.popupClose}>
24-
<LinkBox onClick={onClose}>
25-
<icons.closeWithBorder />
26-
</LinkBox>
27-
</Box>
28-
<Box paddingVertical="xl" paddingHorizontal="xxxl">
25+
{showCloseIcon && (
26+
<Box className={styles.popupClose}>
27+
<LinkBox onClick={onClose}>
28+
<icons.closeWithBorder />
29+
</LinkBox>
30+
</Box>
31+
)}
32+
<Box paddingVertical="lg" paddingHorizontal="lg">
2933
{children}
3034
</Box>
3135
</OutsideClickHandler>

0 commit comments

Comments
 (0)