56 行
2.2 KiB
JavaScript
56 行
2.2 KiB
JavaScript
import React, { useEffect, useState } from 'react';
|
|
import ReactDOM from 'react-dom';
|
|
import { Button } from '@material-ui/core';
|
|
import Alert from '../../component/alert';
|
|
|
|
|
|
const Contact_Complete = () => {
|
|
|
|
const [contactEmail, SetContactEmail] = useState('sample@gmail.com');
|
|
const [saveFlag, SetSaveFlag] = useState(false);
|
|
|
|
const saveStorage = () => {
|
|
navigator.clipboard.writeText(contactEmail).then(function() {
|
|
SetSaveFlag(true);
|
|
let timer = setTimeout(()=>{
|
|
clearTimeout(timer);
|
|
SetSaveFlag(false);
|
|
}, 4000)
|
|
})
|
|
}
|
|
|
|
return (
|
|
<div>
|
|
<p className="text-center font-weight-bold ft-20">お問い合わせ完了</p>
|
|
<p className="p-2 mt-80-px mb-0 ft-16 ft-md-14 bg-color-1">
|
|
お問い合わせが完了しました。<br/>
|
|
3営業日以内にお返事させていただきます。<br/><br/>
|
|
万が一届かない場合は、以下のメールアドレスに 直接ご連絡くださいませ。
|
|
</p>
|
|
|
|
<div className="p-2 my-4 border text-center font-weight-bold">
|
|
<p className="m-0 scale-1 pointer" onClick={saveStorage}>{contactEmail}</p>
|
|
</div>
|
|
|
|
<div className="d-flex justify-content-between">
|
|
<div className="w-50 pr-1">
|
|
<Button fullWidth className="p-3 rounded-20 ft-16 ft-md-13 font-weight-bold text-black bg-color-2" onClick={()=>{window.location.href="/login/p-account/"}}>親ログイン画面へ</Button>
|
|
</div>
|
|
<div className="w-50 pl-1">
|
|
<Button fullWidth className="p-3 rounded-20 ft-16 ft-md-13 font-weight-bold text-black bg-color-2" onClick={()=>{window.location.href="/login/c-account/"}}>子ログイン画面へ</Button>
|
|
</div>
|
|
</div>
|
|
{
|
|
saveFlag && <div className="alert-success ft-16 ft-md-14">メールアドレスのコビーに成功しました!</div>
|
|
}
|
|
</div>
|
|
)
|
|
}
|
|
|
|
|
|
if(document.getElementById('contact-complete')){
|
|
ReactDOM.render(
|
|
<Contact_Complete />,
|
|
document.getElementById('contact-complete')
|
|
)
|
|
} |