Website for showcasing all features of Tesseract Web.
Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 

112 linhas
2.2 KiB

  1. import type { NextPage } from 'next'
  2. import Link from 'next/link';
  3. import * as Navigation from '@tesseract-design/web-navigation-react';
  4. import { DefaultLayout } from 'src/components/DefaultLayout';
  5. type Page = {
  6. id: string,
  7. href: string,
  8. label: string,
  9. }
  10. type Props = {
  11. componentPages?: Page[],
  12. examplePages?: Page[],
  13. }
  14. const createPageLink = (p: Page) => (
  15. <div
  16. key={p.id}
  17. >
  18. <Link
  19. href={p.href}
  20. passHref
  21. >
  22. <Navigation.LinkButton
  23. block
  24. border
  25. menuItem
  26. >
  27. {p.label}
  28. </Navigation.LinkButton>
  29. </Link>
  30. </div>
  31. )
  32. const IndexPage: NextPage<Props> = ({
  33. componentPages = [
  34. {
  35. id: 'action',
  36. href: '/categories/action',
  37. label: 'Action',
  38. },
  39. {
  40. id: 'code',
  41. href: '/categories/code',
  42. label: 'Code',
  43. },
  44. {
  45. id: 'freeform',
  46. href: '/categories/freeform',
  47. label: 'Freeform',
  48. },
  49. {
  50. id: 'navigation',
  51. href: '/categories/navigation',
  52. label: 'Navigation',
  53. },
  54. {
  55. id: 'number',
  56. href: '/categories/number',
  57. label: 'Number',
  58. },
  59. {
  60. id: 'option',
  61. href: '/categories/option',
  62. label: 'Option',
  63. },
  64. ],
  65. examplePages = [
  66. {
  67. id: 'registration-form',
  68. href: '/examples/registration-form',
  69. label: 'Registration Form',
  70. }
  71. ],
  72. }) => {
  73. return (
  74. <DefaultLayout
  75. title="Kitchen Sink"
  76. >
  77. <main className="mt-8 mb-16 md:mt-16 md:mb-32">
  78. <section>
  79. <div className="container mx-auto px-4">
  80. <h1>
  81. Components
  82. </h1>
  83. <div>
  84. <div className="grid md:grid-cols-2 gap-4 my-4">
  85. {componentPages.map(createPageLink)}
  86. </div>
  87. </div>
  88. </div>
  89. </section>
  90. <section>
  91. <div className="container mx-auto px-4">
  92. <h1>
  93. Examples
  94. </h1>
  95. <div>
  96. <div className="grid md:grid-cols-2 gap-4 my-4">
  97. {examplePages.map(createPageLink)}
  98. </div>
  99. </div>
  100. </div>
  101. </section>
  102. </main>
  103. </DefaultLayout>
  104. )
  105. }
  106. export default IndexPage