diff options
author | Ilion Beyst <ilion.beyst@gmail.com> | 2022-07-24 18:05:20 +0200 |
---|---|---|
committer | Ilion Beyst <ilion.beyst@gmail.com> | 2022-07-24 18:05:20 +0200 |
commit | 90dfc3dec45b3f5d5700f711130d04a5f4d958db (patch) | |
tree | 74acb864dc364c363835d4a5a66b0e2f7fabd6df /web/pw-server/src/routes/users | |
parent | 99987f84446ce4fb9457696de070434706ae1a7b (diff) | |
download | planetwars.dev-90dfc3dec45b3f5d5700f711130d04a5f4d958db.tar.xz planetwars.dev-90dfc3dec45b3f5d5700f711130d04a5f4d958db.zip |
create new bot flow
Diffstat (limited to 'web/pw-server/src/routes/users')
-rw-r--r-- | web/pw-server/src/routes/users/[user_name].svelte | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/web/pw-server/src/routes/users/[user_name].svelte b/web/pw-server/src/routes/users/[user_name].svelte index a1801f4..b6bd34e 100644 --- a/web/pw-server/src/routes/users/[user_name].svelte +++ b/web/pw-server/src/routes/users/[user_name].svelte @@ -17,6 +17,8 @@ </script> <script lang="ts"> + import { currentUser } from "$lib/stores/current_user"; + export let userName: string; export let bots: object[]; </script> @@ -25,7 +27,13 @@ <div class="header"> <h1 class="user-name">{userName}</h1> </div> - <h2>Bots</h2> + + <div class="bot-list-header"> + <h2 class="bot-list-header-title">Bots</h2> + {#if $currentUser && $currentUser.username == userName} + <a href="/bots/new" class="btn-new-bot"> New bot </a> + {/if} + </div> <ul class="bot-list"> {#each bots as bot} <li class="bot"> @@ -51,6 +59,29 @@ margin-bottom: 0.5em; } + .bot-list-header { + display: flex; + justify-content: space-between; + align-items: flex-end; + } + + .bot-list-header-title { + margin-bottom: 0px; + } + + .btn-new-bot { + padding: 8px 12px; + border-radius: 4px; + border: 0; + display: block; + color: white; + background-color: rgb(40, 167, 69); + font-weight: 500; + text-decoration: none; + font-size: 11pt; + cursor: pointer; + } + .bot-list { list-style: none; padding: 0; |