@@ -3,7 +3,27 @@ import Head from 'next/head';
3
3
import { Grid , TextField , Button } from '@material-ui/core' ;
4
4
import React from 'react' ;
5
5
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
+ }
7
27
return (
8
28
< >
9
29
< Head >
@@ -20,29 +40,46 @@ const Home: NextPage = () => {
20
40
content = "OmnisCode | コードを共有するSNS"
21
41
/>
22
42
</ 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 >
26
52
< h3 > 新規登録ありがとうございます。</ h3 >
27
53
< p > このサイトで表示する名前を入力してください。</ p >
28
54
< TextField
29
- style = { { width : '100%' , height : '80px' } }
30
- id = "standard-basic"
55
+ id = "textareaName"
56
+ style = { { width : '100%' } }
31
57
label = "UserName"
32
58
/>
33
59
< p > あなたのプロフィールを入力してください。</ p >
34
60
< TextField
35
- style = { { width : '100%' , height : '80px' } }
36
- id = "standard-basic"
61
+ id = "textareaDiscription"
62
+ style = { { width : '100%' } }
37
63
label = "Discription"
38
64
/>
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 >
42
79
</ Grid >
43
80
</ Grid >
44
81
</ >
45
82
) ;
46
83
} ;
47
84
48
- export default Home ;
85
+ export default Signup ;
0 commit comments