Skip to content

Commit

Permalink
Fix/ilPhil#209 fix forms (ilPhil#210)
Browse files Browse the repository at this point in the history
  • Loading branch information
StefaniaGalazzo authored Feb 24, 2022
1 parent e88d5c0 commit 769407b
Show file tree
Hide file tree
Showing 11 changed files with 53 additions and 36 deletions.
4 changes: 2 additions & 2 deletions src/Pages/Likes/Likes.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

.main {
display: flex;
height: 100%;
height: 100vh;
justify-content: center;
background-color: $background;
padding: 10px 20px 20px 20px;
.image {
background-image: url("./../../libs/img/desktop-like.jpg");
background-size: cover;
background-position: center;
min-width: 400px;
flex-grow: 1;
position: relative;
margin-right: 10px;
&::before {
Expand Down
2 changes: 1 addition & 1 deletion src/Pages/Likes/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { useState, useEffect } from "react";
import PlaceHolder from "../../components/PlaceHolder";

const Likes = () => {
const user = useSelector(state => state.user);
const user = useSelector((state) => state.user);
const dispatch = useDispatch();

const [dataLikes, setDataLikes] = useState({ data: [], isRoom: null });
Expand Down
6 changes: 5 additions & 1 deletion src/Pages/NewRoom/NewRoom.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,20 @@
display: flex;
height: calc(100vh - 120px);
justify-content: center;
padding: 10px;

.image {
background-image: url("./../../libs/img/desktop.jpg");
background-size: cover;
background-position: center;
flex-grow: 1;
position: relative;
height: 90vh;
&::before {
content: "";
position: absolute;
width: 100%;
height: calc(100vh - 120px);
height: 100%;
background: linear-gradient(
0deg,
rgba(72, 0, 48, 0.68) 0%,
Expand All @@ -25,6 +28,7 @@
display: flex;
justify-content: center;
align-items: center;
padding-top: 100px;
}
@media all and (max-width: 990px) {
.image {
Expand Down
9 changes: 5 additions & 4 deletions src/Pages/Rooms/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import CitiesFilter from "./../../components/CitiesFilter";
import PlaceHolder from "../../components/PlaceHolder";

const Rooms = () => {
const user = useSelector(state => state.user);
const user = useSelector((state) => state.user);
const [roomsList, setRoomList] = useState([]);
const [result, setResult] = useState(false);
const [filter, setFilter] = useState({
Expand All @@ -16,7 +16,7 @@ const Rooms = () => {
});

useEffect(() => {
httpPOST("/getrooms", user.iam).then(data => setRoomList(data));
httpPOST("/getrooms", user.iam).then((data) => setRoomList(data));
}, [user.iam]);

const setNoFilter = () => {
Expand All @@ -28,6 +28,7 @@ const Rooms = () => {

return (
<div className={styles.main}>
{console.log(result)}
<h3 className={styles.title}>Find your perfect Room!</h3>
<div className={styles.filter}>
<CitiesFilter
Expand All @@ -42,8 +43,8 @@ const Rooms = () => {
</button>
</div>
{roomsList.map(
room =>
!user.matches.map(item => item.roomId).includes(room._id) &&
(room) =>
!user.matches.map((item) => item.roomId).includes(room._id) &&
room.roomOwner !== user._id &&
(filter.city ? (
filter.city === room.city && (
Expand Down
31 changes: 16 additions & 15 deletions src/components/AddRoomAdForm/adsSteps/FirstStepForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,22 @@ const FirstStepForm = ({
/>
<span>,00 €/month</span>
</div>
<div className={styles.address}>
<label className={styles.label} htmlFor="address">
Address
</label>
<input
className={styles.adressInput}
value={values.roomAddress}
onChange={handleFormData("roomAddress")}
name="roomAddress"
id="roomAddress"
type="text"
placeholder="via della felicità"
required
/>
</div>

<div className={styles.roomType}>
<label className={styles.label} htmlFor="roomtype">
Room type*
Expand Down Expand Up @@ -66,21 +82,6 @@ const FirstStepForm = ({
values={values}
/>
</div>
<div className={styles.address}>
<label className={styles.label} htmlFor="address">
Address
</label>
<input
className={styles.adressInput}
value={values.roomAddress}
onChange={handleFormData("roomAddress")}
name="roomAddress"
id="roomAddress"
type="text"
placeholder="via della felicità"
required
/>
</div>
<fieldset className={styles.fieldset}>
<legend>About the flat</legend>
<section>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
margin: 0 auto;
.label {
font-size: $superSmall;
margin: 30px 0 5px 0;
margin: 25px 0 5px 0;
}
.rent {
margin: 20px 0 0;
Expand Down Expand Up @@ -106,7 +106,7 @@
}

.address {
margin: 25px auto;
margin: 15px 0;
.adressInput {
text-align: center;
margin-left: 10px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
object-fit: cover;
width: 100px;
height: 100px;
margin: 5px 0;
}

.formWrapper {
Expand Down Expand Up @@ -84,8 +85,8 @@
font-weight: bold;
text-align: center;
line-height: 100px;
margin: 5px 0;
cursor: pointer;
margin: 5px 0;
}
.hidden {
cursor: default;
Expand Down
18 changes: 10 additions & 8 deletions src/components/AddRoomAdForm/adsSteps/ThirdStepForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,16 @@ const ThirdStepForm = ({ formData, prevStep }) => {
return (
<div className={styles.containerForm}>
<ul>
<li className={styles.li1}>
<h4>Room Type:</h4>
{formData.roomType}
</li>
<li className={styles.li1}>
<h4>Rent Price:</h4>
{formData.rentPrice} €/month
</li>
<div className={styles.rentFlex}>
<li className={styles.rentLi}>
<h4>Room Type:</h4>
{formData.roomType}
</li>
<li>
<h4>Rent Price:</h4>
{formData.rentPrice} €/month
</li>
</div>
<li className={styles.li1}>
<h4>Address:</h4>
{formData.roomAddress}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,18 @@
.containerForm {
color: darken($mainLightBlue, 13);
width: 260px;
margin: 60px auto;
margin: 50px auto;
ul {
list-style: none;
font-size: 12px;
.rentFlex {
display: flex;
justify-content: flex-start;
gap: 50px;
}
.li1 {
display: flex;
margin: 15px 0;
margin: 20px 0;
h4 {
margin-right: 10px;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@import "./../../libs/variables.scss";

.main {
// padding-top: 30px;
.closeBtn {
border: none;
background-color: rgba(80, 80, 80, 0);
Expand All @@ -24,6 +25,7 @@
justify-content: space-between;
margin: 30px auto;
position: relative;
z-index: 1;
}
.stepCounter {
width: 1.5rem;
Expand Down
1 change: 1 addition & 0 deletions src/components/HeaderForms/HeaderForms.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
justify-content: space-between;
margin: 30px auto;
position: relative;
z-index: 1;
}
.stepCounter {
width: 1.5rem;
Expand Down

0 comments on commit 769407b

Please sign in to comment.