From f82d287346228a9c86eb72695c26e1cf6be94d25 Mon Sep 17 00:00:00 2001 From: chornos13 Date: Thu, 4 Feb 2021 11:50:58 +0700 Subject: [PATCH] feat(home-page): add formik example, yup and jest in What Will Learn --- src/views/Home/partials/WhatWillLearn.tsx | 44 +++++++++++++++++++---- 1 file changed, 37 insertions(+), 7 deletions(-) diff --git a/src/views/Home/partials/WhatWillLearn.tsx b/src/views/Home/partials/WhatWillLearn.tsx index 5048745..ec722b2 100644 --- a/src/views/Home/partials/WhatWillLearn.tsx +++ b/src/views/Home/partials/WhatWillLearn.tsx @@ -1,5 +1,5 @@ import React from 'react' -import { Button, Card, Col, Row } from 'antd' +import { Avatar, Button, Card, Col, Row } from 'antd' import Title from 'components/Typography/Title' import { CardProps } from 'antd/lib/card' import Link from 'next/link' @@ -8,10 +8,10 @@ interface LearnItemProps extends CardProps { urlTitleIcon?: string urlDocumentation?: string urlExample?: string - title?: string + title?: string | React.ReactNode } -const dataLearnItems = [ +const dataLearnItems: LearnItemProps[] = [ { title: 'React', urlTitleIcon: @@ -42,6 +42,7 @@ const dataLearnItems = [ urlTitleIcon: 'https://formik.org/images/favicon.png', urlDocumentation: 'https://formik.org/docs/overview', children: 'Build forms in React, without the tears', + urlExample: '/formik/basic-input', }, { title: 'React Query', @@ -54,13 +55,42 @@ const dataLearnItems = [ '\nFetch, cache and update data ' + 'in your React and React Native applications all without touching any "global state".', }, + { + title: ( + + + Y + +   Yup + + ), + children: + 'Yup is a JavaScript schema builder for value parsing and validation. ' + + 'Define a schema, transform a value to match, ' + + 'validate the shape of an existing value, or both. ' + + 'Yup schema are extremely expressive and allow modeling complex, ' + + 'interdependent validations, or value transformations.', + urlDocumentation: 'https://github.com/jquense/yup', + }, { title: 'Storybook', children: 'Build bulletproof UI components faster', urlTitleIcon: 'https://storybook.js.org/images/logos/icon-storybook.png', urlDocumentation: 'https://storybook.js.org/', }, -] as LearnItemProps[] + { + title: 'Jest', + children: + 'Jest is a delightful JavaScript Testing Framework with a focus on simplicity.', + urlTitleIcon: 'https://jestjs.io/img/favicon/favicon.ico', + urlDocumentation: 'https://jestjs.io/', + }, +] function LearnItem(props: LearnItemProps) { const { @@ -109,7 +139,7 @@ function LearnItem(props: LearnItemProps) {
{urlTitleIcon && ( - {title} + {title   )} @@ -134,9 +164,9 @@ function WhatWillLearn() { Library - {dataLearnItems.map((learnItem) => { + {dataLearnItems.map((learnItem, key) => { return ( - + )