-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
30 changed files
with
154 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,35 @@ | ||
import Link from "next/link"; | ||
import PropTypes from "prop-types"; | ||
import React from "react"; | ||
|
||
/*** | ||
* Wrapper component for dynamic href and as | ||
*/ | ||
export default function WrapInLink({ children, href, as }) { | ||
export default function WrapInLink({ children, href, as, ...props }) { | ||
return ( | ||
<Link passHref href={href} as={as}> | ||
<a target="_self">{children}</a> | ||
<a {...props} target="_self"> | ||
{children} | ||
</a> | ||
</Link> | ||
); | ||
} | ||
|
||
WrapInLink.propTypes = { | ||
/** | ||
* Components to wrap | ||
*/ | ||
children: PropTypes.node.isRequired, | ||
/** | ||
* Destination of the link | ||
*/ | ||
href: PropTypes.string.isRequired, | ||
/** | ||
* As path of the link | ||
*/ | ||
as: PropTypes.string, | ||
}; | ||
|
||
WrapInLink.defaultProps = { | ||
as: null, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,9 +27,7 @@ const Disclaimer = styled.p` | |
`; | ||
|
||
const SignupSchema = Yup.object().shape({ | ||
email: Yup.string() | ||
.email("Invalid email") | ||
.required("Required"), | ||
email: Yup.string().email("Invalid email").required("Required"), | ||
username: Yup.string() | ||
.min(2, "Username must be at least 3 characters!") | ||
.max(50, "Username is too long.") | ||
|
@@ -98,30 +96,34 @@ export default function SignUpForm() { | |
</Disclaimer> | ||
<TextInput | ||
label="email" | ||
id="email" | ||
name="email" | ||
type="email" | ||
placeholder="[email protected]" | ||
/> | ||
<TextInput | ||
label="Username" | ||
id="username" | ||
name="username" | ||
type="text" | ||
placeholder="SpaceFarmer" | ||
/> | ||
<TextInput | ||
label="Password" | ||
id="password" | ||
name="password" | ||
type="password" | ||
placeholder="Password" | ||
/> | ||
<TextInput | ||
label="Validate password" | ||
id="validatePassword" | ||
name="validatePassword" | ||
type="password" | ||
placeholder="Validate Password" | ||
/> | ||
|
||
<Checkbox name="acceptTerms"> | ||
<Checkbox id="acceptTerms" name="acceptTerms"> | ||
I agree to the <a>terms and conditions</a> | ||
</Checkbox> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.