alertLink.stories.js 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. import React from 'react';
  2. import {withInfo} from '@storybook/addon-info';
  3. import AlertLink from 'app/components/alertLink';
  4. import {IconDocs, IconGeneric, IconMail, IconStack, IconStar} from 'app/icons';
  5. export default {
  6. title: 'UI/Alerts/AlertLink',
  7. };
  8. export const Default = withInfo(
  9. 'A way to loudly link between different parts of the application'
  10. )(() => [
  11. <AlertLink to="/settings/account/notifications" key="1">
  12. Check out the notifications settings panel.
  13. </AlertLink>,
  14. <AlertLink to="/settings/account/notifications" priority="error" key="2">
  15. Do not forget to read the docs ya dum dum!
  16. </AlertLink>,
  17. <AlertLink to="/settings/account/notifications" priority="info" key="3">
  18. Install this thing or else!
  19. </AlertLink>,
  20. <AlertLink to="/settings/account/notifications" priority="success" key="4">
  21. Gj you did it. Now go here.
  22. </AlertLink>,
  23. <AlertLink to="/settings/account/notifications" priority="muted" key="5">
  24. I am saying nothing, ok?
  25. </AlertLink>,
  26. ]);
  27. Default.story = {
  28. name: 'default',
  29. };
  30. export const WithAnIcon = withInfo('You can optionally pass an icon src')(() => [
  31. <AlertLink to="/settings/account/notifications" icon={<IconMail />} key="1">
  32. Gumbo beet greens corn soko endive gumbo gourd. Parsley shallot courgette tatsoi pea
  33. sprouts fava bean collard greens dandelion okra wakame tomato. Dandelion cucumber
  34. earthnut pea peanut soko zucchini.
  35. </AlertLink>,
  36. <AlertLink
  37. to="/settings/account/notifications"
  38. icon={<IconDocs />}
  39. priority="error"
  40. key="2"
  41. >
  42. Do not forget to read the docs ya dum dum!
  43. </AlertLink>,
  44. <AlertLink
  45. to="/settings/account/notifications"
  46. icon={<IconStack />}
  47. priority="info"
  48. key="3"
  49. >
  50. Install this thing or else!
  51. </AlertLink>,
  52. <AlertLink
  53. to="/settings/account/notifications"
  54. icon={<IconStar />}
  55. priority="success"
  56. key="4"
  57. >
  58. Gj you did it. Now go here.
  59. </AlertLink>,
  60. <AlertLink
  61. to="/settings/account/notifications"
  62. icon={<IconGeneric />}
  63. priority="muted"
  64. key="5"
  65. >
  66. I am saying nothing, ok?
  67. </AlertLink>,
  68. ]);
  69. WithAnIcon.story = {
  70. name: 'with an icon',
  71. };
  72. export const Small = withInfo('You can optionally pass an icon src')(() => [
  73. <AlertLink to="/settings/account/notifications" size="small" key="1">
  74. Check out the notifications settings panel.
  75. </AlertLink>,
  76. <AlertLink to="/settings/account/notifications" priority="error" size="small" key="2">
  77. Do not forget to read the docs ya dum dum!
  78. </AlertLink>,
  79. <AlertLink to="/settings/account/notifications" priority="info" size="small" key="3">
  80. Install this thing or else!
  81. </AlertLink>,
  82. <AlertLink to="/settings/account/notifications" priority="success" size="small" key="4">
  83. Gj you did it. Now go here.
  84. </AlertLink>,
  85. <AlertLink to="/settings/account/notifications" priority="muted" size="small" key="5">
  86. I am saying nothing, ok?
  87. </AlertLink>,
  88. ]);
  89. Small.story = {
  90. name: 'small',
  91. };