Skip to content

Commit 84ff242

Browse files
authored
Merge pull request #29 from openhacku-saboten/u-tan/signup
新規登録時のProfile入力ページの修正(`/signup`)
2 parents e2977a0 + 44f07cb commit 84ff242

File tree

1 file changed

+49
-12
lines changed

1 file changed

+49
-12
lines changed

pages/signup.tsx

+49-12
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,27 @@ import Head from 'next/head';
33
import { Grid, TextField, Button } from '@material-ui/core';
44
import React from 'react';
55

6-
const Home: NextPage = () => {
6+
const Signup: NextPage = () => {
7+
//登録ボタンが押されたときの処理
8+
function submit(): void {
9+
//Nameを取得
10+
const inputElementName = document.getElementById(
11+
'textareaName'
12+
) as HTMLInputElement;
13+
const inputValueName = inputElementName.value;
14+
//Discriptionを取得
15+
const inputElementDiscription = document.getElementById(
16+
'textareaDiscription'
17+
) as HTMLInputElement;
18+
const inputValueDiscription = inputElementDiscription.value;
19+
20+
if (inputValueName == '') {
21+
window.alert('名前が入力されていません。');
22+
return;
23+
}
24+
25+
alert('名前:' + inputValueName + '\n' + '説明:' + inputValueDiscription);
26+
}
727
return (
828
<>
929
<Head>
@@ -20,29 +40,46 @@ const Home: NextPage = () => {
2040
content="OmnisCode | コードを共有するSNS"
2141
/>
2242
</Head>
23-
<Grid container alignItems="center" justify="center">
24-
<Grid item xs={5}>
25-
<h1>プロフィール入力ページ</h1>
43+
<Grid
44+
container
45+
alignItems="center"
46+
justify="center"
47+
style={{ minHeight: '75vh' }}>
48+
<Grid item sm={5}>
49+
<h1 style={{ textAlign: 'center', marginBottom: '60px' }}>
50+
プロフィール入力ページ
51+
</h1>
2652
<h3>新規登録ありがとうございます。</h3>
2753
<p>このサイトで表示する名前を入力してください。</p>
2854
<TextField
29-
style={{ width: '100%', height: '80px' }}
30-
id="standard-basic"
55+
id="textareaName"
56+
style={{ width: '100%' }}
3157
label="UserName"
3258
/>
3359
<p>あなたのプロフィールを入力してください。</p>
3460
<TextField
35-
style={{ width: '100%', height: '80px' }}
36-
id="standard-basic"
61+
id="textareaDiscription"
62+
style={{ width: '100%' }}
3763
label="Discription"
3864
/>
39-
<Button size="large" variant="contained" color="primary">
40-
登録
41-
</Button>
65+
<Grid container alignItems="center" justify="center">
66+
<Button
67+
onClick={submit}
68+
size="large"
69+
variant="contained"
70+
color="primary"
71+
style={{
72+
marginBottom: '30px',
73+
marginTop: '30px',
74+
width: '60%',
75+
}}>
76+
登録
77+
</Button>
78+
</Grid>
4279
</Grid>
4380
</Grid>
4481
</>
4582
);
4683
};
4784

48-
export default Home;
85+
export default Signup;

0 commit comments

Comments
 (0)