Skip to content

Commit

Permalink
Creating kindergadenName input and tow main buttons
Browse files Browse the repository at this point in the history
Relates #55
  • Loading branch information
Alaalser committed Feb 16, 2021
1 parent 0f1d2f2 commit 15fb074
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 11 deletions.
15 changes: 4 additions & 11 deletions client/src/App/index.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
import React from 'react';
import { BrowserRouter as Router, Route, Switch } from 'react-router-dom';
import NavBar from '../Components/Layout/Navbar';
import Footer from '../Components/Layout/Footer';
import Home from '../Pages/HomePage';
import { BrowserRouter as Router } from 'react-router-dom';
import KindergartenForm from '../Components/KindergartenForm';

import './style.css';

const App = () => (
<Router>
<NavBar userName="Alaa" isAdmin={false} />
<Switch>
<Route exact to="/">
<Home />
</Route>
</Switch>
<Footer />
<KindergartenForm />
</Router>
);

Expand Down
64 changes: 64 additions & 0 deletions client/src/Components/KindergartenForm/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
import React, { useState } from 'react';
import { Typography } from 'antd';
import PropTypes from 'prop-types';

import MainInput from '../Common/MainInput';
import MainButton from '../Common/MainButton';

const { Title } = Typography;

const KindergartenForm = ({ onAdd }) => {
const [inputValue, setInputValue] = useState('');

const onClick = () => {
onAdd(inputValue);
};

const onMainInputChange = (e) => {
setInputValue(e.target.value);
};
return (
<div>
<Title className="price-text" level={5}>
اضافة روضة
</Title>
<hr />
<h3>
اسم الروضة:
<MainInput
type="text"
height="48px"
width="471px"
onChange={onMainInputChange}
/>
</h3>
<MainButton
className="Search-btn red-Search-btn"
onClick={onClick}
height="52px"
width="122px"
border="1.6px solid #69938F"
backgroundColor="var(--main-color)"
>
إضافة
</MainButton>
<MainButton
className="Search-btn red-Search-btn"
onClick={onClick}
height="52px"
width="122px"
border="1.6px solid #69938F"
backgroundColor="#FFF"
color="#000"
>
تجاهل
</MainButton>
</div>
);
};

export default KindergartenForm;

KindergartenForm.propTypes = {
onAdd: PropTypes.func.isRequired,
};
Empty file.

0 comments on commit 15fb074

Please sign in to comment.