Skip to content

Commit

Permalink
설문폼 추가(추가작업필요)
Browse files Browse the repository at this point in the history
  • Loading branch information
JongJong00 committed Jan 19, 2023
1 parent 94d9233 commit 3ad38a1
Show file tree
Hide file tree
Showing 5 changed files with 147 additions and 5 deletions.
8 changes: 6 additions & 2 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@

import './App.css';
import Detail from './Components/Detail';
import { Routes, Route } from 'react-router-dom';
import Survey from './Components/Survey';
function App() {
return (
<div className="App">
<Detail />
<Routes>
<Route path="/" element={<Detail />} />
<Route path="/survey" element={<Survey />} />
</Routes>
</div>
);
}
Expand Down
6 changes: 4 additions & 2 deletions src/Components/Detail.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { CarryOutOutlined, CommentOutlined } from '@ant-design/icons';
import { Badge, Divider, Space } from 'antd';
import { Tag } from 'antd';
import styled from 'styled-components';
import "../App.css";

const Detail = () => {

Expand All @@ -28,7 +27,7 @@ import "../App.css";

]


return (


Expand All @@ -42,7 +41,10 @@ import "../App.css";
<Header>
<h1>동역학</h1>
<h5>CRTR23423</h5>

</Header>





Expand Down
85 changes: 85 additions & 0 deletions src/Components/Form.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
import { Button, Checkbox, Form, Input } from 'antd';

function SurveyForm() {

const onFinish = (values) => {
console.log('Success:', values);
};
const onFinishFailed = (errorInfo) => {
console.log('Failed:', errorInfo);
};

const { TextArea } = Input;

return (
<Form
name="basic"
labelCol={{
span: 8,
}}
wrapperCol={{
span: 16,
}}
initialValues={{
remember: true,
}}
onFinish={onFinish}
onFinishFailed={onFinishFailed}
autoComplete="off"
>
<Form.Item
label="회신받을 이메일"
name="회신받을 이메일"
rules={[
{
required: true,
message: '이메일을 입력하세요',
},
]}
>
<Input />
</Form.Item>

<Form.Item
label="제목"
name="제목"
rules={[
{
required: true,
message: '제목을 입력하세요',
},
]}
>
<Input.Password />
</Form.Item>

<Form.Item label="내용">
<TextArea rows={10} />
</Form.Item>

<Form.Item
name="remember"
valuePropName="checked"
wrapperCol={{
offset: 8,
span: 16,
}}
>
<Checkbox>본인입니다</Checkbox>
</Form.Item>

<Form.Item
wrapperCol={{
offset: 8,
span: 16,
}}
>
<Button type="primary" htmlType="submit">
제출
</Button>
</Form.Item>
</Form>
);
}

export default SurveyForm;
46 changes: 46 additions & 0 deletions src/Components/Survey.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import SurveyForm from './Form';
import { Card } from 'antd';
import styled from 'styled-components';
const Survey = () => {

return(

<>
<LightYellowBack>
<Wrapping>

<Card bordered={false}>


<h2>피드백/문의</h2>
<SurveyForm />


</Card>
</Wrapping>
</LightYellowBack>
</>

)




}

const LightYellowBack = styled.div`
background-color : #fcd469;
`;

const Wrapping = styled.div`
position: relative;
margin-left : 200px;
margin-right : 200px;
width : 75%
display : flex;
justify-content: center;
align-items: center;
`;


export default Survey;
7 changes: 6 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,16 @@ import ReactDOM from 'react-dom/client';
import './index.css';
import App from './App';
import reportWebVitals from './reportWebVitals';
import { Routes, Route, BrowserRouter } from 'react-router-dom';

const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(
<React.StrictMode>
<App />
<BrowserRouter>
<Routes>
<Route path="/*" element={<App />} />
</Routes>
</BrowserRouter>
</React.StrictMode>
);

Expand Down

0 comments on commit 3ad38a1

Please sign in to comment.