🔨 refactor: checkout

:%s
This commit is contained in:
unknown
2021-09-07 14:41:53 +07:00
parent 267d7918fa
commit 859f645c03
15 changed files with 69 additions and 54 deletions

View File

@@ -0,0 +1,51 @@
import Link from 'next/link'
import React, { useRef } from 'react'
import { ButtonCommon, Inputcommon } from 'src/components/common'
import InputCommon from 'src/components/common/InputCommon/InputCommon'
import s from './CustomerInfoForm.module.scss'
interface CustomerInfoFormProps {
onConfirm?: ()=>void
}
const CustomerInfoForm = ({}: CustomerInfoFormProps) => {
const nameRef = useRef<React.ElementRef<typeof InputCommon>>(null);
const emailRef = useRef<React.ElementRef<typeof InputCommon>>(null);
const handleConfirmClick = () => {
return {
name:nameRef?.current?.getValue(),
email:emailRef.current?.getValue()
}
}
return (
<div className={s.warpper}>
<div className={s.body}>
<Inputcommon type="text" placeholder="Full Name" ref={nameRef}/>
<Inputcommon type="text" placeholder="Email Address" ref={emailRef}/>
</div>
<div className={s.bottom}>
<div className={s.note}>
By clicking continue you agree to Casper's{' '}
{
<Link href="#">
<strong>terms and conditions</strong>
</Link>
}{' '}
and{' '}
{
<Link href="#">
<strong>privacy policy </strong>
</Link>
}
.
</div>
<ButtonCommon onClick={handleConfirmClick}>Continue to Shipping</ButtonCommon>
</div>
</div>
)
}
export default CustomerInfoForm