From 87a343644592e9b425e7fa0805988ad8e7ee8778 Mon Sep 17 00:00:00 2001 From: Blaster4385 Date: Fri, 12 Aug 2022 11:23:48 +0530 Subject: Refactor code and switch to a multi-step form setup --- client/src/components/Card/Card.jsx | 4 ++-- client/src/components/RegEx/RegEx.jsx | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 client/src/components/RegEx/RegEx.jsx (limited to 'client/src/components') diff --git a/client/src/components/Card/Card.jsx b/client/src/components/Card/Card.jsx index 3d66067..9460955 100644 --- a/client/src/components/Card/Card.jsx +++ b/client/src/components/Card/Card.jsx @@ -1,9 +1,9 @@ import React from 'react' import styles from './Card.module.css' -const Card = ({ title, image }) => { +const Card = ({ title, image, onClick }) => { return ( -
+

{title}

diff --git a/client/src/components/RegEx/RegEx.jsx b/client/src/components/RegEx/RegEx.jsx new file mode 100644 index 0000000..2df4266 --- /dev/null +++ b/client/src/components/RegEx/RegEx.jsx @@ -0,0 +1,9 @@ +export const validString = /^[a-zA-Z]+$/ + +export const validMobileNumber = /^[0-9]{10}$/ + +export const validNumber = /^[0-9]+$/ + +export const validPincode = /^[0-9]{6}$/ + +export const validEmail = /^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$/ -- cgit