+
+ Create an account
+
+
+
+
+
+
+ {errorMessage && {errorMessage}}
+
+
+
+
+
+ Already have an account?
+ {toggleActiveForm ? (
+
+ Log in
+
+ ) : (
+ Log in
+ )}
+ .
+
+
+ );
+};
+
+const { func } = PropTypes;
+
+Register.propTypes = {
+ toggleActiveForm: func,
+};
+
+export default Register;
diff --git a/src/components/Auth/Register.schema.js b/src/components/Auth/Register.schema.js
new file mode 100644
index 0000000..828a943
--- /dev/null
+++ b/src/components/Auth/Register.schema.js
@@ -0,0 +1,30 @@
+import Joi from '@hapi/joi';
+import { createValidationResolver } from '../form';
+
+const schema = Joi.object({
+ username: Joi.string()
+ .required()
+ .trim()
+ .label('Username'),
+ email: Joi.string()
+ .required()
+ .trim()
+ .label('Email'),
+ password: Joi.string()
+ .required()
+ .label('Password'),
+ passwordConfirmation: Joi.string()
+ .required()
+ .label('Password Confirmation')
+ .valid(Joi.ref('password')),
+});
+
+const defaultValues = {
+ username: '',
+ email: '',
+ password: '',
+ passwordConfirmation: '',
+};
+
+const validationResolver = createValidationResolver(schema);
+export { validationResolver, schema, defaultValues };
diff --git a/src/components/Auth/VerifyEmail.js b/src/components/Auth/VerifyEmail.js
new file mode 100644
index 0000000..f92e8d9
--- /dev/null
+++ b/src/components/Auth/VerifyEmail.js
@@ -0,0 +1,21 @@
+import React from 'react';
+import PropTypes from 'prop-types';
+import { useQuery } from 'react-query';
+import { verifyEmail } from '../../utils/queries';
+
+function VerifyEmail({ matchProps }) {
+ console.log(matchProps);
+ const key = matchProps.match.params.key;
+ console.log(key);
+ const { isLoading, data, error } = useQuery(['key', key], verifyEmail);
+ console.log(isLoading);
+ console.log(data);
+ console.log(error);
+ return