Next Preview Work Final
This commit is contained in:
@@ -171,7 +171,7 @@ const CartDemo = () => {
|
||||
),
|
||||
Span({ class: 'text-lg font-bold' }, () => `Total: $${total()}`)
|
||||
]),
|
||||
cart().length === 0
|
||||
() => cart().length === 0
|
||||
? Div({ class: 'alert alert-soft text-center' }, 'Cart is empty')
|
||||
: Div({ class: 'flex flex-col gap-2' }, cart().map(item =>
|
||||
Div({ class: 'flex justify-between items-center p-2 bg-base-200 rounded-lg' }, [
|
||||
@@ -187,6 +187,7 @@ const CartDemo = () => {
|
||||
))
|
||||
]);
|
||||
};
|
||||
|
||||
$mount(CartDemo, '#demo-cart');
|
||||
```
|
||||
|
||||
@@ -235,7 +236,7 @@ const InboxDemo = () => {
|
||||
}
|
||||
}, 'Mark all read')
|
||||
]),
|
||||
Div({ class: 'flex flex-col gap-2' }, messages().map(msg =>
|
||||
Div({ class: 'flex flex-col gap-2' }, () => messages().map(msg =>
|
||||
Div({
|
||||
class: `p-3 rounded-lg cursor-pointer transition-all ${msg.read ? 'bg-base-200 opacity-60' : 'bg-primary/10 border-l-4 border-primary'}`,
|
||||
onclick: () => markAsRead(msg.id)
|
||||
@@ -247,6 +248,7 @@ const InboxDemo = () => {
|
||||
))
|
||||
]);
|
||||
};
|
||||
|
||||
$mount(InboxDemo, '#demo-inbox');
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user