@openlettermarketing/olc-react-sdk 2.1.7 → 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.
Files changed (230) hide show
  1. package/build/index.js +1 -1
  2. package/build/index.js.map +1 -1
  3. package/build/types/version.d.ts +1 -1
  4. package/package.json +7 -6
  5. package/.eslintignore +0 -1
  6. package/.eslintrc.cjs +0 -18
  7. package/.eslintrc.yml +0 -47
  8. package/.github/workflows/publish-beta.yml +0 -154
  9. package/.github/workflows/publish-production.yml +0 -143
  10. package/.prettierignore +0 -3
  11. package/.prettierrc.yml +0 -5
  12. package/CHANGELOG.md +0 -4
  13. package/babel.config.json +0 -10
  14. package/examples/.eslintrc.yml +0 -4
  15. package/index.html +0 -18
  16. package/public/vite.svg +0 -1
  17. package/src/App.tsx +0 -209
  18. package/src/assets/Fonts/Lexi-Regular.ttf +0 -0
  19. package/src/assets/images/create-template/prebuilt.svg +0 -13
  20. package/src/assets/images/create-template/scratch.svg +0 -4
  21. package/src/assets/images/input/cancel.tsx +0 -20
  22. package/src/assets/images/input/search.tsx +0 -20
  23. package/src/assets/images/input/select-cancel.tsx +0 -17
  24. package/src/assets/images/modal-icons/add.tsx +0 -36
  25. package/src/assets/images/modal-icons/cancel-file.tsx +0 -12
  26. package/src/assets/images/modal-icons/cancel-input.tsx +0 -13
  27. package/src/assets/images/modal-icons/cancel.tsx +0 -35
  28. package/src/assets/images/modal-icons/close-new.svg +0 -3
  29. package/src/assets/images/modal-icons/confirm-close-icon.tsx +0 -14
  30. package/src/assets/images/modal-icons/confirm-new.tsx +0 -22
  31. package/src/assets/images/modal-icons/confirm.svg +0 -12
  32. package/src/assets/images/modal-icons/cross.tsx +0 -23
  33. package/src/assets/images/modal-icons/del.tsx +0 -19
  34. package/src/assets/images/modal-icons/design-icon.tsx +0 -22
  35. package/src/assets/images/modal-icons/doc.tsx +0 -43
  36. package/src/assets/images/modal-icons/docx.tsx +0 -43
  37. package/src/assets/images/modal-icons/envelope-icon.tsx +0 -26
  38. package/src/assets/images/modal-icons/info.tsx +0 -19
  39. package/src/assets/images/modal-icons/jpeg.tsx +0 -43
  40. package/src/assets/images/modal-icons/jpg.tsx +0 -43
  41. package/src/assets/images/modal-icons/modal-cros.svg +0 -4
  42. package/src/assets/images/modal-icons/modal-cross.tsx +0 -37
  43. package/src/assets/images/modal-icons/new-cancel.tsx +0 -11
  44. package/src/assets/images/modal-icons/order-download.tsx +0 -42
  45. package/src/assets/images/modal-icons/pdf.tsx +0 -51
  46. package/src/assets/images/modal-icons/png.tsx +0 -43
  47. package/src/assets/images/modal-icons/save.tsx +0 -23
  48. package/src/assets/images/modal-icons/template-copy.tsx +0 -25
  49. package/src/assets/images/modal-icons/tool-cancel.tsx +0 -25
  50. package/src/assets/images/products/bi-new.svg +0 -23
  51. package/src/assets/images/products/left-arrow.svg +0 -17
  52. package/src/assets/images/products/personal-new.tsx +0 -31
  53. package/src/assets/images/products/postcard-new.tsx +0 -27
  54. package/src/assets/images/products/professional-new.tsx +0 -24
  55. package/src/assets/images/products/real-new.tsx +0 -30
  56. package/src/assets/images/products/right-arrow.svg +0 -17
  57. package/src/assets/images/products/snap-new.svg +0 -31
  58. package/src/assets/images/templates/actions.svg +0 -3
  59. package/src/assets/images/templates/address-block-icon.tsx +0 -62
  60. package/src/assets/images/templates/archive.svg +0 -3
  61. package/src/assets/images/templates/arrow-down.tsx +0 -27
  62. package/src/assets/images/templates/back-arrow.tsx +0 -19
  63. package/src/assets/images/templates/bi-fold-self-mailers.tsx +0 -28
  64. package/src/assets/images/templates/check.svg +0 -3
  65. package/src/assets/images/templates/code.svg +0 -10
  66. package/src/assets/images/templates/content-copy-icon.tsx +0 -24
  67. package/src/assets/images/templates/custom-add-on-icon.tsx +0 -18
  68. package/src/assets/images/templates/custom-qr-section-icon.tsx +0 -9
  69. package/src/assets/images/templates/custom-template.tsx +0 -23
  70. package/src/assets/images/templates/designer.tsx +0 -43
  71. package/src/assets/images/templates/dot.tsx +0 -22
  72. package/src/assets/images/templates/download-v2.svg +0 -4
  73. package/src/assets/images/templates/download.svg +0 -4
  74. package/src/assets/images/templates/dummy-template.tsx +0 -76
  75. package/src/assets/images/templates/dynamic-field.tsx +0 -119
  76. package/src/assets/images/templates/edit-pencil-icon.tsx +0 -21
  77. package/src/assets/images/templates/edit.svg +0 -3
  78. package/src/assets/images/templates/epo-icon.tsx +0 -16
  79. package/src/assets/images/templates/field.tsx +0 -29
  80. package/src/assets/images/templates/gsv-icon.tsx +0 -31
  81. package/src/assets/images/templates/info-icon.tsx +0 -37
  82. package/src/assets/images/templates/left-arrow.svg +0 -17
  83. package/src/assets/images/templates/pencil.svg +0 -3
  84. package/src/assets/images/templates/personal-letter.tsx +0 -53
  85. package/src/assets/images/templates/postcard.tsx +0 -32
  86. package/src/assets/images/templates/professional-letter.tsx +0 -53
  87. package/src/assets/images/templates/qr-code.tsx +0 -13
  88. package/src/assets/images/templates/real-penned-letters.tsx +0 -57
  89. package/src/assets/images/templates/right-arrow.svg +0 -17
  90. package/src/assets/images/templates/size-image-lg.tsx +0 -20
  91. package/src/assets/images/templates/size-image-mid.tsx +0 -20
  92. package/src/assets/images/templates/size-image-xl.tsx +0 -20
  93. package/src/assets/images/templates/size-image.tsx +0 -20
  94. package/src/assets/images/templates/snap-pack.tsx +0 -67
  95. package/src/assets/images/templates/template-default-design.tsx +0 -21
  96. package/src/assets/images/templates/trash-upload.svg +0 -3
  97. package/src/assets/images/templates/trash.svg +0 -3
  98. package/src/assets/images/templates/tri-fold-self-mailers.tsx +0 -93
  99. package/src/assets/images/templates/upload-image.svg +0 -10
  100. package/src/assets/images/templates/x.svg +0 -3
  101. package/src/assets/images/thumbnails/one.svg +0 -9
  102. package/src/assets/images/tooltip/tool-arrow.tsx +0 -25
  103. package/src/components/CreateTemplate/V2/index.tsx +0 -527
  104. package/src/components/CreateTemplate/V2/styles.scss +0 -372
  105. package/src/components/CreateTemplate/index.tsx +0 -508
  106. package/src/components/CreateTemplate/styles.scss +0 -404
  107. package/src/components/GenericUIBlocks/Button/index.tsx +0 -54
  108. package/src/components/GenericUIBlocks/Button/styles.scss +0 -43
  109. package/src/components/GenericUIBlocks/CircularProgress/index.tsx +0 -18
  110. package/src/components/GenericUIBlocks/CircularProgress/styles.scss +0 -93
  111. package/src/components/GenericUIBlocks/CustomTooltip/index.tsx +0 -88
  112. package/src/components/GenericUIBlocks/CustomTooltip/styles.scss +0 -19
  113. package/src/components/GenericUIBlocks/Dialog/V2/index.tsx +0 -227
  114. package/src/components/GenericUIBlocks/Dialog/V2/styles.scss +0 -289
  115. package/src/components/GenericUIBlocks/Dialog/index.tsx +0 -185
  116. package/src/components/GenericUIBlocks/Dialog/styles.scss +0 -227
  117. package/src/components/GenericUIBlocks/Divider/index.tsx +0 -12
  118. package/src/components/GenericUIBlocks/Divider/styles.scss +0 -7
  119. package/src/components/GenericUIBlocks/GeneralSelect/index.tsx +0 -114
  120. package/src/components/GenericUIBlocks/GeneralSelect/styles.scss +0 -406
  121. package/src/components/GenericUIBlocks/GeneralTooltip/index.tsx +0 -25
  122. package/src/components/GenericUIBlocks/GeneralTooltip/styles.scss +0 -20
  123. package/src/components/GenericUIBlocks/GenericSnackbar/Toast/index.tsx +0 -91
  124. package/src/components/GenericUIBlocks/GenericSnackbar/Toast/styles.scss +0 -92
  125. package/src/components/GenericUIBlocks/Grid/index.tsx +0 -82
  126. package/src/components/GenericUIBlocks/Input/index.tsx +0 -269
  127. package/src/components/GenericUIBlocks/Input/styles.scss +0 -332
  128. package/src/components/GenericUIBlocks/Tabs/index.tsx +0 -71
  129. package/src/components/GenericUIBlocks/Tabs/styles.scss +0 -42
  130. package/src/components/GenericUIBlocks/Typography/index.tsx +0 -18
  131. package/src/components/GenericUIBlocks/Typography/styles.scss +0 -27
  132. package/src/components/SidePanel/CustomAddOns/index.tsx +0 -342
  133. package/src/components/SidePanel/CustomAddOns/styles.scss +0 -86
  134. package/src/components/SidePanel/CustomBlockColors/index.tsx +0 -211
  135. package/src/components/SidePanel/CustomBlockColors/styles.scss +0 -80
  136. package/src/components/SidePanel/CustomFields/customFieldSection.tsx +0 -547
  137. package/src/components/SidePanel/CustomFields/styles.scss +0 -64
  138. package/src/components/SidePanel/CustomQRCode/V2/QRCodeModal/index.tsx +0 -172
  139. package/src/components/SidePanel/CustomQRCode/V2/QRCodeModal/styles.scss +0 -46
  140. package/src/components/SidePanel/CustomQRCode/index.tsx +0 -1070
  141. package/src/components/SidePanel/CustomQRCode/styles.scss +0 -149
  142. package/src/components/SidePanel/CustomUploads/V2/index.tsx +0 -542
  143. package/src/components/SidePanel/CustomUploads/V2/styles.scss +0 -267
  144. package/src/components/SidePanel/CustomUploads/index.tsx +0 -301
  145. package/src/components/SidePanel/Templates/ModalGallery/HireDesigner/index.tsx +0 -424
  146. package/src/components/SidePanel/Templates/ModalGallery/HireDesigner/styles.scss +0 -180
  147. package/src/components/SidePanel/Templates/ModalGallery/V2/index.tsx +0 -235
  148. package/src/components/SidePanel/Templates/ModalGallery/V2/styles.scss +0 -244
  149. package/src/components/SidePanel/Templates/ModalGallery/index.tsx +0 -231
  150. package/src/components/SidePanel/Templates/SideBarGallery/index.tsx +0 -233
  151. package/src/components/SidePanel/Templates/SideBarGallery/styles.scss +0 -152
  152. package/src/components/SidePanel/Templates/TemplatesCard/V2/index.tsx +0 -149
  153. package/src/components/SidePanel/Templates/TemplatesCard/V2/styles.scss +0 -156
  154. package/src/components/SidePanel/Templates/TemplatesCard/index.tsx +0 -160
  155. package/src/components/SidePanel/Templates/TemplatesCard/styles.scss +0 -98
  156. package/src/components/SidePanel/Templates/customTemplateSection.tsx +0 -793
  157. package/src/components/SidePanel/Templates/styles.scss +0 -244
  158. package/src/components/SidePanel/index.tsx +0 -160
  159. package/src/components/TemplateBuilder/index.tsx +0 -585
  160. package/src/components/TemplateBuilder/styles.scss +0 -100
  161. package/src/components/TemplateTypes/index.tsx +0 -96
  162. package/src/components/TemplateTypes/styles.scss +0 -91
  163. package/src/components/TopNavigation/ConfirmNavigateDialog/index.tsx +0 -81
  164. package/src/components/TopNavigation/ConfirmNavigateDialog/styles.scss +0 -123
  165. package/src/components/TopNavigation/DuplicateTemplateModal.tsx +0 -103
  166. package/src/components/TopNavigation/EditTemplateNameModel/index.tsx +0 -71
  167. package/src/components/TopNavigation/EditTemplateNameModel/styles.scss +0 -88
  168. package/src/components/TopNavigation/SaveTemplateModel/index.tsx +0 -201
  169. package/src/components/TopNavigation/SaveTemplateModel/styles.scss +0 -128
  170. package/src/components/TopNavigation/index.tsx +0 -938
  171. package/src/components/TopNavigation/styles.scss +0 -303
  172. package/src/importMeta.d.ts +0 -31
  173. package/src/index.scss +0 -131
  174. package/src/index.tsx +0 -238
  175. package/src/libs/test.ts +0 -7
  176. package/src/redux/actions/action-types.ts +0 -52
  177. package/src/redux/actions/customQRCodeActions.ts +0 -54
  178. package/src/redux/actions/snackbarActions.ts +0 -16
  179. package/src/redux/actions/templateActions.ts +0 -236
  180. package/src/redux/reducers/customFieldReducer.ts +0 -99
  181. package/src/redux/reducers/customQRCodeReducer.ts +0 -58
  182. package/src/redux/reducers/index.ts +0 -15
  183. package/src/redux/reducers/snackbarReducer.ts +0 -40
  184. package/src/redux/reducers/templateReducer.ts +0 -485
  185. package/src/redux/store.ts +0 -18
  186. package/src/styles/colors.scss +0 -61
  187. package/src/test/mocks.js +0 -89
  188. package/src/test/setupJest.js +0 -1
  189. package/src/utils/api.ts +0 -36
  190. package/src/utils/constants.ts +0 -182
  191. package/src/utils/customStyles.ts +0 -45
  192. package/src/utils/fetchWrapper.ts +0 -73
  193. package/src/utils/fonts.json +0 -1597
  194. package/src/utils/helper.ts +0 -205
  195. package/src/utils/local-storage.ts +0 -15
  196. package/src/utils/message.ts +0 -162
  197. package/src/utils/products.ts +0 -186
  198. package/src/utils/template-builder.ts +0 -328
  199. package/src/utils/templateIdentifierArea/biFold.ts +0 -107
  200. package/src/utils/templateIdentifierArea/index.ts +0 -35
  201. package/src/utils/templateIdentifierArea/personal.ts +0 -107
  202. package/src/utils/templateIdentifierArea/postCards.ts +0 -163
  203. package/src/utils/templateIdentifierArea/professional.ts +0 -125
  204. package/src/utils/templateIdentifierArea/snapPack.ts +0 -107
  205. package/src/utils/templateIdentifierArea/triFold.ts +0 -107
  206. package/src/utils/templateRestrictedArea/biFold.ts +0 -329
  207. package/src/utils/templateRestrictedArea/nonWindowProfessional.ts +0 -90
  208. package/src/utils/templateRestrictedArea/personal.ts +0 -90
  209. package/src/utils/templateRestrictedArea/postCard.ts +0 -334
  210. package/src/utils/templateRestrictedArea/postCardJumbo.tsx +0 -408
  211. package/src/utils/templateRestrictedArea/professional.ts +0 -318
  212. package/src/utils/templateRestrictedArea/realPenned.ts +0 -233
  213. package/src/utils/templateRestrictedArea/snapPack.ts +0 -1009
  214. package/src/utils/templateRestrictedArea/triFold.ts +0 -330
  215. package/src/utils/templateSafetyBorders/biFold.ts +0 -91
  216. package/src/utils/templateSafetyBorders/index.ts +0 -43
  217. package/src/utils/templateSafetyBorders/personal.ts +0 -41
  218. package/src/utils/templateSafetyBorders/postCards.ts +0 -259
  219. package/src/utils/templateSafetyBorders/professional.ts +0 -78
  220. package/src/utils/templateSafetyBorders/snapPack.ts +0 -165
  221. package/src/utils/templateSafetyBorders/triFold.ts +0 -114
  222. package/src/utils/templateSafetyBorders/types.d.ts +0 -68
  223. package/src/utils/types.ts +0 -12
  224. package/src/v2Theme.scss +0 -142
  225. package/tsconfig.json +0 -29
  226. package/tsconfig.node.json +0 -12
  227. package/update-version.js +0 -23
  228. package/version.js +0 -1
  229. package/vite.config.ts +0 -8
  230. package/webpack.config.js +0 -80
