Skip to content

Instantly share code, notes, and snippets.

@mi6gan
Created February 11, 2020 10:32
Show Gist options
  • Save mi6gan/aa446ff3bdb810df11074de2ba7a6575 to your computer and use it in GitHub Desktop.
Save mi6gan/aa446ff3bdb810df11074de2ba7a6575 to your computer and use it in GitHub Desktop.
notifications.map(({ id, verb, data }) =>
verb === "category_weak" ? (
<NotificationsStatItem
key={id}
id={id}
title={composeCategoryWeak(data)}
recommendation={"Focus on your weak..."}
level={"error"}
/>
) : verb === "common_mistake" ? (
<NotificationsStatItem
key={id}
id={id}
title={composeCommonMistake(data)}
recommendation={"Focus on your weak..."}
level={"error"}
/>
) : verb === "time_long" ? (
<NotificationShopItem
key={id}
id={id}
title={"You often solve tasks correctly, but too long."}
recommendation={"Speed up your pace to keep within the real test time!"}
leve={"error"}
/>
) : verb === "package_expiring" ? (
<NotificationsStatItem
key={id}
id={id}
title={"Your access to the package will expire soon!"}
recommendation={"Focus on your weak..."}
level={"error"}
/>
) : ... // итд, можно писать всё в той же очередности, что в это dictionary
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment