Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: typo #193

Merged
merged 4 commits into from
Jul 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading