After Width: | Height: | Size: 417 B |
After Width: | Height: | Size: 172 B |
After Width: | Height: | Size: 29 KiB |
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 24 KiB |
After Width: | Height: | Size: 28 KiB |
@ -0,0 +1,95 @@ |
||||
import React, { useState } from "react"; |
||||
|
||||
import removeCard from "../../assets/icons/card-remove.svg"; |
||||
|
||||
import sadEmoji from "../../assets/icons/sad-emoji.svg"; |
||||
import smileEmoji from "../../assets/icons/smile-emoji.svg"; |
||||
import speechlessEmoji from "../../assets/icons/speechless-emoji.svg"; |
||||
import suspiciousEmoji from "../../assets/icons/suspicious-emoji.svg"; |
||||
import heartEmoji from "../../assets/icons/heart-emoji.svg"; |
||||
import upwardArrow from "../../assets/icons/gray-upward-icon.svg"; |
||||
|
||||
const Feedback = ({ feedbacks }) => { |
||||
const [closeModal, setCloseModal] = useState(false); |
||||
const [activeFeedback, setActiveFeedback] = useState(null); |
||||
console.log(closeModal); |
||||
|
||||
return ( |
||||
<section |
||||
className="w-1/3 bg-white rounded shadow-sm border border-gray-500 mx-auto my-20 flex-col items-center justify-center relative" |
||||
style={{ display: closeModal ? "none" : "flex" }} |
||||
> |
||||
<div |
||||
className="bg-removeCardBgColor rounded-full p-2 absolute -top-5 right-10 cursor-pointer" |
||||
onClick={() => setCloseModal(true)} |
||||
> |
||||
<img src={removeCard} alt="" className="w-5" /> |
||||
</div> |
||||
<h2 className="mt-10 text-productPrice"> |
||||
نظر شما نسبت به رابط کاربری سایت جدیدمون چیه؟ |
||||
</h2> |
||||
<div className="flex flex-row w-full justify-between"> |
||||
{feedbacks.map((item, index) => ( |
||||
<div |
||||
className="flex flex-col items-center mt-7 w-full px-4 pb-8 relative cursor-pointer" |
||||
key={index} |
||||
onClick={() => setActiveFeedback(item)} |
||||
> |
||||
<img |
||||
src={item.icon} |
||||
alt="" |
||||
className="transition duration-300 transform hover:-translate-y-1" |
||||
/> |
||||
{activeFeedback === item && ( |
||||
<> |
||||
<p>{item.name}</p> |
||||
<img |
||||
src={upwardArrow} |
||||
alt="" |
||||
className="w-20 h-20 rounded-full absolute left-1/2 transform -translate-x-1/2 bottom-0 translate-y-2/3 z-10" |
||||
/> |
||||
</> |
||||
)} |
||||
</div> |
||||
))} |
||||
</div> |
||||
<textarea |
||||
className="resize-y w-full py-4 px-2 focus:outline-none text-sm h-44 z-20 bg-gray-100" |
||||
placeholder="به ما در رابطه تجربه کار با سایتمون بگید..." |
||||
></textarea> |
||||
<button |
||||
className="text-white rounded px-10 py-2 my-5 self-end ml-10" |
||||
style={{ backgroundColor: "#246E8A" }} |
||||
> |
||||
ارسال |
||||
</button> |
||||
</section> |
||||
); |
||||
}; |
||||
|
||||
export default Feedback; |
||||
|
||||
Feedback.defaultProps = { |
||||
feedbacks: [ |
||||
{ |
||||
icon: heartEmoji, |
||||
name: "عالی", |
||||
}, |
||||
{ |
||||
icon: smileEmoji, |
||||
name: "خوب", |
||||
}, |
||||
{ |
||||
icon: speechlessEmoji, |
||||
name: "اوکیه", |
||||
}, |
||||
{ |
||||
icon: sadEmoji, |
||||
name: "بد", |
||||
}, |
||||
{ |
||||
icon: suspiciousEmoji, |
||||
name: "خیلی بد", |
||||
}, |
||||
], |
||||
}; |
@ -0,0 +1,31 @@ |
||||
import React from "react"; |
||||
|
||||
import blackCancleIcon from "../../assets/icons/black-cancle-icon.svg"; |
||||
|
||||
const ProductTags = ({ |
||||
titleColor, |
||||
title, |
||||
tagBgColor, |
||||
tagBorderColor, |
||||
icon, |
||||
}) => { |
||||
return ( |
||||
<button |
||||
className={`flex flex-row items-center rounded border-2 m-1 px-2 py-0.5 text-base ${titleColor} ${tagBorderColor} ${tagBgColor} `} |
||||
> |
||||
{title} |
||||
{icon && <img src={icon} alt="" className="mr-5 w-2.5" />} |
||||
</button> |
||||
); |
||||
}; |
||||
|
||||
export default ProductTags; |
||||
|
||||
ProductTags.defaultProps = { |
||||
title: "کتاب", |
||||
titleColor: "text-blue-600", |
||||
tagBgColor: "bg-blue-300 bg-opacity-10", |
||||
tagBorderColor: "border-blue-200", |
||||
// for icons
|
||||
icon: blackCancleIcon, |
||||
}; |