Skip to content

Commit

Permalink
Edit main upload
Browse files Browse the repository at this point in the history
Relates #55
  • Loading branch information
Alaalser committed Feb 16, 2021
1 parent 3a871df commit 8975b80
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
16 changes: 13 additions & 3 deletions client/src/Components/KindergartenForm/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const KindergartenForm = ({ onAdd, dorpListOptions, sliderMin, sliderMax }) => {
const [inputValue, setInputValue] = useState('');
const [add, setAdd] = useState(false);
const [fileList, setFileList] = useState([]);
const [pic, setPic] = useState([]);

const onClick = () => {
onAdd(inputValue, sliderValue, selectValue);
Expand All @@ -41,6 +42,10 @@ const KindergartenForm = ({ onAdd, dorpListOptions, sliderMin, sliderMax }) => {
setFileList(newFileList);
};

const onUpload1 = ({ main: onePicture }) => {
setPic(onePicture);
};

return (
<Form>
<Title className="title" level={5}>
Expand All @@ -62,8 +67,8 @@ const KindergartenForm = ({ onAdd, dorpListOptions, sliderMin, sliderMax }) => {
<Form.Item>
<MainInput
type="textArea"
textLabel="وصف عن الروضية :"
height="123px"
textLabel="وصف عن الروضة :"
height="75px"
width="471px"
onChange={onMainInputChange}
/>
Expand Down Expand Up @@ -95,7 +100,12 @@ const KindergartenForm = ({ onAdd, dorpListOptions, sliderMin, sliderMax }) => {
<div className="column">
<Form.Item className="main-upload">
<p>اضف صورة للروضة</p>
<Upload>
<Upload
listType="picture"
fileList={pic}
onChange={onUpload1}
maxCount={1}
>
<MainButton
height="48px"
width="471px"
Expand Down
7 changes: 3 additions & 4 deletions client/src/Components/KindergartenForm/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@

.title {
margin: 0 20px;
padding: 10px 250px;
padding: 5px 250px;
}

.btn-container {
display: flex;
align-content: space-between;
justify-content: center;
margin: 0 15px;
padding: 12px;
}

.form-container .ant-btn {
Expand All @@ -33,12 +32,12 @@

.slider-input {
position: relative;
top: 342px;
top: 249px;
}

.period2 {
position: relative;
top: 376px;
top: 328px;
}

.main-upload{
Expand Down

0 comments on commit 8975b80

Please sign in to comment.