forked from sveltejs/realworld
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make formatting a bit more idiomatic/consistent
- Loading branch information
1 parent
043309a
commit e2a999c
Showing
30 changed files
with
570 additions
and
632 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
<script> | ||
import Index from './_Index.svelte'; | ||
</script> | ||
|
||
<svelte:head> | ||
<title>Conduit</title> | ||
</svelte:head> | ||
|
||
<Index /> | ||
|
||
<script> | ||
import Index from './_Index.svelte'; | ||
</script> | ||
<Index /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,41 @@ | ||
<div class="home-page"> | ||
<div class="banner"> | ||
<div class="container"> | ||
<h1 class="logo-font">conduit</h1> | ||
<p>A place to share your knowledge.</p> | ||
</div> | ||
</div> | ||
<script> | ||
import { onMount } from 'svelte'; | ||
import MainView from './_components/MainView/index.svelte'; | ||
import Tags from './_components/Tags.svelte'; | ||
import * as api from './_api.js'; | ||
<div class="container page"> | ||
<div class="row"> | ||
<MainView {tag} bind:tab /> | ||
let tab; | ||
let tag; | ||
let tags; | ||
<div class="col-md-3"> | ||
<div class="sidebar"> | ||
<p>Popular Tags</p> | ||
<Tags {tags} on:select='{setTags}' /> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
function setTags({ detail }) { | ||
tag = detail.tag; | ||
tab = "tag"; | ||
} | ||
<script> | ||
import { onMount } from 'svelte'; | ||
import MainView from './_components/MainView/index.svelte'; | ||
import Tags from './_components/Tags.svelte'; | ||
import * as api from './_api.js'; | ||
onMount(async () => { | ||
({ tags } = await api.get('tags')); | ||
}); | ||
</script> | ||
|
||
let tab, tag, tags; | ||
<div class="home-page"> | ||
<div class="banner"> | ||
<div class="container"> | ||
<h1 class="logo-font">conduit</h1> | ||
<p>A place to share your knowledge.</p> | ||
</div> | ||
</div> | ||
|
||
function setTags({ detail }) { | ||
tag = detail.tag; | ||
tab = "tag"; | ||
} | ||
<div class="container page"> | ||
<div class="row"> | ||
<MainView {tag} bind:tab /> | ||
|
||
onMount(() => { | ||
api.get('tags').then((response) => { | ||
tags = response.tags | ||
}); | ||
}) | ||
</script> | ||
<div class="col-md-3"> | ||
<div class="sidebar"> | ||
<p>Popular Tags</p> | ||
<Tags {tags} on:select='{setTags}' /> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
<script> | ||
export let errors; | ||
</script> | ||
|
||
{#if errors} | ||
<ul class="error-messages"> | ||
{#each Object.keys(errors) as key} | ||
<li>{key} {errors[key]}</li> | ||
{/each} | ||
</ul> | ||
{/if} | ||
|
||
<script> | ||
export let errors; | ||
</script> | ||
{/if} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.