update 5 files

master
Reza_ashrafi 2 years ago
parent ef69dbe468
commit b442d23e50
  1. 2
      src/components/Empty/index.js
  2. 2
      src/views/Dashboard/layouts/Main/index.js
  3. 17
      src/views/Favorites/index.js

@ -7,7 +7,7 @@ export const Empty = ({ text, buttonText, buttonAction }) => {
className="flex-1 flex flex-col justify-center items-center " className="flex-1 flex flex-col justify-center items-center "
style={{ minHeight: "calc(100vh - 120px)" }} style={{ minHeight: "calc(100vh - 120px)" }}
> >
<strong className="text-lg font-bold text-gray1">{text}</strong> <strong className="text-lg lg:text-tiny font-bold text-gray1">{text}</strong>
{buttonText && ( {buttonText && (
<button <button
className="transform translate-y-7 py-2 px-6 text-base rounded-md bg-blueC0 text-white cursor-pointer" className="transform translate-y-7 py-2 px-6 text-base rounded-md bg-blueC0 text-white cursor-pointer"

@ -22,7 +22,7 @@ const views = {
</div> </div>
</div> </div>
), ),
favorites: <Favorites />, bookmarks: <Favorites />,
addresses: <Addresses isDashboard={true} />, addresses: <Addresses isDashboard={true} />,
profile: <Profile />, profile: <Profile />,
addressForm: <Address isDashboard={true} />, addressForm: <Address isDashboard={true} />,

@ -6,6 +6,9 @@ import { publicApi, userFavorite } from "../../redux/actions";
import bookImage from "./book.svg"; import bookImage from "./book.svg";
import bookmarkIcon from "./bookmark.svg"; import bookmarkIcon from "./bookmark.svg";
//components
import Empty from "../../components/Empty";
const Favorites = ({ const Favorites = ({
bookmarkList, bookmarkList,
isMobile, isMobile,
@ -24,12 +27,16 @@ const Favorites = ({
// alert(); // alert();
window.scrollTo(0, 0); window.scrollTo(0, 0);
}, []); }, []);
return ( return (
<div className="flex flex-wrap"> <div className="flex flex-wrap flex-1">
{bookmarkList.map((bookmark, index) => ( {bookmarkList?.length ? (
<Bookmark key={index} bookmark={bookmark} /> bookmarkList.map((bookmark, index) => (
))} <Bookmark key={index} bookmark={bookmark} />
))
) : (
<Empty text="هیج موردی در علاقهمندیهای شما وجود ندارد." />
)}
</div> </div>
); );
}; };

Loading…
Cancel
Save