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