Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
aindree-2005 committed Dec 10, 2023
1 parent ec3ec36 commit 7496775
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 55 deletions.
32 changes: 26 additions & 6 deletions client/src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ a {
/* text-align: center; */
}
.button:hover {
background-color: #d7a9eb;
color: #5b1c36;
background-color: #232f3e;
color:#e645bb ;
}
/* Header Part */

Expand Down Expand Up @@ -536,7 +536,11 @@ footer .input-group-text {
.auth-card{
padding: 10px;
background-color:#decaec;
width: 800px;
width: 600px;
padding-left: 100px;
padding-right:100px;
padding-top:50px;
padding-bottom:20px;
margin: 30px auto;
/* margin-top: 5px; */
border-radius: 10px;
Expand Down Expand Up @@ -839,8 +843,24 @@ footer .input-group-text {
::-webkit-scrollbar-corner {
background-color: #fff; /* Set the color of the scrollbar corner (if needed) */
}
.divname{
background-color: #270536;
border-width: 2px;
.divname:hover{
background-color: #e645bb;
border-spacing: 5px;
border-radius: 10px;
}

.Scroll2topBtn{
padding: 20px;
background-color:#decaec;
padding: 10px;
text-align: center;
position: static;
left: 50px;
bottom: 110px;
float: right;
color: #131921;
font-size: 20px;
font-weight: 400;


}
29 changes: 28 additions & 1 deletion client/src/components/SpecialProduct.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
import React, { useEffect } from "react";
import React, { useEffect,useState } from "react";
import ReactStars from "react-rating-stars-component";
import { useDispatch, useSelector } from "react-redux";
import { Link, useParams } from "react-router-dom";
import { getShop } from "../actions/shopActions";
import Loader from "./Loader";

const SpecialProduct = () => {
const [showButton, setShowButton] = useState(false);

const scrollTop = () => {
window.scrollTo({
top: 10,
behavior: 'smooth'
});
}
const { keyword } = useParams();
const { location } = useParams();
const dispatch = useDispatch();
Expand All @@ -14,6 +22,18 @@ const SpecialProduct = () => {
useEffect(() => {
dispatch(getShop(keyword));
}, [dispatch]);
useEffect(() => {

const handleScroll = () => {
if (window.scrollY > 50) {
setShowButton(true);
}else {
setShowButton(false);
}
};
window.addEventListener('scroll', handleScroll);
return () => window.removeEventListener('scroll', handleScroll);
},[])

return (
<>
Expand Down Expand Up @@ -50,6 +70,13 @@ const SpecialProduct = () => {
</div>
</div>
))}
<div className="Scroll2top">
{showButton && (
<button className="Scroll2topBtn" onClick={scrollTop}>
Back to Top
</button>
)}
</div>
</div>
</>
);
Expand Down
46 changes: 0 additions & 46 deletions client/src/constants/top-button.jsx

This file was deleted.

2 changes: 1 addition & 1 deletion client/src/pages/CreateItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ const CreateItem = () => {
<Container class1="login-wrapper py-3 home-wrapper-2">
<div className="row">
<div className="col-12">
<h3 className=" d-flex text-align-center justify-content-center">Add Item</h3>
<div className="auth-card">
<h4 className=" d-flex text-align-center justify-content-center">Add Item</h4>
<form onSubmit={handleSubmit} className="d-flex flex-column gap-15">
<CustomInput
type="text"
Expand Down
3 changes: 2 additions & 1 deletion client/src/pages/CreateStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,9 @@ const CreateStore = () => {
<Container class1="login-wrapper py-3 home-wrapper-2">
<div className="row">
<div className="col-12">
<h3 className=" d-flex text-align-center justify-content-center">Create store!</h3>
<div className="auth-card">
<h3 className=" d-flex text-align-center justify-content-center">Create store!</h3>

<form onSubmit={handleSubmit} className="d-flex flex-column gap-15">
<CustomInput
type="text"
Expand Down

0 comments on commit 7496775

Please sign in to comment.