Showing
3 changed files
with
34 additions
and
23 deletions
... | @@ -16,7 +16,7 @@ | ... | @@ -16,7 +16,7 @@ |
16 | 16 | ||
17 | - ๊น๋ค์ (2017110268) | 17 | - ๊น๋ค์ (2017110268) |
18 | 18 | ||
19 | -#### | 19 | +#### Start |
20 | - `$ yarn global add create-react-app` | 20 | - `$ yarn global add create-react-app` |
21 | - `$ create-react-app teleprompt-sst` | 21 | - `$ create-react-app teleprompt-sst` |
22 | - `$ yarn add @material-ui/core` | 22 | - `$ yarn add @material-ui/core` |
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
... | @@ -24,7 +24,7 @@ | ... | @@ -24,7 +24,7 @@ |
24 | work correctly both with client-side routing and a non-root public URL. | 24 | work correctly both with client-side routing and a non-root public URL. |
25 | Learn how to configure a non-root public URL by running `npm run build`. | 25 | Learn how to configure a non-root public URL by running `npm run build`. |
26 | --> | 26 | --> |
27 | - <title>React App</title> | 27 | + <title>ํ๋กฌํํฐ ์๋น์ค</title> |
28 | </head> | 28 | </head> |
29 | <body> | 29 | <body> |
30 | <noscript>You need to enable JavaScript to run this app.</noscript> | 30 | <noscript>You need to enable JavaScript to run this app.</noscript> | ... | ... |
1 | import React, { Component, Fragment } from 'react'; | 1 | import React, { Component, Fragment } from 'react'; |
2 | import './App.css'; | 2 | import './App.css'; |
3 | -import { withStyles, Typography, Paper, Button} from '@material-ui/core'; | 3 | +import { withStyles, Typography, Paper, Button, TextField} from '@material-ui/core'; |
4 | -import TextField from '@material-ui/core/TextField'; | ||
5 | 4 | ||
6 | const styles = theme => ({ | 5 | const styles = theme => ({ |
7 | root: { | 6 | root: { |
... | @@ -12,44 +11,56 @@ const styles = theme => ({ | ... | @@ -12,44 +11,56 @@ const styles = theme => ({ |
12 | }, | 11 | }, |
13 | }, | 12 | }, |
14 | title: { | 13 | title: { |
15 | - marginTop: 150, | 14 | + marginTop: theme.spacing.unit * 5, |
16 | textAlign: 'center', | 15 | textAlign: 'center', |
17 | display: 'none', | 16 | display: 'none', |
18 | - fontSize: '3.0rem', | 17 | + fontSize: '2.0rem', |
19 | [theme.breakpoints.up('sm')]: { | 18 | [theme.breakpoints.up('sm')]: { |
20 | display: 'block', | 19 | display: 'block', |
21 | - // fontSize: '20', | ||
22 | } | 20 | } |
23 | }, | 21 | }, |
24 | paper: { | 22 | paper: { |
25 | - marginTop: 100, | 23 | + marginTop: theme.spacing.unit * 5, |
26 | - marginLeft: 500, | 24 | + marginLeft: theme.spacing.unit * 20, |
27 | - marginRight: 500 | 25 | + marginRight: theme.spacing.unit * 20 |
28 | }, | 26 | }, |
29 | button: { | 27 | button: { |
30 | - marginTop: 15, | 28 | + marginTop: theme.spacing.unit * 1, |
31 | - marginLeft: 1320, | 29 | + marginLeft: theme.spacing.unit * 20, |
30 | + fontSize: '1rem', | ||
32 | }, | 31 | }, |
33 | }); | 32 | }); |
34 | 33 | ||
35 | class App extends Component { | 34 | class App extends Component { |
35 | + constructor(props) { | ||
36 | + super(props); | ||
37 | + this.state = { | ||
38 | + script: '' | ||
39 | + } | ||
40 | + } | ||
41 | + | ||
42 | + // Get Script | ||
43 | + getScript = (e) => { | ||
44 | + this.script = e.target.value; | ||
45 | + } | ||
46 | + | ||
47 | + // Send script to server && Move Next URL | ||
48 | + handleScriptSubmit = (e) => { | ||
49 | + console.log(this.script); // test | ||
50 | + } | ||
51 | + | ||
36 | render() { | 52 | render() { |
37 | const { classes } = this.props; | 53 | const { classes } = this.props; |
38 | return ( | 54 | return ( |
39 | - <> | 55 | + <Fragment> |
40 | - <Typography className={classes.title} variant="h6" color="inherit" noWrap> | 56 | + <Typography className={classes.title} variant="h6" color="inherit" noWrap>์์ฑ์ ๋ง์ถฐ ๋๋ณธ์ ํ๋ฉด์ ์ค์๊ฐ์ผ๋ก ์ถ๋ ฅํ๋ ํ๋กฌํํฐ ์๋น์ค</Typography> |
41 | - ์์ฑ์ ๋ง์ถฐ ๋๋ณธ์ ํ๋ฉด์ ์ค์๊ฐ์ผ๋ก ์ถ๋ ฅํ๋ ํ๋กฌํํฐ ์๋น์ค | ||
42 | - </Typography> | ||
43 | <Paper className={classes.paper} elevation={3}> | 57 | <Paper className={classes.paper} elevation={3}> |
44 | - <TextField id="outlined-textarea" label="Script๋ฅผ ์ ๋ ฅํด์ฃผ์ธ์." fullWidth="true" rows={20} placeholder="Script" multiline variant="outlined"/> | 58 | + <TextField id="outlined-textarea" label="Script๋ฅผ ์ ๋ ฅํด์ฃผ์ธ์." fullWidth="true" rows={20} placeholder="Script" multiline variant="outlined" onChange={this.getScript}/> |
45 | </Paper> | 59 | </Paper> |
46 | - <Button className={classes.button} variant="contained" color="primary">์์ํฉ๋๋ค.</Button> | 60 | + <Button className={classes.button} variant="contained" color="primary" size="medium" onClick={this.handleScriptSubmit}>์์ํฉ๋๋ค.</Button> |
47 | - </> | 61 | + </Fragment> |
48 | ); | 62 | ); |
49 | } | 63 | } |
50 | } | 64 | } |
51 | 65 | ||
52 | -// export default makeStyles(useStyles)(App); | 66 | +export default withStyles(styles)(App); |
53 | -// export default App; | ||
54 | -export default withStyles(styles)(App); | ||
55 | - | ||
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
-
๋ณ๊ฒฝ ์ฌํญ
- App.js์ TextField์ ์ฌ์ฉ์๊ฐ ๋๋ณธ์ ์ ๋ ฅํ ๋๋ง๋ค script ๋ณ์์ ์๋์ ์ผ๋ก ํ ๋นํด์ฃผ๋ Event handling์ธ getScript() ์ถ๊ฐ
- App.js์ Button์ ์ฌ์ฉ์๊ฐ ๋๋ฅด๋ฉด getScript()๋ก ์ป์ด์ง script๋ณ์๋ฅผ ์ฒ๋ฆฌํด์ฃผ๋ Event handling์ธ handleScriptSubmit() ์ถ๊ฐ
- ํ์ฌ ์์๋ก ์ฝ์์ script๊ฐ log ๋๋๋ก ๊ตฌํํ์๋ค.
- ์์ผ๋ก script ๋ณ์๋ฅผ Server๋ก ์ฎ๊ฒจ ์ฒ๋ฆฌํด์ฃผ๊ณ ๋ค์ ํ๋ฉด์ผ๋ก ๋์ด๊ฐ๋๋ก ๊ตฌํ ์์
- ๋ฉ์ธํ๋ฉด์ ์ ์ฒด layout์ ๋ณ๊ฒฝํจ
-
Please register or login to post a comment