Skip to content

Commit

Permalink
webkit updated
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitriVanGuard committed Jan 30, 2023
1 parent 0db8943 commit 7320be5
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 10 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"polka": "next",
"react": "^16.14.0",
"react-dom": "^16.14.0",
"san-webkit": "https://github.com/santiment/san-webkit#b533fd5",
"san-webkit": "https://github.com/santiment/san-webkit#337850c",
"sanitize-html": "1.20.1",
"sirv": "^1.0.0",
"turndown": "^7.1.1"
Expand Down
24 changes: 17 additions & 7 deletions src/components/Nav/index.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,25 @@
import Product from 'webkit/ui/Product.svelte'
import Products from 'webkit/ui/Products/svelte'
import NftButton from 'webkit/ui/ChristmasNFTDialog/Button.svelte'
import { checkWasNftDialogClosedOnce } from 'webkit/ui/ChristmasNFTDialog/api'
import { showChristmasNFTDialog } from 'webkit/ui/ChristmasNFTDialog/Dialog.svelte'
import { queryUserNftInsights } from 'webkit/ui/ChristmasNFTDialog/api'
import { currentUser as currentUser$ } from '@/stores/user'
import Search from './Search.svelte'
import Account from './Account.svelte'
import { onDestroy, onMount } from 'svelte'
let isMenuOpened = false
let insights = []
let timer
$: currentUser = $currentUser$
$: discountCode = currentUser && +currentUser.id === 2414 ? 'caKHq5Zo' : ''
$: isNftWinner = currentUser && currentUser.sanbaseNft && currentUser.sanbaseNft.hasValidNft
$: isDiscountWinner = discountCode && insights.length
onMount(() => {
if (!checkWasNftDialogClosedOnce()) {
timer = setTimeout(() => showChristmasNFTDialog(), 2000)
}
queryUserNftInsights().then((data) => {
insights = data
})
window.onNftGameStart = () => {
const data = { campaign_participant: 'nft_battle_2022' }
Expand Down Expand Up @@ -50,7 +56,11 @@

<div class="break mrg-xl mrg--l mrg--r" />

<NftButton class="mrg-l mrg--r" />
<NftButton
class="mrg-l mrg--r"
isWinner={isNftWinner || isDiscountWinner}
props={{ currentUser, discountCode, isNftWinner }}
/>

<Account />
</div>
Expand Down

0 comments on commit 7320be5

Please sign in to comment.