summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--examples/with-nanostores/src/cartStore.ts2
-rw-r--r--examples/with-nanostores/src/components/AddToCartForm.tsx8
-rw-r--r--examples/with-nanostores/src/components/CartFlyout.tsx6
-rw-r--r--examples/with-nanostores/src/components/CartFlyoutToggle.tsx5
4 files changed, 8 insertions, 13 deletions
diff --git a/examples/with-nanostores/src/cartStore.ts b/examples/with-nanostores/src/cartStore.ts
index 21543a73e..f490a2447 100644
--- a/examples/with-nanostores/src/cartStore.ts
+++ b/examples/with-nanostores/src/cartStore.ts
@@ -7,7 +7,7 @@ export type CartItem = {
name: string;
imageSrc: string;
quantity: number;
-}
+};
export type CartItemDisplayInfo = Pick<CartItem, 'id' | 'name' | 'imageSrc'>;
diff --git a/examples/with-nanostores/src/components/AddToCartForm.tsx b/examples/with-nanostores/src/components/AddToCartForm.tsx
index 2f1befb9f..7498443f6 100644
--- a/examples/with-nanostores/src/components/AddToCartForm.tsx
+++ b/examples/with-nanostores/src/components/AddToCartForm.tsx
@@ -5,7 +5,7 @@ import type { ComponentChildren } from 'preact';
type Props = {
item: CartItemDisplayInfo;
children: ComponentChildren;
-}
+};
export default function AddToCartForm({ item, children }: Props) {
function addToCart(e: SubmitEvent) {
@@ -14,9 +14,5 @@ export default function AddToCartForm({ item, children }: Props) {
addCartItem(item);
}
- return (
- <form onSubmit={addToCart}>
- {children}
- </form>
- )
+ return <form onSubmit={addToCart}>{children}</form>;
}
diff --git a/examples/with-nanostores/src/components/CartFlyout.tsx b/examples/with-nanostores/src/components/CartFlyout.tsx
index 29fd7a882..98fd8cbfb 100644
--- a/examples/with-nanostores/src/components/CartFlyout.tsx
+++ b/examples/with-nanostores/src/components/CartFlyout.tsx
@@ -10,7 +10,7 @@ export default function CartFlyout() {
<aside hidden={!$isCartOpen} className={styles.container}>
{Object.values($cartItems).length ? (
<ul className={styles.list} role="list">
- {Object.values($cartItems).map(cartItem => (
+ {Object.values($cartItems).map((cartItem) => (
<li className={styles.listItem}>
<img className={styles.listItemImg} src={cartItem.imageSrc} alt={cartItem.name} />
<div>
@@ -20,7 +20,9 @@ export default function CartFlyout() {
</li>
))}
</ul>
- ) : <p>Your cart is empty!</p>}
+ ) : (
+ <p>Your cart is empty!</p>
+ )}
</aside>
);
}
diff --git a/examples/with-nanostores/src/components/CartFlyoutToggle.tsx b/examples/with-nanostores/src/components/CartFlyoutToggle.tsx
index 9c94bc831..14ce1c70d 100644
--- a/examples/with-nanostores/src/components/CartFlyoutToggle.tsx
+++ b/examples/with-nanostores/src/components/CartFlyoutToggle.tsx
@@ -1,10 +1,7 @@
import { useStore } from '@nanostores/preact';
import { isCartOpen } from '../cartStore';
-
export default function CartFlyoutToggle() {
const $isCartOpen = useStore(isCartOpen);
- return (
- <button onClick={() => isCartOpen.set(!$isCartOpen)}>Cart</button>
- )
+ return <button onClick={() => isCartOpen.set(!$isCartOpen)}>Cart</button>;
}