Wishlist
Make the appearance of the Sledge wishlist app remain in line with the theme you have using the custom components that Sledge provides.
Available custom components :
Widget Alert
Widget Alert is custom component will show on top of wishlist page or wihslist pop up for notify not logged in user.
Build a custom component, e.g:
app/SledgeWishlistWidgetAlert.tsx
import { Link } from '@remix-run/react';
export default function SledgeWishlistWidgetAlert() {
return (
<div className="sledge-wishlist__widget-alert">
<div className="sledge-wishlist__widget-alert-text">
Please login to save your wishlist across devices.
<Link
to="/account/login"
className="sledge-wishlist__widget-alert-link"
>
Login Here
</Link>
</div>
</div>
);
};
Call custom component to prop
Only provide the function name (without ()
), see the API reference
<CustomComponent>
must be added as a child of another sledge's widget.
import { CustomComponents } from "@sledge-app/core";
import { Widget, WidgetHeader } from "@sledge-app/react-wishlist";
import SledgeWishlistWidgetAlert from "~/components/SledgeWishlistWidgetAlert";
export default function WishlistWidget() {
return (
<Widget.Root
query={{
shareId: "share",
}}
onAfterAddWishlist={(state) => {
// Your custom function
}}
onAfterRemoveWishlist={(state) => {
// Your custom function
}}
onAfterRenderProduct={(state) => {
// Your custom function
}}
>
<CustomComponents wishlistWidgetAlert={SledgeWishlistWidgetAlert}/>
<WidgetHeader>
<WidgetHeader.Title text="My Wishlist" />
<WidgetHeader.SearchForm placeholder="Search product" />
<WidgetHeader.ClearTrigger buttonText="Clear Wishlist" />
<WidgetHeader.ShareTrigger buttonText="Share Wishlist" />
<WidgetHeader.Sort />
<WidgetHeader.Limit options={[10, 25, 50, 100]} />
</WidgetHeader>
<Widget.List gridType="large" />
</Widget.Root>
);
}