diff options
author | 2022-07-11 19:44:42 +0000 | |
---|---|---|
committer | 2022-07-11 19:44:42 +0000 | |
commit | c8ca528bba61434ddc5aad993fa9d918458db16e (patch) | |
tree | 404feed8d49eec324d56f71b25521e97b61aa2e9 | |
parent | faf3f3a8d111b543c0aca12432fe1a2ee5e2d726 (diff) | |
download | astro-c8ca528bba61434ddc5aad993fa9d918458db16e.tar.gz astro-c8ca528bba61434ddc5aad993fa9d918458db16e.tar.zst astro-c8ca528bba61434ddc5aad993fa9d918458db16e.zip |
[ci] format
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>; } |