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. 15
      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,
@ -26,10 +29,14 @@ const Favorites = ({
}, []); }, []);
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