Skip to content

Commit

Permalink
fix: typo (#193)
Browse files Browse the repository at this point in the history
* fix: typo

* fix: typo

* fix: imports

* fix: null profile
  • Loading branch information
hmbanan666 authored Jul 5, 2024
1 parent 9b017bb commit 0693ee5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
9 changes: 5 additions & 4 deletions src/lib/components/MenuDesktop.svelte
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<script>
<script lang='ts'>
import type { Profile as IProfile } from '@hmbanan666/chat-game-api'
import Profile from './Profile.svelte'
import { page } from '$app/stores'
import couponSmall from '$lib/assets/website/coupon-64.png'
import coinSmall from '$lib/assets/website/coin-64.png'
const locale = $page.data.locale
const t = $page.data.t
const profile = $page.data.profileData
const profile = $page.data.profileData as IProfile | null
</script>

<nav>
Expand All @@ -31,13 +32,13 @@

<div class='right'>
<div class='items'>
{#if profile?.coins > 0}
{#if profile && profile?.coins > 0}
<div class='currency'>
<div class='counter'>{profile.coins}</div> <img src={coinSmall} alt="" width='32' height='32' />
</div>
{/if}

{#if profile?.coupons > 0}
{#if profile && profile?.coupons > 0}
<div class='currency'>
<div class='counter'>{profile.coupons}</div> <img src={couponSmall} alt="" width='32' height='32' />
</div>
Expand Down
5 changes: 4 additions & 1 deletion src/routes/[lang]/(website)/character/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
<script lang='ts'>
import type { Profile } from '@hmbanan666/chat-game-api'
import { page } from '$app/stores'
import coinSmall from '$lib/assets/website/coin-64.png'
export let data
const profile = $page.data.profileData as Profile | null
</script>

<section class='hero'>
Expand All @@ -14,7 +17,7 @@
<div class='currency'>
<img src={coinSmall} alt="" width='48' height='48' />
<div class='right'>
<p class='counter'>{$page.data.profileData.coins}</p>
<p class='counter'>{profile?.coins}</p>
<p class='description'>Монет</p>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/routes/[lang]/(website)/character/new/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import coinSmall from '$lib/assets/website/coin-64.png'
import { page } from '$app/stores'
const isEnoughCoins = $page.data.profileData.coins >= 5
const isEnoughCoins = $page.data.profileData?.coins >= 5
let isCheckedTerms = $state(false)
let isNicknameUnique = $state(false)
let nickname = $state('')
Expand Down

0 comments on commit 0693ee5

Please sign in to comment.