Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kindergarten form component #112

Open
wants to merge 29 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
15fb074
Creating kindergadenName input and tow main buttons
Alaalser Feb 16, 2021
2d8c595
Add dcription input and droplist locations
Alaalser Feb 16, 2021
6575949
add shift time and mobile number inputs
Alaalser Feb 16, 2021
f2959da
remove placeholders
Alaalser Feb 16, 2021
5d27781
adding fees slider min and max values
Alaalser Feb 16, 2021
23cf078
style form
Alaalser Feb 16, 2021
a3c7695
Add form antd and upload fild
Alaalser Feb 16, 2021
1b87df2
add sececnd peroid
Alaalser Feb 16, 2021
5543544
remove setAdd from onClick
Alaalser Feb 16, 2021
ec93882
add upload more photos
Alaalser Feb 16, 2021
3a871df
add upload styles
Alaalser Feb 16, 2021
8975b80
Edit main upload
Alaalser Feb 16, 2021
2eda156
fix conf
Osama-you Feb 17, 2021
e47bd13
fix the form
Osama-you Feb 18, 2021
2ddb01d
fix the phone number
Osama-you Feb 18, 2021
bdde74b
Merge branch '107-signup-form' of https://github.com/GSG-G9/Rawdaty i…
Osama-you Feb 18, 2021
ca05561
Revert "Merge branch '107-signup-form' of https://github.com/GSG-G9/R…
Osama-you Feb 18, 2021
13ae509
edit droplist component
Alaalser Feb 18, 2021
db3d895
add useEffet for locatoin
Alaalser Feb 18, 2021
0d5d86c
edit style
Alaalser Feb 18, 2021
7b93e0a
edit droplist style
Alaalser Feb 18, 2021
4df8e88
Merge branch '55-kindergarten-form' of https://github.com/GSG-G9/Rawd…
Osama-you Feb 18, 2021
a6c1256
edit btn margin
Alaalser Feb 18, 2021
8a3fa8b
fix conf
Osama-you Feb 18, 2021
a194ab1
Merge branch '55-kindergarten-form' of https://github.com/GSG-G9/Rawd…
Osama-you Feb 18, 2021
4200a74
fix the modal hight
Osama-you Feb 18, 2021
b115aeb
add url cover input
Osama-you Feb 18, 2021
f392372
make the style resp
Osama-you Feb 18, 2021
ec9a56a
center the title and fix disInput
Osama-you Feb 18, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5,630 changes: 4,819 additions & 811 deletions client/package-lock.json

Large diffs are not rendered by default.

Binary file removed client/public/favicon.png
Binary file not shown.
2 changes: 1 addition & 1 deletion client/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html dir="rtl" lang="ar">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.png" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="description" content="Rawdaty is the first platform to help you choose your children's kindergarten" />
<link href='https://fonts.googleapis.com/css?family=Tajawal' rel='stylesheet'>
Expand Down
13 changes: 2 additions & 11 deletions client/src/App/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,8 @@ import { notification } from 'antd';

import NavBar from '../Components/Layout/Navbar';
import Footer from '../Components/Layout/Footer';
import KindergartenProfilePage from '../Pages/KindergartenProfilePage';

import SideBar from '../Components/Layout/SideBar';
import Home from '../Pages/HomePage';
import Signup from '../Pages/Signup';
import LoginPage from '../Pages/LoginPage';
import AuthContext from '../Context/AuthContext';
import LogoutContext from '../Context/LogoutContext';
Expand Down Expand Up @@ -87,19 +84,13 @@ const App = () => {
<About />
</Route>

<Route
exact
path="/kindergarten/:kindergartenId"
render={(props) => <KindergartenProfilePage {...props} />}
/>
<Route exact path="/kindergarten/:id" />

<Route exact path="/login">
{!role ? <LoginPage /> : <Redirect to="/" />}
</Route>

<Route exact path="/signup">
<Signup />
</Route>
<Route exact path="/signup" />

<Route exact path={['/', '/about', '/kindergarten/:id', '/search']}>
<Footer />
Expand Down
55 changes: 31 additions & 24 deletions client/src/Components/CommentContainer/index.js
Original file line number Diff line number Diff line change
@@ -1,40 +1,47 @@
import React, { useState } from 'react';
// import { List } from 'antd';
import React, { useState, useEffect } from 'react';
import { List } from 'antd';
import PropTypes from 'prop-types';
import Comment from '../Common/Comment';
import MainButton from '../Common/MainButton';

import './style.css';

const CommentContainer = ({ data, isAdmin }) => {
const [commentsToShow, setCommentsToShow] = useState([]);
const [next, setNext] = useState(3);
const commentsPerPage = 3;
const [limit, setLimit] = useState(commentsPerPage);

const loopWithSlice = (start, end) => {
const slicedComments = data.slice(start, end);
setCommentsToShow([...commentsToShow, ...slicedComments]);
};

const handleShowMoreComments = () => {
setLimit(commentsPerPage + limit);
loopWithSlice(next, next + commentsPerPage);
setNext(next + commentsPerPage);
};

useEffect(() => {
loopWithSlice(0, commentsPerPage);
}, []);

return (
<div>
<ul className="list">
{data.length !== 0 ? (
data.slice(0, limit).map((item) => (
<li key={item.id}>
<Comment
isAdmin={isAdmin}
userName={item.user_name}
commentText={item.comment}
date={item.create_at}
rateValue={item.rating}
/>
</li>
))
) : (
<Comment description="لا يوجد رياض أطفال" />
<List
split={false}
itemLayout="horizontal"
dataSource={commentsToShow}
renderItem={(item) => (
<List.Item>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<List.Item>
<List.Item key="should be unique string">

source: https://ant.design/components/list/
to get more understanding about the key in React have a look here: https://reactjs.org/docs/lists-and-keys.html

<Comment
isAdmin={isAdmin}
userName={item.user_name}
commentText={item.comment}
date={item.create_at}
rateValue={item.rating}
/>
</List.Item>
)}
</ul>

{data.length > limit && (
/>
{commentsToShow.length < data.length && (
<MainButton onClick={handleShowMoreComments}>
عرض المزيد من التعليقات
</MainButton>
Expand Down
3 changes: 0 additions & 3 deletions client/src/Components/CommentContainer/style.css

This file was deleted.

3 changes: 1 addition & 2 deletions client/src/Components/Common/Comment/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react';
import { Row, Col, Typography } from 'antd';
import PropTypes from 'prop-types';
import moment from 'moment';

import Rating from '../Rating';
import MainButton from '../MainButton';
Expand Down Expand Up @@ -31,7 +30,7 @@ const Comment = ({
<Row className="top-container">
<Rating rateValue={rateValue} />
<Title level={3} id="comment-date">
{moment(date).format('YYYY-MM-DD')}
{date}
</Title>
{isAdmin && (
<MainButton
Expand Down
2 changes: 1 addition & 1 deletion client/src/Components/Common/DropList/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@

.search-case {
height: 25px;
}
}
4 changes: 2 additions & 2 deletions client/src/Components/Common/NavTap/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@
height: 100px !important;
}

.ant-modal-content {
.modal .ant-modal-content {
height: 150px !important;
}

.ant-modal-body {
.modal .ant-modal-body {
display: flex;
align-items: center;
justify-content: center;
Expand Down
Loading