Skip to content

Commit 35880f9

Browse files
Added routes
1 parent c8589c1 commit 35880f9

8 files changed

Lines changed: 71 additions & 59 deletions

File tree

src/lib/components/Account.svelte

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,13 @@
4242
</div>
4343

4444
<style>
45+
@import "$lib/styles/style.css";
46+
4547
.account button {
4648
border: 0;
4749
background-color: transparent;
4850
}
4951
50-
.account button:hover {
51-
cursor: pointer;
52-
}
53-
5452
.avatar {
5553
display: flex;
5654
justify-content: center;

src/lib/components/Edit.svelte

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737
</div>
3838

3939
<style>
40+
@import "$lib/styles/style.css";
41+
4042
.edit {
4143
display: flex;
4244
flex-direction: column;
@@ -54,14 +56,6 @@
5456
padding: 0 35px;
5557
}
5658
57-
.item > input {
58-
padding: 5px;
59-
border: 0;
60-
border-radius: 10px;
61-
background: #f3f6f4;
62-
text-align: center;
63-
}
64-
6559
.buttons {
6660
box-sizing: border-box;
6761
display: flex;
@@ -70,16 +64,4 @@
7064
margin-top: 20px;
7165
padding: 0 35px;
7266
}
73-
74-
.buttons button {
75-
background-color: black;
76-
color: white;
77-
padding: 5px;
78-
border: 0;
79-
border-radius: 10px;
80-
}
81-
82-
.buttons button:hover {
83-
cursor: pointer;
84-
}
8567
</style>

src/lib/styles/style.css

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
.block {
2+
max-width: 400px;
3+
margin-left: auto;
4+
margin-right: auto;
5+
padding: 5px 15px;
6+
border-radius: 10px;
7+
text-align: center;
8+
background-color: white;
9+
}
10+
11+
input {
12+
padding: 5px;
13+
border: 0;
14+
border-radius: 10px;
15+
text-align: center;
16+
background: #f3f6f4;
17+
}
18+
19+
button {
20+
padding: 5px;
21+
border: 0;
22+
border-radius: 10px;
23+
background-color: black;
24+
color: white;
25+
}
26+
27+
button:hover {
28+
cursor: pointer;
29+
}

src/routes/+layout.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/routes/+page.svelte

Lines changed: 3 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -40,47 +40,17 @@
4040
</div>
4141

4242
<style>
43-
.block {
44-
max-width: 400px;
45-
margin-left: auto;
46-
margin-right: auto;
47-
padding: 5px 15px;
48-
border-radius: 10px;
49-
text-align: center;
50-
background-color: white;
51-
}
43+
@import "$lib/styles/style.css";
5244
5345
.block input {
5446
width: 100%;
55-
padding: 5px;
56-
border: 0;
57-
border-radius: 10px;
58-
text-align: center;
59-
background: #f3f6f4;
60-
}
61-
62-
.block button {
63-
padding: 5px;
64-
border: 0;
65-
border-radius: 10px;
66-
background-color: black;
67-
color: white;
6847
}
6948
70-
.block button:hover {
71-
cursor: pointer;
72-
}
73-
74-
.head {
49+
.head,
50+
.search {
7551
display: flex;
7652
justify-content: space-between;
7753
align-items: center;
7854
padding: 0 35px;
7955
}
80-
81-
.search {
82-
display: flex;
83-
justify-content: space-around;
84-
padding: 0 35px;
85-
}
8656
</style>

src/routes/[account]/+page.svelte

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<script lang="ts">
2+
import { getAccountInfo } from "$lib/contract";
3+
import type { PageProps } from "./$types";
4+
import Account from "$lib/components/Account.svelte";
5+
6+
let { data }: PageProps = $props();
7+
8+
let promise = $state(getAccountInfo(data.account));
9+
</script>
10+
11+
<div class="block">
12+
<h1>EOS Account</h1>
13+
<div>
14+
{#await promise}
15+
<div>...</div>
16+
{:then data}
17+
<Account {data} />
18+
{/await}
19+
</div>
20+
</div>
21+
22+
<style>
23+
@import '$lib/styles/style.css';
24+
</style>

src/routes/[account]/+page.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import type { PageLoad } from './$types';
2+
3+
export const load: PageLoad = ({ params }) => {
4+
return {
5+
account: params.account
6+
}
7+
};

svelte.config.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ const config = {
66
preprocess: vitePreprocess(),
77

88
kit: {
9-
adapter: adapter()
9+
adapter: adapter(),
10+
router: {
11+
type: 'hash'
12+
}
1013
}
1114
};
1215

0 commit comments

Comments
 (0)