diff options
author | 2022-11-08 18:39:22 +0000 | |
---|---|---|
committer | 2022-11-08 18:39:22 +0000 | |
commit | dcdeca56acb6c03d4868ece51ef4611e7598e270 (patch) | |
tree | f8731cc4f82f335c00a4a9a7f4b573d277b84a3e /examples/hackernews/src | |
parent | 0dcdc6fb1e6160c8a225a65c4810f565e2b673b5 (diff) | |
download | astro-dcdeca56acb6c03d4868ece51ef4611e7598e270.tar.gz astro-dcdeca56acb6c03d4868ece51ef4611e7598e270.tar.zst astro-dcdeca56acb6c03d4868ece51ef4611e7598e270.zip |
[ci] format
Diffstat (limited to 'examples/hackernews/src')
-rw-r--r-- | examples/hackernews/src/components/Comment.astro | 2 | ||||
-rw-r--r-- | examples/hackernews/src/components/For.astro | 16 | ||||
-rw-r--r-- | examples/hackernews/src/components/Nav.astro | 12 | ||||
-rw-r--r-- | examples/hackernews/src/pages/users/[id].astro | 2 |
4 files changed, 18 insertions, 14 deletions
diff --git a/examples/hackernews/src/components/Comment.astro b/examples/hackernews/src/components/Comment.astro index 50fa3e9e4..8327e666c 100644 --- a/examples/hackernews/src/components/Comment.astro +++ b/examples/hackernews/src/components/Comment.astro @@ -16,7 +16,7 @@ const { comment } = Astro.props; <a href={`/users/${comment.user}`}>{comment.user}</a>{' '} {comment.time_ago} ago </div> - <div class="text" set:html={comment.content}></div> + <div class="text" set:html={comment.content} /> <Show when={comment.comments.length}> <Toggle open> <For each={comment.comments}>{(comment: IComment) => <Astro.self comment={comment} />}</For> diff --git a/examples/hackernews/src/components/For.astro b/examples/hackernews/src/components/For.astro index b784f8f8a..885c22a65 100644 --- a/examples/hackernews/src/components/For.astro +++ b/examples/hackernews/src/components/For.astro @@ -8,13 +8,15 @@ export interface Props<T> { const { each } = Astro.props; --- -{(async function* () { - for await (const value of each) { - let html = await Astro.slots.render('default', [value]); - yield <Fragment set:html={html} />; - yield '\n'; - } -})()} +{ + (async function* () { + for await (const value of each) { + let html = await Astro.slots.render('default', [value]); + yield <Fragment set:html={html} />; + yield '\n'; + } + })() +} <Show when={!each.length}> <slot name="fallback" /> diff --git a/examples/hackernews/src/components/Nav.astro b/examples/hackernews/src/components/Nav.astro index 10bf0f899..7eeba2865 100644 --- a/examples/hackernews/src/components/Nav.astro +++ b/examples/hackernews/src/components/Nav.astro @@ -15,11 +15,13 @@ const links: Link[] = [ <header> <nav aria-label="Main menu"> - {links.map(({ href, text }) => ( - <a href={href} aria-current={href === Astro.url.pathname ? 'page' : undefined}> - <strong>{text}</strong> - </a> - ))} + { + links.map(({ href, text }) => ( + <a href={href} aria-current={href === Astro.url.pathname ? 'page' : undefined}> + <strong>{text}</strong> + </a> + )) + } <a class="github" href="http://github.com/withastro/astro" target="_blank" rel="noreferrer"> Built with Astro </a> diff --git a/examples/hackernews/src/pages/users/[id].astro b/examples/hackernews/src/pages/users/[id].astro index 9b43c6958..e56085992 100644 --- a/examples/hackernews/src/pages/users/[id].astro +++ b/examples/hackernews/src/pages/users/[id].astro @@ -25,7 +25,7 @@ const user = (await fetchAPI(`user/${id}`)) as IUser; {user.karma} </li> <Show when={user.about}> - <li set:html={user.about} class="about"></li>{' '} + <li set:html={user.about} class="about" />{' '} </Show> </ul> <p> |