Skip to content

Commit

Permalink
仮登録ほぼ完成
Browse files Browse the repository at this point in the history
  • Loading branch information
tako0614 committed Feb 20, 2024
1 parent 5d9330e commit d37cb1b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 16 deletions.
26 changes: 10 additions & 16 deletions islands/RegisterForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,21 @@ export default function RegisterForm({ text, color,tako }: { text: string, color
const classs = "inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50" + color

const [showModal, setShowModal] = useState(false);

const [showForm, setShowFrom] = useState(false);
const handleButtonClick = () => {
setShowModal(!showModal);
}
//const [username, setUsername] = useState("");
const [email, setEmail] = useState("");
//const handleUsernameChange = (event: h.JSX.TargetedEvent<HTMLInputElement>) => {
// setUsername(event.currentTarget.value);
//};
const handleEmailChange = (event: h.JSX.TargetedEvent<HTMLInputElement>) => {
setEmail(event.currentTarget.value);
};
const handleSubmit = async (event: JSX.TargetedEvent<HTMLFormElement, Event>) => {
event.preventDefault();
const startTime = Date.now();
const token = await fetch("http://localhost:8000/api/token?origin=http://localhost:8000")
const csrftoken = await token.json();
const data = {
requirements: "temp_register",
//userName: username,
mail: email,
csrftoken: csrftoken.csrftoken
};
Expand All @@ -39,10 +34,7 @@ export default function RegisterForm({ text, color,tako }: { text: string, color
})
const response = await res.json()
if(response.status == true) {

const endTime = Date.now();
alert(endTime - startTime);
alert("ueeeee")
setShowFrom(!showForm)
} else {
alert("takotako")
console.log(response)
Expand All @@ -62,19 +54,21 @@ return <>
<div class="w-[80%] mx-auto my-0">
<div class="">
<p class="text-white text-3xl mb-10 font-sans font-bold">アカウントを作成</p>
<form onSubmit={handleSubmit} class="">
{/*<label class="mb-5">
<div>ユーザーネーム</div>
<input type="text" class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline" placeholder="Username" value={username} onChange={handleUsernameChange} />
</label>*/}
{showForm || (<form onSubmit={handleSubmit} class="">
<label>
<div class="text-2xl">メールアドレス</div>
<input type="email" class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline" placeholder="Username" value={email} onChange={handleEmailChange} />
</label>
<div>
<input type="submit" value="送信" class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded" />
</div>
</form>
</form>)
}
{showForm && (
<div class="text-white text-3xl">送信されたで!本登録してや!</div>
)

}
</div>
</div>
</div>
Expand Down
2 changes: 2 additions & 0 deletions routes/privacypolicy.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
// routes/_app.tsx
import Header from '../components/Header.tsx'
import Footer from '../components/Footer.tsx'
// deno-lint-ignore no-explicit-any
function Title({ children }: any) {
return (
<h2 class="text-3xl text-left text-white font-size mt-14 border-b-2 border-indigo-500">{ children }</h2>
);
}
// deno-lint-ignore no-explicit-any
function Value({ children }: any) {
return (
<div class="ml-5">
Expand Down

0 comments on commit d37cb1b

Please sign in to comment.