forked from dev-triangle/Wanderlust-frontend
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
34,920 additions
and
15,716 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
.review_form__container{ | ||
width: 100%; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
padding: 3rem; | ||
} | ||
.review_main_form{ | ||
display: flex; | ||
flex-direction: column; | ||
gap: 2rem; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import React, { useState } from 'react' | ||
import './ReviewDialog.css' | ||
import Dialog from '@mui/material/Dialog'; | ||
import axiosInstance from '../../utils/axios'; | ||
import { useEffect } from 'react'; | ||
import baseUrl from '../../utils/Urls'; | ||
const ReviewDialog = ({open,handleClose}) => { | ||
const[description,setDescription]=useState('') | ||
const[rate,setRate]=useState(0) | ||
const[currUser,setCurrUser]=useState('') | ||
const[currUserId,setCurrUserId]=useState() | ||
|
||
useEffect(()=>{ | ||
axiosInstance.get(`${baseUrl}/current-user/`).then((response)=>{ | ||
setCurrUser(response.data.username) | ||
setCurrUserId(response.data.id) | ||
},(error)=>{ | ||
|
||
}) | ||
},[]) | ||
const handleSubmit=()=>{ | ||
axiosInstance.post(`${baseUrl}/reviews/`,{ | ||
desc: description, | ||
rate: rate, | ||
user_name: currUser, | ||
user_foreign: currUserId | ||
}).then((response)=>{ | ||
console.log(response) | ||
},(error)=>{ | ||
|
||
}) | ||
} | ||
return ( | ||
<div> | ||
<Dialog | ||
fullWidth={true} | ||
maxWidth={"md"} | ||
PaperProps={{ | ||
sx: { width: "100%", borderRadius: 5, m: 2, minHeight: "60vh" }, | ||
}} | ||
open={open} | ||
onClose={handleClose} | ||
aria-labelledby="alert-dialog-title" | ||
aria-describedby="alert-dialog-description"> | ||
<div className="review_form__container"> | ||
<form className='review_main_form' onSubmit={handleSubmit}> | ||
<input type='text' placeholder='Description'value={description} onChange={(e)=>{setDescription(e.target.value)}}/> | ||
<input type="number" placeholder='Enter your rating out of 10' value={rate} onChange={(e)=>{setRate(e.target.value)}}/> | ||
<button type='submit'>Submit</button> | ||
</form> | ||
</div> | ||
|
||
|
||
</Dialog> | ||
</div> | ||
) | ||
} | ||
|
||
export default ReviewDialog |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import React from 'react' | ||
import './ReviewPage.css' | ||
function ReviewCards({ desc,rate,name }) { | ||
return ( | ||
<section class="t-bq-section" id="paul"> | ||
<div class="t-bq-wrapper t-bq-wrapper-boxed"> | ||
<div class="t-bq-quote t-bq-quote-paul"> | ||
<div class="t-bq-quote-paul-userpic"></div> | ||
<div class="t-bq-quote-paul-qmark"> | ||
❝ | ||
</div> | ||
<div class="t-bq-quote-paul-pattern"> | ||
</div> | ||
<div class="t-bq-quote-paul-base"> | ||
<blockquote class="t-bq-quote-paul-text" cite="Strugatsky Brothers"> | ||
{desc} | ||
</blockquote> | ||
<div class="t-bq-quote-paul-meta"> | ||
<div class="t-bq-quote-paul-meta-info"> | ||
<div class="t-bq-quote-paul-author"><cite>{name}</cite></div> | ||
<div class="t-bq-quote-paul-source"><span className='rating__text'>Rating {rate}</span></div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</section> | ||
|
||
) | ||
} | ||
|
||
export default ReviewCards |
Oops, something went wrong.