l-min-components 1.7.1336 → 1.7.1338

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "l-min-components",
3
- "version": "1.7.1336",
3
+ "version": "1.7.1338",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "src/assets",
@@ -160,154 +160,137 @@ const AccountDropdown = (props) => {
160
160
  </>
161
161
  {/* } */}
162
162
 
163
- {envType === "staging" || envType === "localhost" ? (
164
- <>
165
- {props?.instructorAccountData?.length > 0 && (
163
+ <>
164
+ {props?.instructorAccountData?.length > 0 && (
165
+ <div>
166
+ <h3>Instructor account</h3>
167
+ {props?.instructorAccountData?.map((instructorItem, idx) => {
168
+ console.log("account>>", instructorItem);
169
+ return (
170
+ <div
171
+ className={`account-info ${
172
+ instructorItem?.id === props?.selectedAccount?.id
173
+ ? "activated"
174
+ : ""
175
+ }`}
176
+ onClick={() => {
177
+ deleteCookies([
178
+ "defaultAccountType",
179
+ "defaultAccountID",
180
+ ]);
181
+ props?.setSelectedAccount(instructorItem);
182
+ setTimeout(() => {
183
+ handleRedirectFunc(instructorItem);
184
+ }, 1000);
185
+ }}
186
+ key={idx}
187
+ >
188
+ <div className="avatar-container">
189
+ <img
190
+ src={
191
+ instructorItem?.profile_photo?.url || props.avatar
192
+ }
193
+ alt="account photo"
194
+ />
195
+ </div>
196
+ <div className="account-details">
197
+ <h1>
198
+ {" "}
199
+ {findAccountNames(instructorItem) ||
200
+ props.accountName}
201
+ </h1>
202
+ {instructorItem?.notification_count > 0 && (
203
+ <span>{instructorItem?.notification_count} </span>
204
+ )}
205
+ </div>
206
+ </div>
207
+ );
208
+ })}
209
+ </div>
210
+ )}
211
+ {props?.enterpriseAccountData?.length > 0 && (
212
+ <div>
213
+ <h3>Enterprise account</h3>
214
+ {props?.enterpriseAccountData?.map((enterpriseItem, idx) => (
215
+ <div
216
+ className={`account-info ${
217
+ enterpriseItem?.id === props?.selectedAccount?.id
218
+ ? "activated"
219
+ : ""
220
+ }`}
221
+ onClick={() => {
222
+ deleteCookies(["defaultAccountType", "defaultAccountID"]);
223
+ props?.setSelectedAccount(enterpriseItem);
224
+ setTimeout(() => {
225
+ handleRedirectFunc(enterpriseItem);
226
+ }, 1000);
227
+ }}
228
+ key={idx}
229
+ >
230
+ <div className="avatar-container">
231
+ <img
232
+ src={enterpriseItem?.profile_photo?.url || props.avatar}
233
+ alt="account photo"
234
+ />
235
+ </div>
236
+ <div className="account-details">
237
+ <h1>
238
+ {" "}
239
+ {findAccountNames(enterpriseItem) || props.accountName}
240
+ </h1>
241
+ {enterpriseItem?.notification_count > 0 && (
242
+ <span>{enterpriseItem?.notification_count} </span>
243
+ )}
244
+ </div>
245
+ </div>
246
+ ))}
247
+ </div>
248
+ )}
249
+
250
+ {!props?.hasDeveloperAccount && // dont show personal accounts for developer user
251
+ props?.personalAccountData?.length > 0 && (
166
252
  <div>
167
- <h3>Instructor account</h3>
168
- {props?.instructorAccountData?.map((instructorItem, idx) => {
169
- console.log("account>>", instructorItem);
170
- return (
171
- <div
172
- className={`account-info ${
173
- instructorItem?.id === props?.selectedAccount?.id
174
- ? "activated"
175
- : ""
176
- }`}
177
- onClick={() => {
178
- deleteCookies([
179
- "defaultAccountType",
180
- "defaultAccountID",
181
- ]);
182
- props?.setSelectedAccount(instructorItem);
183
- setTimeout(() => {
184
- handleRedirectFunc(instructorItem);
185
- }, 1000);
186
- }}
187
- key={idx}
188
- >
189
- <div className="avatar-container">
190
- <img
191
- src={
192
- instructorItem?.profile_photo?.url || props.avatar
193
- }
194
- alt="account photo"
195
- />
196
- </div>
197
- <div className="account-details">
198
- <h1>
199
- {" "}
200
- {findAccountNames(instructorItem) ||
201
- props.accountName}
202
- </h1>
203
- {instructorItem?.notification_count > 0 && (
204
- <span>{instructorItem?.notification_count} </span>
205
- )}
206
- </div>
253
+ <h3>Personal account</h3>
254
+ {props?.personalAccountData?.map((personalItem, idx) => (
255
+ <div
256
+ className={`account-info ${
257
+ personalItem?.id === props?.selectedAccount?.id
258
+ ? "activated"
259
+ : ""
260
+ }`}
261
+ onClick={() => {
262
+ deleteCookies([
263
+ "defaultAccountType",
264
+ "defaultAccountID",
265
+ ]);
266
+ props?.setSelectedAccount(personalItem);
267
+ setTimeout(() => {
268
+ handleRedirectFunc(personalItem);
269
+ }, 1000);
270
+ }}
271
+ key={idx}
272
+ >
273
+ <div className="avatar-container">
274
+ <img
275
+ src={personalItem?.profile_photo?.url || props.avatar}
276
+ alt="account photo"
277
+ />
207
278
  </div>
208
- );
209
- })}
279
+ <div className="account-details">
280
+ <h1>
281
+ {" "}
282
+ {findAccountNames(personalItem) || props.accountName}
283
+ </h1>
284
+ {personalItem?.notification_count > 0 && (
285
+ <span>{personalItem?.notification_count} </span>
286
+ )}
287
+ </div>
288
+ </div>
289
+ ))}
210
290
  </div>
211
291
  )}
212
- {(envType === "staging" || envType === "localhost") &&
213
- props?.enterpriseAccountData?.length > 0 && (
214
- <div>
215
- <h3>Enterprise account</h3>
216
- {props?.enterpriseAccountData?.map(
217
- (enterpriseItem, idx) => (
218
- <div
219
- className={`account-info ${
220
- enterpriseItem?.id === props?.selectedAccount?.id
221
- ? "activated"
222
- : ""
223
- }`}
224
- onClick={() => {
225
- deleteCookies([
226
- "defaultAccountType",
227
- "defaultAccountID",
228
- ]);
229
- props?.setSelectedAccount(enterpriseItem);
230
- setTimeout(() => {
231
- handleRedirectFunc(enterpriseItem);
232
- }, 1000);
233
- }}
234
- key={idx}
235
- >
236
- <div className="avatar-container">
237
- <img
238
- src={
239
- enterpriseItem?.profile_photo?.url ||
240
- props.avatar
241
- }
242
- alt="account photo"
243
- />
244
- </div>
245
- <div className="account-details">
246
- <h1>
247
- {" "}
248
- {findAccountNames(enterpriseItem) ||
249
- props.accountName}
250
- </h1>
251
- {enterpriseItem?.notification_count > 0 && (
252
- <span>{enterpriseItem?.notification_count} </span>
253
- )}
254
- </div>
255
- </div>
256
- )
257
- )}
258
- </div>
259
- )}
292
+ </>
260
293
 
261
- {(envType === "staging" || envType === "localhost") &&
262
- !props?.hasDeveloperAccount && // dont show personal accounts for developer user
263
- props?.personalAccountData?.length > 0 && (
264
- <div>
265
- <h3>Personal account</h3>
266
- {props?.personalAccountData?.map((personalItem, idx) => (
267
- <div
268
- className={`account-info ${
269
- personalItem?.id === props?.selectedAccount?.id
270
- ? "activated"
271
- : ""
272
- }`}
273
- onClick={() => {
274
- deleteCookies([
275
- "defaultAccountType",
276
- "defaultAccountID",
277
- ]);
278
- props?.setSelectedAccount(personalItem);
279
- setTimeout(() => {
280
- handleRedirectFunc(personalItem);
281
- }, 1000);
282
- }}
283
- key={idx}
284
- >
285
- <div className="avatar-container">
286
- <img
287
- src={
288
- personalItem?.profile_photo?.url || props.avatar
289
- }
290
- alt="account photo"
291
- />
292
- </div>
293
- <div className="account-details">
294
- <h1>
295
- {" "}
296
- {findAccountNames(personalItem) ||
297
- props.accountName}
298
- </h1>
299
- {personalItem?.notification_count > 0 && (
300
- <span>{personalItem?.notification_count} </span>
301
- )}
302
- </div>
303
- </div>
304
- ))}
305
- </div>
306
- )}
307
- </>
308
- ) : (
309
- <></>
310
- )}
311
294
  {/* // )} */}
312
295
  </AccountDropdownBody>
313
296