@@ -1,233 +0,0 @@
1
- import React from 'react';
2
-
3
- // Utils
4
- import { MESSAGES } from '../../../../utils/message';
5
- import { TemplateCategory, TemplateRecord, TemplateType } from '../customTemplateSection';
6
-
7
- // Components
8
- import Typography from '../../../GenericUIBlocks/Typography';
9
- import GeneralSelect from '../../../GenericUIBlocks/GeneralSelect';
10
- import Input from '../../../GenericUIBlocks/Input';
11
-
12
- // Icons
13
- import DesignIcon from '../../../../assets/images/templates/template-default-design';
14
- import dummyTemplateIcon from '../../../../assets/images/templates/template-default-design';
15
-
16
- // styles
17
- import './styles.scss';
18
-
19
-
20
- const templateTextStyles: React.CSSProperties = {
21
- color: `#000`,
22
- fontSize: `12px`,
23
- fontStyle: `normal`,
24
- fontWeight: `500`,
25
- lineHeight: `normal`,
26
- marginBottom: `16px`,
27
- };
28
-
29
-
30
- type CustomTemplateSectionProps = {
31
- selectedCategory: TemplateCategory | null,
32
- templateCategories: TemplateCategory[],
33
- currentTemplateType: TemplateType | undefined,
34
- templateTypes: TemplateType[] | null | undefined,
35
- search: any,
36
- searchApplied: boolean,
37
- loader: boolean,
38
- platformName: any,
39
- myTemplates: TemplateRecord[],
40
- teamTemplates: TemplateRecord[],
41
- olcTemplates: TemplateRecord[],
42
- setSearch: any,
43
- handleSearch: any,
44
- removeSearchInput: any,
45
- searchKeyDown: any,
46
- setCurrentTemplateType: any,
47
- setSelectedCategory: any,
48
- handleLoadTemplateModel: any,
49
- handleDialogChange: any,
50
- };
51
-
52
-
53
- const SideBarSelction = (props: CustomTemplateSectionProps) => {
54
-
55
- const {
56
- selectedCategory,
57
- templateCategories,
58
- currentTemplateType,
59
- templateTypes,
60
- search,
61
- searchApplied,
62
- loader,
63
- platformName,
64
- myTemplates,
65
- teamTemplates,
66
- olcTemplates,
67
- setSearch,
68
- handleSearch,
69
- removeSearchInput,
70
- searchKeyDown,
71
- setCurrentTemplateType,
72
- setSelectedCategory,
73
- handleLoadTemplateModel,
74
- handleDialogChange,
75
- } = props;
76
-
77
- const uniqueCurrentTemplates = Array.from(
78
- new Map(olcTemplates.map((item) => [item.id, item])).values()
79
- );
80
-
81
- return (
82
- <div className="custom-template-section">
83
- <div className="templateTabsWrapper">
84
- <div style={{ marginTop: '8px' }}>
85
- <GeneralSelect
86
- placeholder="Template Types"
87
- options={templateTypes as any}
88
- setSelectedValue={setCurrentTemplateType as any}
89
- selectedValue={currentTemplateType as any}
90
- builderSelect={true}
91
- search={false}
92
- isError={false}
93
- gallerySelect={false}
94
- clearField={false}
95
- />
96
- </div>
97
- {currentTemplateType?.id === '3' && templateCategories?.length > 1 && (
98
- <div style={{ marginTop: 8 }}>
99
- <GeneralSelect
100
- placeholder="Select Category"
101
- options={templateCategories as any}
102
- setSelectedValue={setSelectedCategory as any}
103
- selectedValue={selectedCategory as any}
104
- builderSelect={true}
105
- clearField={true}
106
- isError={false}
107
- gallerySelect={false}
108
- />
109
- </div>
110
- )}
111
- <div
112
- className="searchWrapper">
113
- <Input
114
- type="text"
115
- value={search}
116
- builderInput={true}
117
- // @ts-ignore
118
- onKeyDown={searchKeyDown}
119
- onChange={(e: any) => setSearch(e.target.value.trimStart())}
120
- placeholder="Search by template name"
121
- inputIcon={true}
122
- onClick={handleSearch}
123
- searchApplied={searchApplied}
124
- removeSearchInput={removeSearchInput}
125
- />
126
- </div>
127
- {loader ? (
128
- <div className="noTemplateText">
129
- <Typography>{MESSAGES.TEMPLATE.LOADING_TEMPLATE}</Typography>
130
- </div>
131
- ) : currentTemplateType?.id === '1' ? (
132
- <>
133
- <div
134
- className="default-design"
135
- onClick={() => handleDialogChange('design-own')}
136
- >
137
- <DesignIcon fill="var(--primary-color)" />
138
- <Typography style={templateTextStyles}>
139
- {MESSAGES.TEMPLATE.DESIGN_NEW}
140
- </Typography>
141
- </div>
142
- {myTemplates.length ? (
143
- myTemplates.map((template: any, i: number) => (
144
- <div
145
- className="design-template"
146
- key={i}
147
- onClick={() => handleLoadTemplateModel(template)}
148
- >
149
- <img
150
- src={template.thumbnailUrl}
151
- alt={template.title}
152
- onError={({ currentTarget }) => {
153
- currentTarget.onerror = null; // prevents looping
154
- //@ts-ignore
155
- currentTarget.src = dummyTemplateIcon;
156
- currentTarget.classList.add('dummy-image');
157
- }}
158
- />
159
- </div>
160
- ))
161
- ) : (
162
- <div className="noTemplateText">
163
- <Typography>{MESSAGES.TEMPLATE.NO_MY_TEMPLATES}</Typography>
164
- </div>
165
- )}
166
- </>
167
- ) : currentTemplateType?.id === '2' ? (
168
- <>
169
- {teamTemplates.length ? (
170
- teamTemplates?.map((template: any, i: number) => (
171
- <div
172
- className="design-template"
173
- key={i}
174
- onClick={() => handleLoadTemplateModel(template)}
175
- >
176
- <img
177
- src={template.thumbnailUrl}
178
- alt={template.title}
179
- onError={({ currentTarget }) => {
180
- currentTarget.onerror = null; // prevents looping
181
- //@ts-ignore
182
- currentTarget.src = dummyTemplateIcon;
183
- currentTarget.classList.add('dummy-image');
184
- }}
185
- />
186
- </div>
187
- ))
188
- ) : (
189
- <div className="noTemplateText">
190
- <Typography>
191
- {MESSAGES.TEMPLATE.NO_TEAM_TEMPLATES}
192
- </Typography>
193
- </div>
194
- )}
195
- </>
196
- ) : currentTemplateType?.id === '3' ? (
197
- <>
198
- {uniqueCurrentTemplates.length ? (
199
- uniqueCurrentTemplates?.map((template, i) => (
200
- <div
201
- className="design-template"
202
- key={i}
203
- onClick={() => handleLoadTemplateModel(template)}
204
- >
205
- <img
206
- src={template.thumbnailUrl}
207
- alt={template.title}
208
- onError={({ currentTarget }) => {
209
- currentTarget.onerror = null; // prevents looping
210
- //@ts-ignore
211
- currentTarget.src = dummyTemplateIcon;
212
- currentTarget.classList.add('dummy-image');
213
- }}
214
- />
215
- </div>
216
- ))
217
- ) : (
218
- <div className="noTemplateText">
219
- <Typography>
220
- {platformName
221
- ? `No ${platformName} Templates to show`
222
- : MESSAGES.TEMPLATE.NO_OLC_TEMPLATES}
223
- </Typography>
224
- </div>
225
- )}
226
- </>
227
- ) : null}
228
- </div>
229
- </div>
230
- );
231
- }
232
-
233
- export default SideBarSelction;
@@ -1,152 +0,0 @@
1
- .polotno-panel-container {
2
- overflow-y: scroll;
3
-
4
- & .custom-template-section {
5
- display: "flex";
6
- flex-wrap: "wrap";
7
- overflow-y: "scroll";
8
-
9
- & .title {
10
- & span {
11
- font-size: 16px;
12
- font-weight: 600;
13
- color: #ed5c2f;
14
- }
15
- }
16
- @mixin designCommonStyles {
17
- width: 320px;
18
- height: 224px;
19
- border-radius: 3px;
20
- border: 0.5px solid #303030;
21
- margin: 10px auto;
22
- cursor: pointer;
23
- }
24
- & .default-design {
25
- @include designCommonStyles;
26
- display: flex;
27
- flex-direction: column;
28
- align-items: center;
29
- justify-content: center;
30
- & p {
31
- color: #303030;
32
- font-weight: 600;
33
- font-size: 12px;
34
- line-height: 14.52px;
35
- margin-top: 5px;
36
- }
37
- }
38
- & .design-template {
39
- @include designCommonStyles;
40
- & img {
41
- width: 100%;
42
- height: 100%;
43
- object-fit: cover;
44
- }
45
- }
46
- }
47
- }
48
-
49
- .dummy-image {
50
- padding: 85px;
51
- object-fit: fill !important;
52
- }
53
-
54
- .MuiTabs-indicator {
55
- background-color: #ed5c2f !important;
56
- }
57
-
58
- .templateTabsWrapper {
59
- .templateTabs {
60
- .MuiTabScrollButton-root {
61
- width: 15px;
62
- opacity: 1 !important;
63
- &:hover {
64
- svg {
65
- color: #ed5c2f !important;
66
- }
67
- }
68
- .Mui-disabled {
69
- opacity: 1 !important;
70
- }
71
- }
72
- }
73
- }
74
-
75
- .noTemplateText {
76
- height: 100%;
77
- min-height: 200px;
78
- display: flex;
79
- justify-content: center;
80
- align-items: center;
81
- p {
82
- color: #303030;
83
- font-family: Inter;
84
- font-size: 18px;
85
- font-style: normal;
86
- font-weight: 600;
87
- line-height: normal;
88
- }
89
- }
90
-
91
- .searchWrapper {
92
- display: flex;
93
- justify-content: flex-start;
94
- align-items: center;
95
- width: 100%;
96
- gap: 10px;
97
- position: relative;
98
-
99
- .searchInput {
100
- border-radius: 3px;
101
- border: 0.5px solid rgba(68, 66, 65, 0.5);
102
- background: #fff;
103
- width: 100%;
104
- max-width: 520px;
105
- padding: 5px 20px;
106
- color: #000;
107
- font-family: Inter;
108
- font-size: 16px;
109
- font-style: normal;
110
- font-weight: 400;
111
- line-height: normal;
112
- height: 40px;
113
- width: 514px;
114
- // position: relative;
115
- &::after,
116
- &::before {
117
- display: none;
118
- }
119
-
120
- .searchIcon {
121
- position: relative;
122
- color: #ed5c2f;
123
-
124
- &::before {
125
- position: absolute;
126
- content: "";
127
- width: 1px;
128
- height: 90%;
129
- background-color: #000;
130
- left: -5px;
131
- opacity: 0.5;
132
- }
133
- }
134
-
135
- }
136
-
137
- .searchApplied {
138
- background: #fff8ee;
139
- input {
140
- padding-right: 28px;
141
- }
142
- }
143
-
144
- .clearSerach {
145
- position: absolute;
146
- top: 10px;
147
- right: 55px;
148
- font-size: 18px;
149
- opacity: 0.6;
150
- cursor: pointer;
151
- }
152
- }
@@ -1,149 +0,0 @@
1
- import React, { useState } from 'react';
2
-
3
- // Utils
4
- import { MESSAGES } from '../../../../../utils/message';
5
-
6
- // // icons
7
- import Typography from '../../../../GenericUIBlocks/Typography';
8
- // @ts-ignore
9
- import LeftArrow from '../../../../../assets/images/templates/left-arrow.svg';
10
- // @ts-ignore
11
- import RightArrow from '../../../../../assets/images/templates/right-arrow.svg';
12
-
13
- // styles
14
- import './styles.scss';
15
-
16
- const TemplatesCard = (props: any) => {
17
- const {
18
- templates,
19
- loading,
20
- handleLoadTemplateModel,
21
- platformName,
22
- currentTemplateType,
23
- product,
24
- searchApplied,
25
- primaryColorRGBA,
26
- designerQueryAmount,
27
- } = props;
28
-
29
- const [isFilpedIds, setIsFlipedIds] = useState<string[]>([]);
30
-
31
- const singleSideProducts = [2, 4, 5, 16];
32
-
33
- // handler for Flip
34
- const handleFlip = (templateId: string) => {
35
- const existingTemplateIds = isFilpedIds || [];
36
- let updatedIds: string[];
37
- if (existingTemplateIds.includes(templateId)) {
38
- updatedIds = existingTemplateIds.filter((item) => item !== templateId);
39
- } else {
40
- updatedIds = [...existingTemplateIds, templateId];
41
- }
42
- setIsFlipedIds(updatedIds);
43
- };
44
-
45
- // handler for setting color
46
- const colorSetter = (templateId: any, side: string) => {
47
- const result =
48
- !isFilpedIds.includes(templateId) && side === 'Front'
49
- ? { fill: '#FFFFFF' }
50
- : isFilpedIds.includes(templateId) && side === 'Back'
51
- ? { fill: '#FFFFFF' }
52
- : { fill: '#878585' };
53
- return result;
54
- };
55
-
56
- // handler for setting rotation
57
- const transformSetter = (templateId: any) => {
58
- const result = isFilpedIds.includes(templateId)
59
- ? {
60
- transform: 'rotateY(0deg)',
61
- }
62
- : {
63
- transform: 'rotateY(360deg)',
64
- };
65
- return result;
66
- };
67
-
68
- return (
69
- <>
70
- {loading ? (
71
- <div className="noTemplateGallery-v2">
72
- <Typography>{MESSAGES.TEMPLATE.LOADING_TEMPLATE}</Typography>
73
- </div>
74
- ) : templates.length ? (
75
- templates.map((template: any, index: string) => {
76
- return (
77
- <div className="templateCard-v2" key={index}>
78
- <div className="templateImage">
79
- <img
80
- src={
81
- isFilpedIds.includes(template?.id)
82
- ? template.backThumbnailUrl
83
- : template.thumbnailUrl
84
- }
85
- alt="template"
86
- style={transformSetter(template?.id)}
87
- loading="lazy"
88
- />
89
- {!singleSideProducts.includes(Number(product?.id)) && (
90
- <>
91
- <img src={LeftArrow} alt="back" className="left-arrow" onClick={() => handleFlip(template?.id)} />
92
- <img src={RightArrow} alt="front" className="right-arrow" onClick={() => handleFlip(template?.id)} />
93
- </>
94
- )}
95
- </div>
96
- <div className="title-btn-container">
97
- <Typography className="templateName">
98
- {template?.title}
99
- </Typography>
100
- <button
101
- className="tempButton"
102
- onClick={() => handleLoadTemplateModel(template)}
103
- >
104
- Use Template
105
- </button>
106
- </div>
107
- </div>
108
- );
109
- })
110
- ) : currentTemplateType?.id === '1' ? (
111
- <div
112
- className={`${+product?.id === 5 && designerQueryAmount
113
- ? 'noTemplateGallery-v2 more-visible'
114
- : product?.productType === 'Professional Letters'
115
- ? 'noTemplateGallery-v2 noTemplateProfessionalAndPersonal'
116
- : 'noTemplateGallery-v2'
117
- }`}
118
- >
119
- <Typography>{MESSAGES.TEMPLATE.NO_MY_TEMPLATES}</Typography>
120
- </div>
121
- ) : currentTemplateType?.id === '2' ? (
122
- <div
123
- className={`${+product?.id === 5 && designerQueryAmount ? 'noTemplateGallery-v2 more-visible' : 'noTemplateGallery-v2'}`}
124
- >
125
- <Typography>{MESSAGES.TEMPLATE.NO_TEAM_TEMPLATES}</Typography>
126
- </div>
127
- ) : currentTemplateType?.id === '3' ? (
128
- <div
129
- className={`${+product?.id === 5 && designerQueryAmount
130
- ? 'noTemplateGallery-v2 more-visible'
131
- : product?.productType === 'Professional Letters'
132
- ? 'noTemplateGallery-v2 noTemplateProfessionalAndPersonal'
133
- : 'noTemplateGallery-v2'
134
- }`}
135
- >
136
- <Typography>
137
- {platformName
138
- ? `No ${platformName} Templates to show`
139
- : MESSAGES.TEMPLATE.NO_OLC_TEMPLATES}
140
- </Typography>
141
- </div>
142
- ) : (
143
- <></>
144
- )}
145
- </>
146
- );
147
- };
148
-
149
- export default TemplatesCard;
@@ -1,156 +0,0 @@
1
- .templateCard-v2 {
2
- width: 100%;
3
- border-radius: 3px;
4
- flex: 0 460px;
5
- height: 374px;
6
- background-color: #fff;
7
- border: 0.36px solid #00000066;
8
- padding: 20px;
9
- border-radius: 12px;
10
-
11
- .templateImage {
12
- position: relative;
13
- margin-bottom: 16px;
14
- border: none;
15
- transition: 0.1s ease-in all;
16
- height: 100%;
17
- max-height: 280px;
18
- background-color: #F9FAFB;
19
-
20
- img {
21
- height: 100%;
22
- width: 100%;
23
- border-radius: 7px;
24
- padding: 1.5px;
25
- object-fit: contain;
26
- }
27
-
28
- &:hover {
29
- .tempButton {
30
- display: flex !important;
31
- }
32
-
33
- .left-arrow, .right-arrow {
34
- display: block;
35
- }
36
- }
37
-
38
- .left-arrow {
39
- display: none;
40
- position: absolute;
41
- left: 10px;
42
- top: 50%;
43
- transform: translateY(-50%);
44
- cursor: pointer;
45
- width: 40px;
46
- height: 40px;
47
- border-radius: 50%;
48
- background-color: #ffffff;
49
- transition: 0.1s ease-in all;
50
-
51
- &:hover {
52
- filter: invert(1) brightness(0.8);
53
- }
54
- }
55
-
56
- .right-arrow {
57
- display: none;
58
- position: absolute;
59
- right: 10px;
60
- top: 50%;
61
- transform: translateY(-50%);
62
- cursor: pointer;
63
- width: 40px;
64
- height: 40px;
65
- border-radius: 50%;
66
- background-color: #ffffff;
67
- transition: 0.1s ease-in all;
68
-
69
- &:hover {
70
- filter: invert(1) brightness(0.8);
71
- }
72
- }
73
- }
74
-
75
- .title-btn-container{
76
- display: flex;
77
- justify-content: space-between;
78
- align-items: center;
79
- gap: 10px;
80
-
81
- .templateName {
82
- font-size: 16px;
83
- font-weight: 400;
84
- margin: 0;
85
- }
86
-
87
- .tempButton {
88
- background-color: #ffffff;
89
- color: #000;
90
- text-transform: capitalize;
91
- border-radius: 4px;
92
- transition: 0.3s ease-in all !important;
93
- font-size: 14px;
94
- font-weight: 600;
95
- font-family: var(--font-family);
96
- width: 140px;
97
- height: 40px;
98
- border: none;
99
- cursor: pointer;
100
- border: 0.5px solid #0000003D;
101
- box-shadow: 0px 2px 6px 0px #0000000A;
102
-
103
- &:focus {
104
- outline: none;
105
- }
106
-
107
- &:hover {
108
- background-color: #F9FAFB;
109
- }
110
- }
111
-
112
- }
113
-
114
-
115
- .templateID {
116
- font-size: 16px !important;
117
- color: #6a6565 !important;
118
- font-weight: 300 !important;
119
- margin-top: 7px;
120
- }
121
- }
122
-
123
- .noTemplateGallery-v2 {
124
- display: flex;
125
- justify-content: center;
126
- align-items: center;
127
- width: 100%;
128
- background-color: #F9FAFB;
129
- border-radius: 7px;
130
- height: calc(100vh - 270px);
131
- // margin-right: 32px;
132
-
133
-
134
- @media (width <= 1125px){
135
- height: calc(100vh - 320px);
136
- }
137
-
138
- p {
139
- font-size: 16px;
140
- font-style: normal;
141
- font-weight: 400;
142
- line-height: normal;
143
- color: #00000066 !important;
144
- margin: 0;
145
- }
146
- }
147
-
148
- .noTemplateProfessionalAndPersonal {
149
- height: calc(100vh - 1000px) !important;
150
- }
151
-
152
-
153
- .more-visible {
154
- height: calc(100vh - 850px) !important;
155
- margin-top: -20px !important;
156
- }