@openlettermarketing/olc-react-sdk 2.1.6 → 2.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.js +1 -1
- package/build/index.js.map +1 -1
- package/build/types/version.d.ts +1 -1
- package/package.json +7 -6
- package/.eslintignore +0 -1
- package/.eslintrc.cjs +0 -18
- package/.eslintrc.yml +0 -47
- package/.github/workflows/publish-beta.yml +0 -154
- package/.github/workflows/publish-production.yml +0 -143
- package/.prettierignore +0 -3
- package/.prettierrc.yml +0 -5
- package/CHANGELOG.md +0 -4
- package/babel.config.json +0 -10
- package/examples/.eslintrc.yml +0 -4
- package/index.html +0 -18
- package/public/vite.svg +0 -1
- package/src/App.tsx +0 -209
- package/src/assets/Fonts/Lexi-Regular.ttf +0 -0
- package/src/assets/images/create-template/prebuilt.svg +0 -13
- package/src/assets/images/create-template/scratch.svg +0 -4
- package/src/assets/images/input/cancel.tsx +0 -20
- package/src/assets/images/input/search.tsx +0 -20
- package/src/assets/images/input/select-cancel.tsx +0 -17
- package/src/assets/images/modal-icons/add.tsx +0 -36
- package/src/assets/images/modal-icons/cancel-file.tsx +0 -12
- package/src/assets/images/modal-icons/cancel-input.tsx +0 -13
- package/src/assets/images/modal-icons/cancel.tsx +0 -35
- package/src/assets/images/modal-icons/close-new.svg +0 -3
- package/src/assets/images/modal-icons/confirm-close-icon.tsx +0 -14
- package/src/assets/images/modal-icons/confirm-new.tsx +0 -22
- package/src/assets/images/modal-icons/confirm.svg +0 -12
- package/src/assets/images/modal-icons/cross.tsx +0 -23
- package/src/assets/images/modal-icons/del.tsx +0 -19
- package/src/assets/images/modal-icons/design-icon.tsx +0 -22
- package/src/assets/images/modal-icons/doc.tsx +0 -43
- package/src/assets/images/modal-icons/docx.tsx +0 -43
- package/src/assets/images/modal-icons/envelope-icon.tsx +0 -26
- package/src/assets/images/modal-icons/info.tsx +0 -19
- package/src/assets/images/modal-icons/jpeg.tsx +0 -43
- package/src/assets/images/modal-icons/jpg.tsx +0 -43
- package/src/assets/images/modal-icons/modal-cros.svg +0 -4
- package/src/assets/images/modal-icons/modal-cross.tsx +0 -37
- package/src/assets/images/modal-icons/new-cancel.tsx +0 -11
- package/src/assets/images/modal-icons/order-download.tsx +0 -42
- package/src/assets/images/modal-icons/pdf.tsx +0 -51
- package/src/assets/images/modal-icons/png.tsx +0 -43
- package/src/assets/images/modal-icons/save.tsx +0 -23
- package/src/assets/images/modal-icons/template-copy.tsx +0 -25
- package/src/assets/images/modal-icons/tool-cancel.tsx +0 -25
- package/src/assets/images/products/bi-new.svg +0 -23
- package/src/assets/images/products/left-arrow.svg +0 -17
- package/src/assets/images/products/personal-new.tsx +0 -31
- package/src/assets/images/products/postcard-new.tsx +0 -27
- package/src/assets/images/products/professional-new.tsx +0 -24
- package/src/assets/images/products/real-new.tsx +0 -30
- package/src/assets/images/products/right-arrow.svg +0 -17
- package/src/assets/images/products/snap-new.svg +0 -31
- package/src/assets/images/templates/actions.svg +0 -3
- package/src/assets/images/templates/address-block-icon.tsx +0 -62
- package/src/assets/images/templates/archive.svg +0 -3
- package/src/assets/images/templates/arrow-down.tsx +0 -27
- package/src/assets/images/templates/back-arrow.tsx +0 -19
- package/src/assets/images/templates/bi-fold-self-mailers.tsx +0 -28
- package/src/assets/images/templates/check.svg +0 -3
- package/src/assets/images/templates/code.svg +0 -10
- package/src/assets/images/templates/content-copy-icon.tsx +0 -24
- package/src/assets/images/templates/custom-add-on-icon.tsx +0 -18
- package/src/assets/images/templates/custom-qr-section-icon.tsx +0 -9
- package/src/assets/images/templates/custom-template.tsx +0 -23
- package/src/assets/images/templates/designer.tsx +0 -43
- package/src/assets/images/templates/dot.tsx +0 -22
- package/src/assets/images/templates/download-v2.svg +0 -4
- package/src/assets/images/templates/download.svg +0 -4
- package/src/assets/images/templates/dummy-template.tsx +0 -76
- package/src/assets/images/templates/dynamic-field.tsx +0 -119
- package/src/assets/images/templates/edit-pencil-icon.tsx +0 -21
- package/src/assets/images/templates/edit.svg +0 -3
- package/src/assets/images/templates/epo-icon.tsx +0 -16
- package/src/assets/images/templates/field.tsx +0 -29
- package/src/assets/images/templates/gsv-icon.tsx +0 -31
- package/src/assets/images/templates/info-icon.tsx +0 -37
- package/src/assets/images/templates/left-arrow.svg +0 -17
- package/src/assets/images/templates/pencil.svg +0 -3
- package/src/assets/images/templates/personal-letter.tsx +0 -53
- package/src/assets/images/templates/postcard.tsx +0 -32
- package/src/assets/images/templates/professional-letter.tsx +0 -53
- package/src/assets/images/templates/qr-code.tsx +0 -13
- package/src/assets/images/templates/real-penned-letters.tsx +0 -57
- package/src/assets/images/templates/right-arrow.svg +0 -17
- package/src/assets/images/templates/size-image-lg.tsx +0 -20
- package/src/assets/images/templates/size-image-mid.tsx +0 -20
- package/src/assets/images/templates/size-image-xl.tsx +0 -20
- package/src/assets/images/templates/size-image.tsx +0 -20
- package/src/assets/images/templates/snap-pack.tsx +0 -67
- package/src/assets/images/templates/template-default-design.tsx +0 -21
- package/src/assets/images/templates/trash-upload.svg +0 -3
- package/src/assets/images/templates/trash.svg +0 -3
- package/src/assets/images/templates/tri-fold-self-mailers.tsx +0 -93
- package/src/assets/images/templates/upload-image.svg +0 -10
- package/src/assets/images/templates/x.svg +0 -3
- package/src/assets/images/thumbnails/one.svg +0 -9
- package/src/assets/images/tooltip/tool-arrow.tsx +0 -25
- package/src/components/CreateTemplate/V2/index.tsx +0 -527
- package/src/components/CreateTemplate/V2/styles.scss +0 -372
- package/src/components/CreateTemplate/index.tsx +0 -508
- package/src/components/CreateTemplate/styles.scss +0 -404
- package/src/components/GenericUIBlocks/Button/index.tsx +0 -54
- package/src/components/GenericUIBlocks/Button/styles.scss +0 -43
- package/src/components/GenericUIBlocks/CircularProgress/index.tsx +0 -18
- package/src/components/GenericUIBlocks/CircularProgress/styles.scss +0 -93
- package/src/components/GenericUIBlocks/CustomTooltip/index.tsx +0 -88
- package/src/components/GenericUIBlocks/CustomTooltip/styles.scss +0 -19
- package/src/components/GenericUIBlocks/Dialog/V2/index.tsx +0 -227
- package/src/components/GenericUIBlocks/Dialog/V2/styles.scss +0 -289
- package/src/components/GenericUIBlocks/Dialog/index.tsx +0 -185
- package/src/components/GenericUIBlocks/Dialog/styles.scss +0 -227
- package/src/components/GenericUIBlocks/Divider/index.tsx +0 -12
- package/src/components/GenericUIBlocks/Divider/styles.scss +0 -7
- package/src/components/GenericUIBlocks/GeneralSelect/index.tsx +0 -114
- package/src/components/GenericUIBlocks/GeneralSelect/styles.scss +0 -406
- package/src/components/GenericUIBlocks/GeneralTooltip/index.tsx +0 -25
- package/src/components/GenericUIBlocks/GeneralTooltip/styles.scss +0 -20
- package/src/components/GenericUIBlocks/GenericSnackbar/Toast/index.tsx +0 -91
- package/src/components/GenericUIBlocks/GenericSnackbar/Toast/styles.scss +0 -92
- package/src/components/GenericUIBlocks/Grid/index.tsx +0 -82
- package/src/components/GenericUIBlocks/Input/index.tsx +0 -269
- package/src/components/GenericUIBlocks/Input/styles.scss +0 -332
- package/src/components/GenericUIBlocks/Tabs/index.tsx +0 -71
- package/src/components/GenericUIBlocks/Tabs/styles.scss +0 -42
- package/src/components/GenericUIBlocks/Typography/index.tsx +0 -18
- package/src/components/GenericUIBlocks/Typography/styles.scss +0 -27
- package/src/components/SidePanel/CustomAddOns/index.tsx +0 -342
- package/src/components/SidePanel/CustomAddOns/styles.scss +0 -86
- package/src/components/SidePanel/CustomBlockColors/index.tsx +0 -211
- package/src/components/SidePanel/CustomBlockColors/styles.scss +0 -80
- package/src/components/SidePanel/CustomFields/customFieldSection.tsx +0 -547
- package/src/components/SidePanel/CustomFields/styles.scss +0 -64
- package/src/components/SidePanel/CustomQRCode/V2/QRCodeModal/index.tsx +0 -172
- package/src/components/SidePanel/CustomQRCode/V2/QRCodeModal/styles.scss +0 -46
- package/src/components/SidePanel/CustomQRCode/index.tsx +0 -1070
- package/src/components/SidePanel/CustomQRCode/styles.scss +0 -149
- package/src/components/SidePanel/CustomUploads/V2/index.tsx +0 -542
- package/src/components/SidePanel/CustomUploads/V2/styles.scss +0 -267
- package/src/components/SidePanel/CustomUploads/index.tsx +0 -301
- package/src/components/SidePanel/Templates/ModalGallery/HireDesigner/index.tsx +0 -424
- package/src/components/SidePanel/Templates/ModalGallery/HireDesigner/styles.scss +0 -180
- package/src/components/SidePanel/Templates/ModalGallery/V2/index.tsx +0 -235
- package/src/components/SidePanel/Templates/ModalGallery/V2/styles.scss +0 -244
- package/src/components/SidePanel/Templates/ModalGallery/index.tsx +0 -231
- package/src/components/SidePanel/Templates/SideBarGallery/index.tsx +0 -233
- package/src/components/SidePanel/Templates/SideBarGallery/styles.scss +0 -152
- package/src/components/SidePanel/Templates/TemplatesCard/V2/index.tsx +0 -149
- package/src/components/SidePanel/Templates/TemplatesCard/V2/styles.scss +0 -156
- package/src/components/SidePanel/Templates/TemplatesCard/index.tsx +0 -160
- package/src/components/SidePanel/Templates/TemplatesCard/styles.scss +0 -98
- package/src/components/SidePanel/Templates/customTemplateSection.tsx +0 -793
- package/src/components/SidePanel/Templates/styles.scss +0 -244
- package/src/components/SidePanel/index.tsx +0 -160
- package/src/components/TemplateBuilder/index.tsx +0 -585
- package/src/components/TemplateBuilder/styles.scss +0 -100
- package/src/components/TemplateTypes/index.tsx +0 -96
- package/src/components/TemplateTypes/styles.scss +0 -91
- package/src/components/TopNavigation/ConfirmNavigateDialog/index.tsx +0 -81
- package/src/components/TopNavigation/ConfirmNavigateDialog/styles.scss +0 -123
- package/src/components/TopNavigation/DuplicateTemplateModal.tsx +0 -103
- package/src/components/TopNavigation/EditTemplateNameModel/index.tsx +0 -71
- package/src/components/TopNavigation/EditTemplateNameModel/styles.scss +0 -88
- package/src/components/TopNavigation/SaveTemplateModel/index.tsx +0 -201
- package/src/components/TopNavigation/SaveTemplateModel/styles.scss +0 -128
- package/src/components/TopNavigation/index.tsx +0 -938
- package/src/components/TopNavigation/styles.scss +0 -303
- package/src/importMeta.d.ts +0 -31
- package/src/index.scss +0 -131
- package/src/index.tsx +0 -238
- package/src/libs/test.ts +0 -7
- package/src/redux/actions/action-types.ts +0 -52
- package/src/redux/actions/customQRCodeActions.ts +0 -54
- package/src/redux/actions/snackbarActions.ts +0 -16
- package/src/redux/actions/templateActions.ts +0 -236
- package/src/redux/reducers/customFieldReducer.ts +0 -99
- package/src/redux/reducers/customQRCodeReducer.ts +0 -58
- package/src/redux/reducers/index.ts +0 -15
- package/src/redux/reducers/snackbarReducer.ts +0 -40
- package/src/redux/reducers/templateReducer.ts +0 -485
- package/src/redux/store.ts +0 -18
- package/src/styles/colors.scss +0 -61
- package/src/test/mocks.js +0 -89
- package/src/test/setupJest.js +0 -1
- package/src/utils/api.ts +0 -36
- package/src/utils/constants.ts +0 -182
- package/src/utils/customStyles.ts +0 -45
- package/src/utils/fetchWrapper.ts +0 -73
- package/src/utils/fonts.json +0 -1597
- package/src/utils/helper.ts +0 -205
- package/src/utils/local-storage.ts +0 -15
- package/src/utils/message.ts +0 -162
- package/src/utils/products.ts +0 -186
- package/src/utils/template-builder.ts +0 -328
- package/src/utils/templateIdentifierArea/biFold.ts +0 -107
- package/src/utils/templateIdentifierArea/index.ts +0 -35
- package/src/utils/templateIdentifierArea/personal.ts +0 -107
- package/src/utils/templateIdentifierArea/postCards.ts +0 -163
- package/src/utils/templateIdentifierArea/professional.ts +0 -125
- package/src/utils/templateIdentifierArea/snapPack.ts +0 -107
- package/src/utils/templateIdentifierArea/triFold.ts +0 -107
- package/src/utils/templateRestrictedArea/biFold.ts +0 -329
- package/src/utils/templateRestrictedArea/nonWindowProfessional.ts +0 -90
- package/src/utils/templateRestrictedArea/personal.ts +0 -90
- package/src/utils/templateRestrictedArea/postCard.ts +0 -334
- package/src/utils/templateRestrictedArea/postCardJumbo.tsx +0 -408
- package/src/utils/templateRestrictedArea/professional.ts +0 -318
- package/src/utils/templateRestrictedArea/realPenned.ts +0 -233
- package/src/utils/templateRestrictedArea/snapPack.ts +0 -1009
- package/src/utils/templateRestrictedArea/triFold.ts +0 -330
- package/src/utils/templateSafetyBorders/biFold.ts +0 -91
- package/src/utils/templateSafetyBorders/index.ts +0 -43
- package/src/utils/templateSafetyBorders/personal.ts +0 -41
- package/src/utils/templateSafetyBorders/postCards.ts +0 -259
- package/src/utils/templateSafetyBorders/professional.ts +0 -78
- package/src/utils/templateSafetyBorders/snapPack.ts +0 -165
- package/src/utils/templateSafetyBorders/triFold.ts +0 -114
- package/src/utils/templateSafetyBorders/types.d.ts +0 -68
- package/src/utils/types.ts +0 -12
- package/src/v2Theme.scss +0 -142
- package/tsconfig.json +0 -29
- package/tsconfig.node.json +0 -12
- package/update-version.js +0 -23
- package/version.js +0 -1
- package/vite.config.ts +0 -8
- package/webpack.config.js +0 -80
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import { useNavigate } from 'react-router-dom';
|
|
4
|
-
|
|
5
|
-
// UI Components
|
|
6
|
-
import Typography from '../GenericUIBlocks/Typography';
|
|
7
|
-
|
|
8
|
-
// images
|
|
9
|
-
//@ts-ignore
|
|
10
|
-
import Prebuilt from '../../assets/images/create-template/prebuilt.svg';
|
|
11
|
-
//@ts-ignore
|
|
12
|
-
import Scratch from '../../assets/images/create-template/scratch.svg';
|
|
13
|
-
|
|
14
|
-
// styles
|
|
15
|
-
import './styles.scss';
|
|
16
|
-
|
|
17
|
-
const textStyles = {
|
|
18
|
-
fontSize: '20px',
|
|
19
|
-
fontWeight: '600',
|
|
20
|
-
color: '#000000',
|
|
21
|
-
marginBottom: '12px',
|
|
22
|
-
lineHeight: '24px',
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
const descriptionStyles = {
|
|
26
|
-
fontSize: '16px',
|
|
27
|
-
fontWeight: '400',
|
|
28
|
-
color: '#898989',
|
|
29
|
-
width: '100%',
|
|
30
|
-
maxWidth: '254px',
|
|
31
|
-
margin: '0 auto',
|
|
32
|
-
lineHeight: '20px',
|
|
33
|
-
textAlign: 'center' as const,
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
const buttonStyles = {
|
|
37
|
-
width: '100%',
|
|
38
|
-
maxWidth: '157px',
|
|
39
|
-
height: '50px',
|
|
40
|
-
borderRadius: '8px',
|
|
41
|
-
fontSize: '16px',
|
|
42
|
-
fontWeight: '600',
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
interface TemplateTypesProps {
|
|
46
|
-
onReturnAndNavigate?: () => void;
|
|
47
|
-
createTemplateRoute?: string | null;
|
|
48
|
-
selectedTemplateType?: string | null;
|
|
49
|
-
setSelectedTemplateType?: any;
|
|
50
|
-
setTemplateTypeSelected?: any;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
const TemplateTypes: React.FC<TemplateTypesProps> = ({ selectedTemplateType, setSelectedTemplateType, createTemplateRoute, setTemplateTypeSelected, onReturnAndNavigate }) => {
|
|
54
|
-
|
|
55
|
-
const navigate = useNavigate();
|
|
56
|
-
|
|
57
|
-
const handleCardClick = (card: string) => {
|
|
58
|
-
setSelectedTemplateType(card);
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
return (
|
|
62
|
-
<div className="create-template-new">
|
|
63
|
-
<Typography style={textStyles}>Create New Template</Typography>
|
|
64
|
-
<div className="cards-container">
|
|
65
|
-
<div
|
|
66
|
-
className={`card ${selectedTemplateType === 'prebuilt' ? 'active' : ''}`}
|
|
67
|
-
onClick={() => handleCardClick('prebuilt')}
|
|
68
|
-
>
|
|
69
|
-
<img src={Prebuilt} alt="Prebuilt" />
|
|
70
|
-
<Typography style={textStyles}>Start From Prebuilt</Typography>
|
|
71
|
-
<Typography style={descriptionStyles}>
|
|
72
|
-
Browse a gallery of predesigned templates to customize
|
|
73
|
-
</Typography>
|
|
74
|
-
</div>
|
|
75
|
-
<div
|
|
76
|
-
className={`card ${selectedTemplateType === 'scratch' ? 'active' : ''}`}
|
|
77
|
-
onClick={() => handleCardClick('scratch')}
|
|
78
|
-
>
|
|
79
|
-
<img src={Scratch} alt="Scratch" />
|
|
80
|
-
<Typography style={textStyles}>Build from Scratch</Typography>
|
|
81
|
-
<Typography style={descriptionStyles}>
|
|
82
|
-
Choose a product type
|
|
83
|
-
<br />
|
|
84
|
-
and start with a blank canvas
|
|
85
|
-
</Typography>
|
|
86
|
-
</div>
|
|
87
|
-
</div>
|
|
88
|
-
<div className="buttons-container">
|
|
89
|
-
<button disabled={!selectedTemplateType} onClick={() => setTemplateTypeSelected(true)}>Next</button>
|
|
90
|
-
<button onClick={() => onReturnAndNavigate ? onReturnAndNavigate() : navigate(createTemplateRoute || '/create-template')}>Cancel</button>
|
|
91
|
-
</div>
|
|
92
|
-
</div>
|
|
93
|
-
);
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
export default TemplateTypes;
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
.create-template-new{
|
|
2
|
-
margin: 0;
|
|
3
|
-
padding: 0 40px;
|
|
4
|
-
position: relative;
|
|
5
|
-
height: calc(100vh - 10px);
|
|
6
|
-
|
|
7
|
-
.cards-container{
|
|
8
|
-
display: flex;
|
|
9
|
-
flex-direction: row;
|
|
10
|
-
align-items: center;
|
|
11
|
-
gap: 40px;
|
|
12
|
-
flex-wrap: wrap;
|
|
13
|
-
|
|
14
|
-
.card{
|
|
15
|
-
width: 450px;
|
|
16
|
-
height: 282px;
|
|
17
|
-
border-radius: 20px;
|
|
18
|
-
border: 0.5px solid #00000029;
|
|
19
|
-
background-color: var(--card-background-color);
|
|
20
|
-
display: flex;
|
|
21
|
-
flex-direction: column;
|
|
22
|
-
align-items: center;
|
|
23
|
-
justify-content: center;
|
|
24
|
-
cursor: pointer;
|
|
25
|
-
margin-top: 24px;
|
|
26
|
-
|
|
27
|
-
img{
|
|
28
|
-
margin-bottom: 16px;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
&:hover, &.active {
|
|
32
|
-
border-color: var(--primary-color);
|
|
33
|
-
background-color: var(--primary-color-hover);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.buttons-container{
|
|
39
|
-
position: fixed;
|
|
40
|
-
bottom: 0;
|
|
41
|
-
left: 0;
|
|
42
|
-
right: 0;
|
|
43
|
-
display: flex;
|
|
44
|
-
flex-direction: row;
|
|
45
|
-
align-items: center;
|
|
46
|
-
justify-content: flex-end;
|
|
47
|
-
gap: 12px;
|
|
48
|
-
margin-top: 24px;
|
|
49
|
-
border-top: 0.5px solid var(--border-color);
|
|
50
|
-
padding: 24px 40px;
|
|
51
|
-
|
|
52
|
-
button{
|
|
53
|
-
width: 100%;
|
|
54
|
-
max-width: 157px;
|
|
55
|
-
height: 50px;
|
|
56
|
-
border-radius: 8px;
|
|
57
|
-
font-size: 16px;
|
|
58
|
-
font-weight: 600;
|
|
59
|
-
background-color: var(--primary-color);
|
|
60
|
-
color: var(--notification-text-color);
|
|
61
|
-
border: none;
|
|
62
|
-
cursor: pointer;
|
|
63
|
-
transition: all 0.3s ease;
|
|
64
|
-
|
|
65
|
-
&:disabled{
|
|
66
|
-
opacity: 0.5;
|
|
67
|
-
cursor: not-allowed;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
&:focus{
|
|
71
|
-
outline: none;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
&:hover{
|
|
75
|
-
background-color: #DD5026;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
&:last-child{
|
|
79
|
-
background-color: var(--secondary-color);
|
|
80
|
-
color: var(--text-color);
|
|
81
|
-
border: 0.5px solid var(--secondary-color);
|
|
82
|
-
|
|
83
|
-
&:hover{
|
|
84
|
-
background-color: #fff;
|
|
85
|
-
border: 0.5px solid #00000029;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
}
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
|
|
3
|
-
// Utils
|
|
4
|
-
import { MESSAGES } from "../../../utils/message";
|
|
5
|
-
|
|
6
|
-
// Components
|
|
7
|
-
import Dialog from '../../GenericUIBlocks/Dialog';
|
|
8
|
-
import DialogV2 from '../../GenericUIBlocks/Dialog/V2';
|
|
9
|
-
|
|
10
|
-
// images
|
|
11
|
-
import ModalCross from '../../../assets/images/modal-icons/modal-cross';
|
|
12
|
-
import ConfirmCloseIcon from '../../../assets/images/modal-icons/confirm-close-icon';
|
|
13
|
-
|
|
14
|
-
// Styles
|
|
15
|
-
import "./styles.scss";
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* ConfirmNavigateDialog Component
|
|
19
|
-
* A modal for duplicating a template.
|
|
20
|
-
*
|
|
21
|
-
* @param {boolean} open - Boolean indicating whether the modal is open.
|
|
22
|
-
* @param {Function} handleClose - Function to handle the closing of the modal.
|
|
23
|
-
* @returns {JSX.Element} The duplicate template modal component.
|
|
24
|
-
*
|
|
25
|
-
*/
|
|
26
|
-
|
|
27
|
-
const cancelDialogStyles = {
|
|
28
|
-
maxWidth: '407px',
|
|
29
|
-
minHeight: '258px',
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
const cancelDialogStylesV2 = {
|
|
33
|
-
maxWidth: '567px',
|
|
34
|
-
minHeight: '303px',
|
|
35
|
-
padding: '40px',
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
// Define the props type
|
|
39
|
-
interface ConfirmNavigateDialogProps {
|
|
40
|
-
open: boolean;
|
|
41
|
-
currentTheme?: string | null | undefined;
|
|
42
|
-
handleClose: () => void;
|
|
43
|
-
handleNavigateAction: () => void;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
const ConfirmNavigateDialog: React.FC<ConfirmNavigateDialogProps> = ({ open, currentTheme, handleClose, handleNavigateAction }) => {
|
|
48
|
-
return (
|
|
49
|
-
currentTheme === 'v2' ?
|
|
50
|
-
<DialogV2
|
|
51
|
-
icon={<ConfirmCloseIcon fill='var(--primary-color)' />}
|
|
52
|
-
customStyles={cancelDialogStylesV2}
|
|
53
|
-
open={open}
|
|
54
|
-
handleClose={handleClose}
|
|
55
|
-
title='Confirm Cancel'
|
|
56
|
-
subHeading=''
|
|
57
|
-
description='Are you sure you want to cancel creating this template? All unsaved changes will be lost.'
|
|
58
|
-
onSubmit={handleNavigateAction}
|
|
59
|
-
onCancel={handleClose}
|
|
60
|
-
cancelText='No'
|
|
61
|
-
submitText='Yes'
|
|
62
|
-
isGallery={false}
|
|
63
|
-
/> :
|
|
64
|
-
<Dialog
|
|
65
|
-
icon={<ModalCross />}
|
|
66
|
-
customStyles={cancelDialogStyles}
|
|
67
|
-
open={open}
|
|
68
|
-
handleClose={handleClose}
|
|
69
|
-
title={MESSAGES.TEMPLATE.CANCEL.TITLE}
|
|
70
|
-
subHeading={MESSAGES.TEMPLATE.CANCEL.HEADING}
|
|
71
|
-
description={MESSAGES.TEMPLATE.CANCEL.PARAGRAPH}
|
|
72
|
-
onSubmit={handleNavigateAction}
|
|
73
|
-
onCancel={handleClose}
|
|
74
|
-
cancelText={MESSAGES.TEMPLATE.CANCEL.BACK_BUTTON}
|
|
75
|
-
submitText={MESSAGES.TEMPLATE.CANCEL.CANCEL_BUTTON}
|
|
76
|
-
/>
|
|
77
|
-
|
|
78
|
-
);
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
export default ConfirmNavigateDialog;
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
.confirmCancelTemplateLeaveModal {
|
|
2
|
-
.MuiPaper-root {
|
|
3
|
-
width: 100% !important;
|
|
4
|
-
max-width: 407px !important;
|
|
5
|
-
height: 100% !important;
|
|
6
|
-
max-height: 258px !important;
|
|
7
|
-
margin: 0 auto !important;
|
|
8
|
-
border-radius: 11px;
|
|
9
|
-
background: #fff8ee;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
.confirmTemplateLeaveModalTitle {
|
|
13
|
-
color: #ed5c2f;
|
|
14
|
-
text-align: center;
|
|
15
|
-
font-size: 22px;
|
|
16
|
-
font-style: normal;
|
|
17
|
-
font-weight: 700;
|
|
18
|
-
line-height: normal;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.confirmTemplateLeaveModalContent {
|
|
22
|
-
display: flex;
|
|
23
|
-
flex-direction: column;
|
|
24
|
-
gap: 10px;
|
|
25
|
-
padding: 16px 16px 0px 16px !important;
|
|
26
|
-
|
|
27
|
-
.trashIconWrapper {
|
|
28
|
-
text-align: center;
|
|
29
|
-
|
|
30
|
-
p {
|
|
31
|
-
color: #ed5c2f;
|
|
32
|
-
text-align: center;
|
|
33
|
-
font-size: 22px;
|
|
34
|
-
font-style: normal;
|
|
35
|
-
font-weight: 700;
|
|
36
|
-
line-height: normal;
|
|
37
|
-
margin-top: 12px;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.confirmTemplateLeaveText {
|
|
42
|
-
display: flex;
|
|
43
|
-
flex-direction: column;
|
|
44
|
-
justify-content: center;
|
|
45
|
-
align-items: center;
|
|
46
|
-
gap: 10px;
|
|
47
|
-
|
|
48
|
-
p {
|
|
49
|
-
color: #000;
|
|
50
|
-
text-align: center;
|
|
51
|
-
font-size: 16px;
|
|
52
|
-
font-style: normal;
|
|
53
|
-
font-weight: 600;
|
|
54
|
-
line-height: normal;
|
|
55
|
-
|
|
56
|
-
&:last-child {
|
|
57
|
-
color: #000;
|
|
58
|
-
text-align: center;
|
|
59
|
-
font-size: 14px;
|
|
60
|
-
font-style: normal;
|
|
61
|
-
font-weight: 400;
|
|
62
|
-
line-height: 16px;
|
|
63
|
-
/* 114.286% */
|
|
64
|
-
letter-spacing: 0.28px;
|
|
65
|
-
margin: 0;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
.MuiInputBase-root {
|
|
71
|
-
border-radius: 7px;
|
|
72
|
-
border: 0.5px solid #303030;
|
|
73
|
-
background: #fff;
|
|
74
|
-
width: 100%;
|
|
75
|
-
padding: 10px 22px;
|
|
76
|
-
|
|
77
|
-
&:focus,
|
|
78
|
-
&:focus-visible {
|
|
79
|
-
outline: none !important;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
&::after,
|
|
83
|
-
&::before {
|
|
84
|
-
display: none !important;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
.actionBtns {
|
|
90
|
-
justify-content: center;
|
|
91
|
-
align-items: center;
|
|
92
|
-
margin-bottom: 13px;
|
|
93
|
-
gap: 11px;
|
|
94
|
-
|
|
95
|
-
button {
|
|
96
|
-
border-radius: 3px !important;
|
|
97
|
-
text-transform: capitalize;
|
|
98
|
-
|
|
99
|
-
&:first-child {
|
|
100
|
-
border: 0.5px solid rgba(48, 48, 48, 0.5);
|
|
101
|
-
background: #fff;
|
|
102
|
-
color: #000;
|
|
103
|
-
font-size: 14px;
|
|
104
|
-
font-style: normal;
|
|
105
|
-
font-weight: 600;
|
|
106
|
-
line-height: normal;
|
|
107
|
-
min-width: 100px !important;
|
|
108
|
-
min-height: 40px !important;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
&:last-child {
|
|
112
|
-
color: #fff;
|
|
113
|
-
font-size: 14px;
|
|
114
|
-
font-style: normal;
|
|
115
|
-
font-weight: 600;
|
|
116
|
-
line-height: normal;
|
|
117
|
-
background: #ed5c2f;
|
|
118
|
-
max-width: 146px !important;
|
|
119
|
-
min-height: 40px !important;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
}
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
2
|
-
import { useDispatch } from 'react-redux';
|
|
3
|
-
import { AppDispatch } from '../../redux/store';
|
|
4
|
-
|
|
5
|
-
// Actions
|
|
6
|
-
import { failure } from '../../redux/actions/snackbarActions';
|
|
7
|
-
|
|
8
|
-
// Utils
|
|
9
|
-
import { MESSAGES } from '../../utils/message';
|
|
10
|
-
|
|
11
|
-
// UI Blocks
|
|
12
|
-
import Dialog from '../GenericUIBlocks/Dialog';
|
|
13
|
-
import Input from '../GenericUIBlocks/Input';
|
|
14
|
-
|
|
15
|
-
interface DuplicateTemplateModalProps {
|
|
16
|
-
open: boolean;
|
|
17
|
-
value: string;
|
|
18
|
-
setIsDuplication: any;
|
|
19
|
-
onChange: (value: string) => void;
|
|
20
|
-
onCancel: () => void;
|
|
21
|
-
onDuplicateTemplate?: (payload: any) => Promise<any>;
|
|
22
|
-
title: string;
|
|
23
|
-
submitButtonText: string;
|
|
24
|
-
icon: React.ReactNode;
|
|
25
|
-
error: string;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
const DuplicateTemplateModal: React.FC<DuplicateTemplateModalProps> = ({
|
|
29
|
-
open,
|
|
30
|
-
value,
|
|
31
|
-
setIsDuplication,
|
|
32
|
-
onChange,
|
|
33
|
-
onCancel,
|
|
34
|
-
onDuplicateTemplate,
|
|
35
|
-
title,
|
|
36
|
-
submitButtonText,
|
|
37
|
-
icon,
|
|
38
|
-
error,
|
|
39
|
-
}) => {
|
|
40
|
-
if (!open) return null;
|
|
41
|
-
|
|
42
|
-
const saveDialogStyles = {
|
|
43
|
-
maxWidth: '480px',
|
|
44
|
-
minHeight: error ? '350px' : '329px',
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
const noteStyle = {
|
|
48
|
-
fontSize: '12px',
|
|
49
|
-
color: "#000",
|
|
50
|
-
fontWeight: '400',
|
|
51
|
-
marginTop: '7px',
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
const [loader, setLoader] = useState(false);
|
|
55
|
-
|
|
56
|
-
const dispatch: AppDispatch = useDispatch();
|
|
57
|
-
|
|
58
|
-
const duplicateTemplate = async () => {
|
|
59
|
-
try {
|
|
60
|
-
setLoader(true);
|
|
61
|
-
if (onDuplicateTemplate) {
|
|
62
|
-
setIsDuplication(true);
|
|
63
|
-
await onDuplicateTemplate(value);
|
|
64
|
-
onCancel();
|
|
65
|
-
}
|
|
66
|
-
} catch (error) {
|
|
67
|
-
dispatch(failure(MESSAGES.CLONE_ERROR));
|
|
68
|
-
return error;
|
|
69
|
-
} finally {
|
|
70
|
-
setLoader(false);
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
return (
|
|
75
|
-
<Dialog
|
|
76
|
-
icon={icon}
|
|
77
|
-
loading={loader}
|
|
78
|
-
open={open}
|
|
79
|
-
handleClose={onCancel}
|
|
80
|
-
title={title}
|
|
81
|
-
cancelText={MESSAGES.TEMPLATE.SAVE.CANCEL_BUTTON}
|
|
82
|
-
submitText={submitButtonText}
|
|
83
|
-
customStyles={saveDialogStyles}
|
|
84
|
-
onSubmit={duplicateTemplate}
|
|
85
|
-
onCancel={onCancel}
|
|
86
|
-
subHeading={MESSAGES.TEMPLATE.DUPLICATE_MODAL.SUB_HEADING}
|
|
87
|
-
children={
|
|
88
|
-
<div style={{ width: '100%' }}>
|
|
89
|
-
<Input
|
|
90
|
-
type="text"
|
|
91
|
-
placeholder={MESSAGES.TEMPLATE.DUPLICATE_MODAL.NAME_PLACEHOLDER}
|
|
92
|
-
value={value}
|
|
93
|
-
error={error}
|
|
94
|
-
onChange={(e) => onChange(e.target.value)}
|
|
95
|
-
/>
|
|
96
|
-
<div style={noteStyle}>{MESSAGES.TEMPLATE.DUPLICATE_MODAL.NOTE}</div>
|
|
97
|
-
</div>
|
|
98
|
-
}
|
|
99
|
-
/>
|
|
100
|
-
);
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
export default DuplicateTemplateModal;
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
// Utils
|
|
4
|
-
import { MESSAGES } from '../../../utils/message';
|
|
5
|
-
|
|
6
|
-
// UI Components
|
|
7
|
-
import Dialog from '../../../components/GenericUIBlocks/Dialog';
|
|
8
|
-
import Input from '../../../components/GenericUIBlocks/Input';
|
|
9
|
-
|
|
10
|
-
// Styles
|
|
11
|
-
import './styles.scss';
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* EditTemplateNameModel Component
|
|
16
|
-
* A modal for duplicating a template.
|
|
17
|
-
*
|
|
18
|
-
* @param {boolean} open - Boolean indicating whether the modal is open.
|
|
19
|
-
* @param {Function} handleClose - Function to handle the closing of the modal.
|
|
20
|
-
* @returns {JSX.Element} The duplicate template modal component.
|
|
21
|
-
*
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
|
-
interface EditTemplateNameModelProps {
|
|
25
|
-
open: boolean;
|
|
26
|
-
title: string,
|
|
27
|
-
setTemplateTitle: any,
|
|
28
|
-
handleEditName: any;
|
|
29
|
-
templateTitle: string,
|
|
30
|
-
handleClose: () => void;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
const editDialogStyles = {
|
|
34
|
-
maxWidth: '630px',
|
|
35
|
-
minHeight: '210px',
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
const EditTemplateNameModel: React.FC<EditTemplateNameModelProps> = ({
|
|
39
|
-
open,
|
|
40
|
-
title,
|
|
41
|
-
templateTitle,
|
|
42
|
-
setTemplateTitle,
|
|
43
|
-
handleEditName,
|
|
44
|
-
handleClose,
|
|
45
|
-
}) => {
|
|
46
|
-
return (
|
|
47
|
-
<Dialog
|
|
48
|
-
open={open}
|
|
49
|
-
loading={false}
|
|
50
|
-
handleClose={handleClose}
|
|
51
|
-
title="Edit Template Name"
|
|
52
|
-
cancelText={MESSAGES.TEMPLATE.SAVE.CANCEL_BUTTON}
|
|
53
|
-
submitText="Save"
|
|
54
|
-
customStyles={editDialogStyles}
|
|
55
|
-
onSubmit={handleEditName}
|
|
56
|
-
onCancel={handleClose}
|
|
57
|
-
>
|
|
58
|
-
<Input
|
|
59
|
-
variant="input"
|
|
60
|
-
type="text"
|
|
61
|
-
label="Template Name"
|
|
62
|
-
placeholder="Holidays"
|
|
63
|
-
value={templateTitle}
|
|
64
|
-
onChange={e => setTemplateTitle(e.target.value)}
|
|
65
|
-
/>
|
|
66
|
-
</Dialog>
|
|
67
|
-
);
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
export default EditTemplateNameModel;
|
|
71
|
-
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
.editTemplateNameModal {
|
|
2
|
-
.MuiPaper-root {
|
|
3
|
-
width: 100% !important;
|
|
4
|
-
max-width: 623px !important;
|
|
5
|
-
height: 100% !important;
|
|
6
|
-
max-height: 230px !important;
|
|
7
|
-
margin: 0 auto !important;
|
|
8
|
-
border-radius: 11px;
|
|
9
|
-
background: #fff8ee;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
.editTemplateNameModalTitle {
|
|
13
|
-
color: #ed5c2f;
|
|
14
|
-
text-align: center;
|
|
15
|
-
font-size: 22px;
|
|
16
|
-
font-style: normal;
|
|
17
|
-
font-weight: 700;
|
|
18
|
-
line-height: normal;
|
|
19
|
-
padding: 16px 16px 0px !important;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.editTemplateNameModalContent {
|
|
23
|
-
padding: 0px 30px !important;
|
|
24
|
-
|
|
25
|
-
p {
|
|
26
|
-
color: #303030;
|
|
27
|
-
font-size: 14px;
|
|
28
|
-
font-style: normal;
|
|
29
|
-
font-weight: 400;
|
|
30
|
-
line-height: normal;
|
|
31
|
-
margin: 10px 0px 10px 0px;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.MuiInputBase-root {
|
|
35
|
-
border-radius: 7px;
|
|
36
|
-
border: 0.5px solid #303030;
|
|
37
|
-
background: #fff;
|
|
38
|
-
width: 100%;
|
|
39
|
-
padding: 9.8px 22px;
|
|
40
|
-
|
|
41
|
-
&:focus,
|
|
42
|
-
&:focus-visible {
|
|
43
|
-
outline: none !important;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
&::after,
|
|
47
|
-
&::before {
|
|
48
|
-
display: none !important;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.actionBtns {
|
|
54
|
-
justify-content: center;
|
|
55
|
-
align-items: center;
|
|
56
|
-
margin: 20px 0px;
|
|
57
|
-
gap: 20px;
|
|
58
|
-
|
|
59
|
-
button {
|
|
60
|
-
border-radius: 5px;
|
|
61
|
-
text-transform: capitalize;
|
|
62
|
-
width: 100%;
|
|
63
|
-
max-width: 107px;
|
|
64
|
-
height: 100%;
|
|
65
|
-
min-height: 41px;
|
|
66
|
-
|
|
67
|
-
&:first-child {
|
|
68
|
-
border: 0.5px solid rgba(48, 48, 48, 0.5);
|
|
69
|
-
background: #fff;
|
|
70
|
-
color: #000;
|
|
71
|
-
font-size: 16px;
|
|
72
|
-
font-style: normal;
|
|
73
|
-
font-weight: 600;
|
|
74
|
-
line-height: normal;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
&:last-child {
|
|
78
|
-
color: #fff;
|
|
79
|
-
font-size: 16px;
|
|
80
|
-
font-style: normal;
|
|
81
|
-
font-weight: 600;
|
|
82
|
-
line-height: normal;
|
|
83
|
-
background: #ed5c2f;
|
|
84
|
-
margin: 0;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}
|