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

Active Staking #160

Merged
merged 149 commits into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from 129 commits
Commits
Show all changes
149 commits
Select commit Hold shift + click to select a range
c2b6e6b
feat: add superlike component
teodorus-nathaniel Dec 28, 2023
841ddd4
feat: add super like count query
teodorus-nathaniel Dec 28, 2023
c99a8e3
fix: yarn lock issue
teodorus-nathaniel Dec 29, 2023
99410c9
feat: finish UI for rewards card
teodorus-nathaniel Dec 29, 2023
23f34d8
style: change color muted
teodorus-nathaniel Dec 29, 2023
d55c880
refactor: rename hooks to include all activeStaking hooks
teodorus-nathaniel Dec 29, 2023
2accd17
feat: integrate reward report
teodorus-nathaniel Dec 29, 2023
98f7e9f
chore: uncomment post to earn notice in new posts modal
teodorus-nathaniel Jan 2, 2024
b039c80
style: fix padding issue
teodorus-nathaniel Jan 2, 2024
1c2fc46
style: reduce padding on custom modal
teodorus-nathaniel Jan 2, 2024
33864ac
feat: add active staking program confirmation modal
teodorus-nathaniel Jan 2, 2024
35a1b65
feat: show my stake in creator info
teodorus-nathaniel Jan 2, 2024
f429ced
feat: update logic for rendering correct card in creator dashboard si…
teodorus-nathaniel Jan 2, 2024
ae1d4a7
feat: update mobile view for stakers in space page and the reward das…
teodorus-nathaniel Jan 2, 2024
d69cf9a
chore: update wording
teodorus-nathaniel Jan 2, 2024
25f4ad4
Merge branch 'main' of https://github.com/dappforce/polkaverse into d…
teodorus-nathaniel Jan 2, 2024
cd419ac
feat: add mobile reward dashboard
teodorus-nathaniel Jan 2, 2024
5fc5a86
feat: remove count when opening the info
teodorus-nathaniel Jan 2, 2024
482b583
feat: return error detail from super like api
teodorus-nathaniel Jan 3, 2024
f9968c4
fix: remove cypress for now because it has conflict in dep with datah…
teodorus-nathaniel Jan 3, 2024
9582547
feat: add datahub subscriber
teodorus-nathaniel Jan 3, 2024
d4db248
feat: add optimistic count and prevent layout shift when liking
teodorus-nathaniel Jan 3, 2024
d984a27
chore: update version for react-icons
teodorus-nathaniel Jan 3, 2024
08a49e4
style: reduce style for label in staker reward info
teodorus-nathaniel Jan 3, 2024
05fdd79
feat: add reward history modal
teodorus-nathaniel Jan 3, 2024
d46ab38
refactor: rename component and file
teodorus-nathaniel Jan 3, 2024
ab6332d
style: move rewards history button in mobile
teodorus-nathaniel Jan 3, 2024
2ee97a5
style: change position of reward history button
teodorus-nathaniel Jan 3, 2024
b6b8765
chore: remove coming soon button
teodorus-nathaniel Jan 3, 2024
08898e8
fix: textarea can't be typed if clicked in empty row
teodorus-nathaniel Jan 3, 2024
9c4162e
fix: change day timestamp format to utc
teodorus-nathaniel Jan 3, 2024
40718ae
chore: update implementation of day timestamp
teodorus-nathaniel Jan 3, 2024
9b5195e
fix: wrong unix timestamp
teodorus-nathaniel Jan 3, 2024
74397f2
fix: update dist day calc to use utc and balance formats
teodorus-nathaniel Jan 3, 2024
e78b332
style: add margin on surplus text
teodorus-nathaniel Jan 3, 2024
7e94770
fix: size for surplus progress bar not same
teodorus-nathaniel Jan 3, 2024
c69d1be
chore: remove logs
teodorus-nathaniel Jan 3, 2024
d328de9
fix: set loading to false if query not enabled
teodorus-nathaniel Jan 3, 2024
dac478d
chore: add envs to ci/cd
teodorus-nathaniel Jan 3, 2024
b2c3c5d
feat: make reward banner sticky in mobile
teodorus-nathaniel Jan 3, 2024
7912dd2
feat: add address like slice
teodorus-nathaniel Jan 3, 2024
220f086
feat: integrate liked post indicator
teodorus-nathaniel Jan 3, 2024
12bda59
feat: add reward history slice
teodorus-nathaniel Jan 3, 2024
26645e8
feat: refetch hasILiked if like is erroring out
teodorus-nathaniel Jan 4, 2024
fe878ea
style: reduce offset on icons
teodorus-nathaniel Jan 4, 2024
5bc6c84
fix: wrong thunk to call in the hook
teodorus-nathaniel Jan 4, 2024
516b503
fix: remove clickable image for creators image
teodorus-nathaniel Jan 4, 2024
59e4ba0
feat: add loading to reward history modal
teodorus-nathaniel Jan 4, 2024
ea0fee7
feat: remove affix tab in mobile
teodorus-nathaniel Jan 4, 2024
e4dc921
chore: make max text for likes as 10/10
teodorus-nathaniel Jan 4, 2024
0b38230
chore: make currency always SUB
teodorus-nathaniel Jan 4, 2024
6d4706f
fix: remove dummy code
teodorus-nathaniel Jan 4, 2024
200a778
chore: change link to active staking detail
teodorus-nathaniel Jan 4, 2024
8a48d14
style: reduce font size of space stat
teodorus-nathaniel Jan 4, 2024
ea914a1
feat: add precision props to format balance
teodorus-nathaniel Jan 4, 2024
edc0919
chore: add tooltips
teodorus-nathaniel Jan 4, 2024
5f11121
chore: wording, style, and color improvement
teodorus-nathaniel Jan 4, 2024
8fe6cac
fix: move fetch of super likes count to not block the loading state
teodorus-nathaniel Jan 4, 2024
82c4666
feat: add validation of create time and integrate canPostSuperLiked API
teodorus-nathaniel Jan 4, 2024
4645dfc
chore: update wording
teodorus-nathaniel Jan 4, 2024
aeac145
refactor: use the same component for mobile like count
teodorus-nathaniel Jan 4, 2024
f54a316
chore: change filters for post home page
teodorus-nathaniel Jan 4, 2024
b61e2dc
chore: commented share button
teodorus-nathaniel Jan 4, 2024
a60c303
chore: comment agree participating in active staking modal
teodorus-nathaniel Jan 4, 2024
4048504
feat: show stake sub modal if user tries to like before staking
teodorus-nathaniel Jan 4, 2024
e01ae0d
feat: change my profile and add my activity links
teodorus-nathaniel Jan 4, 2024
afdcc55
chore: change icon of my activity menu
teodorus-nathaniel Jan 4, 2024
8882dfd
feat: show description to active staking when not like any post yet
teodorus-nathaniel Jan 4, 2024
22111f8
fix: reward history can't be clicked in mobile
teodorus-nathaniel Jan 4, 2024
10a3b30
feat: change style of super like button
teodorus-nathaniel Jan 4, 2024
3cb4597
fix: make isFilled not passed to svg
teodorus-nathaniel Jan 4, 2024
b621a8f
style: move post action (superlike) in post page to inside card
teodorus-nathaniel Jan 4, 2024
9cc2edd
style: make all fonts in staker reward info small
teodorus-nathaniel Jan 4, 2024
5947a30
chore: update color and font size of staker info
teodorus-nathaniel Jan 4, 2024
75b334c
feat: show active staking banner in mobile post page, and make the on…
teodorus-nathaniel Jan 4, 2024
2e02b3f
fix: wrong env used for amp
teodorus-nathaniel Jan 4, 2024
c0d1641
style: add "like" label if no like count yet
teodorus-nathaniel Jan 4, 2024
6d67dcd
chore: only show create post card for user who staked
teodorus-nathaniel Jan 4, 2024
e5647fb
chore: remove view reactions menu
teodorus-nathaniel Jan 4, 2024
2ed0613
feat: change default selected space id to profile space id
teodorus-nathaniel Jan 4, 2024
6377bcd
fix: remove focus style in super like that makes it pink colored
teodorus-nathaniel Jan 4, 2024
a050b18
fix: filter space ids list in create post for unhidden spaces only
teodorus-nathaniel Jan 4, 2024
3fe6df0
chore: update wording
teodorus-nathaniel Jan 4, 2024
3e7c23a
feat: make super like already active if its my post
teodorus-nathaniel Jan 4, 2024
d1c38f5
fix: make post count can't wrap
teodorus-nathaniel Jan 4, 2024
aaa6b6e
chore: adjust logic for displaying sidebar cards
teodorus-nathaniel Jan 4, 2024
30d44e9
fix: change filter in post
teodorus-nathaniel Jan 4, 2024
07ef568
fix: wrong logic in rendering space page sidebar cards
teodorus-nathaniel Jan 4, 2024
baea3e4
fix: excess margin in post page for posts without superlike
teodorus-nathaniel Jan 4, 2024
ee3c091
feat: show super like even for old posts
teodorus-nathaniel Jan 4, 2024
0bd4054
feat: render 0 count in super like instead of "like"
teodorus-nathaniel Jan 4, 2024
14da221
feat: add non staker banner
teodorus-nathaniel Jan 4, 2024
c519a35
feat: change wording for select wallet in mobile
teodorus-nathaniel Jan 4, 2024
aac51db
chore: improve ui
teodorus-nathaniel Jan 4, 2024
7d5d445
feat: improve UX for mobile users
teodorus-nathaniel Jan 4, 2024
0edc6a4
feat: add super likes tooltip
teodorus-nathaniel Jan 4, 2024
bf1332e
feat: order wallets and disable button for uninstalled wallet
teodorus-nathaniel Jan 4, 2024
4429ed8
fix: wrong link
teodorus-nathaniel Jan 4, 2024
70d35ed
fix: change link nova wallet to regular text
teodorus-nathaniel Jan 4, 2024
14126f1
fix: double super like button issue
teodorus-nathaniel Jan 4, 2024
1cb814a
fix: UI issue with tooltip
teodorus-nathaniel Jan 4, 2024
5828a08
fix: show active staking info only if no weekly and daily reward
teodorus-nathaniel Jan 4, 2024
59e96d4
fix: liked data not refreshed after user changes account
teodorus-nathaniel Jan 4, 2024
21f5f5e
refactor: only fetch canLike that is not fetched yet
teodorus-nathaniel Jan 4, 2024
94706f5
feat: add analytics
teodorus-nathaniel Jan 4, 2024
2ce7b96
chore: update wording
teodorus-nathaniel Jan 4, 2024
82e0e60
Return confirm modal
olehmell Jan 5, 2024
0d084f3
fix: wrong logic to get distribution days
teodorus-nathaniel Jan 7, 2024
df85ecc
Merge branch 'deploy/active-staking' of https://github.com/dappforce/…
teodorus-nathaniel Jan 7, 2024
76b58e5
fix: logic issue when have no reward
teodorus-nathaniel Jan 8, 2024
19c9412
refactor: rename actions and update optimistic update to change store…
teodorus-nathaniel Jan 8, 2024
fea0644
feat: add optimistic update to reward report
teodorus-nathaniel Jan 8, 2024
0da3ddb
feat: add blockhash to super likes args
teodorus-nathaniel Jan 8, 2024
ee6304e
chore: compress subsocial tokens img
teodorus-nathaniel Jan 8, 2024
be7c220
chore: update tooltip
teodorus-nathaniel Jan 8, 2024
cf3be7c
fix: "distribution in" calculation
teodorus-nathaniel Jan 8, 2024
20136c5
chore: update wording
teodorus-nathaniel Jan 8, 2024
c5062a9
fix: diamond icon overflow
teodorus-nathaniel Jan 8, 2024
2c14332
chore: update tooltip
teodorus-nathaniel Jan 8, 2024
d4c0781
chore: update tooltip
teodorus-nathaniel Jan 8, 2024
af2716b
chore: add events
teodorus-nathaniel Jan 8, 2024
637669a
chore: update tooltip to be 2 paragraphs
teodorus-nathaniel Jan 8, 2024
41d6d99
chore: add moreevents
teodorus-nathaniel Jan 8, 2024
8e97457
feat: add app launched event
teodorus-nathaniel Jan 8, 2024
41a7434
chore: hide post stats
teodorus-nathaniel Jan 8, 2024
716bc42
fix: issue where optimistic goes wrong when user doesn't have likes
teodorus-nathaniel Jan 8, 2024
e34f63a
chore: remove log
teodorus-nathaniel Jan 8, 2024
f82a15c
chore: update wording for staker info in desktop
teodorus-nathaniel Jan 8, 2024
6348b3a
fix: wrong logic when updating optimistic sub reward
teodorus-nathaniel Jan 9, 2024
2568429
feat: add analytics amount ranges props
teodorus-nathaniel Jan 9, 2024
2f607f5
refactor: extract sign in modal desc to own component
teodorus-nathaniel Jan 9, 2024
2549e5a
refactor: remove unused code and extract function
teodorus-nathaniel Jan 9, 2024
0f0ae7e
refactor: use scss vars for spacing values
teodorus-nathaniel Jan 9, 2024
25a8c3b
refactor: remove unnecessary code style complexity
teodorus-nathaniel Jan 9, 2024
0f9af61
refactor: rename folder for staker reward
teodorus-nathaniel Jan 9, 2024
a449021
refactor: rename folder
teodorus-nathaniel Jan 9, 2024
b413843
refactor: move staker reward info card to staker reward folder
teodorus-nathaniel Jan 9, 2024
5995309
feat: add creator reward dashboard
teodorus-nathaniel Jan 9, 2024
b88a66a
feat: adjust the tabs and filters for creators space
teodorus-nathaniel Jan 9, 2024
e8be7fa
feat: add hasCreatorRewards to app launched user props
teodorus-nathaniel Jan 9, 2024
efaa1f7
fix: wrong calculation for weekly and daily optimistic update
teodorus-nathaniel Jan 9, 2024
b522351
fix: change super likes field to count received likes
teodorus-nathaniel Jan 9, 2024
448ad25
Update AMP_ID for prod
olehmell Jan 9, 2024
17f9c21
chore: update tooltip wording
teodorus-nathaniel Jan 9, 2024
13870aa
Merge branch 'deploy/active-staking' of https://github.com/dappforce/…
teodorus-nathaniel Jan 9, 2024
5a6b306
chore: change staging super like server env
teodorus-nathaniel Jan 10, 2024
97ecaeb
fix: optimistic reward calculation after likes more than 10
teodorus-nathaniel Jan 10, 2024
28dc797
style: remove surplus like bar and labe
teodorus-nathaniel Jan 10, 2024
9f32a7e
Update prod envs
olehmell Jan 10, 2024
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
5 changes: 5 additions & 0 deletions .github/workflows/build-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ jobs:
GH_CONNECTION_KIND=main
GH_SELLER_CLIENT_ID=${{ secrets.SELLER_CLIENT_ID }}
GH_SELLER_TOKEN_SIGNER=${{ secrets.SELLER_TOKEN_SIGNER }}
GH_SERVER_MNEMONIC=${{ secrets.SERVER_MNEMONIC }}
GH_NEXT_PUBLIC_DATAHUB_QUERY_URL=https://data-hub.subsocial.network/graphql
GH_NEXT_PUBLIC_DATAHUB_SUBSCRIPTION_URL=wss://data-hub.subsocial.network/graphql-ws
GH_DATAHUB_QUEUE_URL=https://queue-data-hub.subsocial.network/graphql
GH_DATAHUB_QUEUE_TOKEN=${{ secrets.DATAHUB_QUEUE_TOKEN }}

tags: |
${{ env.image }}
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/feature-based.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ jobs:
GH_CONNECTION_KIND=dev
GH_SELLER_CLIENT_ID=5DYm3Wk4aa1BbfhH1ajmY6MNEELXoicmKRnP4tzHYjSKnD9K
GH_SELLER_TOKEN_SIGNER=retire strong pole intact cool music high path salt praise stadium spatial
GH_SERVER_MNEMONIC=plunge pumpkin penalty segment cattle more print below fat lemon clap uniform
GH_NEXT_PUBLIC_DATAHUB_QUERY_URL=https://super-likes-data-hub.subsocial.network/graphql
GH_NEXT_PUBLIC_DATAHUB_SUBSCRIPTION_URL=wss://super-likes-data-hub.subsocial.network/graphql-ws
GH_DATAHUB_QUEUE_URL=https://super-likes-queue-data-hub.subsocial.network/graphql
GH_DATAHUB_QUEUE_TOKEN=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhZG1pbiI6dHJ1ZX0.jpXwkIJ4DpV4IvSI3eWVVXE6x89qr_GIq7IlbBv5YE0
tags: |
${{ env.image }}
cache-from: type=local,src=/tmp/.buildx-cache
Expand Down
5 changes: 5 additions & 0 deletions ci.env
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,8 @@ NEXT_PUBLIC_OFFCHAIN_SIGNER_URL='$GH_OFFCHAIN_SIGNER_URL'
NEXT_PUBLIC_AMP_ID='$GH_AMP_ID'
SELLER_CLIENT_ID='$GH_SELLER_CLIENT_ID'
SELLER_CLIENT_TOKEN_SIGNER='$GH_SELLER_TOKEN_SIGNER'
NEXT_PUBLIC_DATAHUB_QUERY_URL='GH_NEXT_PUBLIC_DATAHUB_QUERY_URL'
NEXT_PUBLIC_DATAHUB_SUBSCRIPTION_URL='GH_NEXT_PUBLIC_DATAHUB_SUBSCRIPTION_URL'
DATAHUB_QUEUE_URL='GH_DATAHUB_QUEUE_URL'
DATAHUB_QUEUE_TOKEN='GH_DATAHUB_QUEUE_TOKEN'
SERVER_MNEMONIC='GH_SERVER_MNEMONIC'
15 changes: 0 additions & 15 deletions cypress.config.ts

This file was deleted.

24 changes: 22 additions & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ ARG GH_AMP_ID
ARG GH_OFFCHAIN_SIGNER_URL
ARG GH_SELLER_CLIENT_ID
ARG GH_SELLER_TOKEN_SIGNER
ARG GH_NEXT_PUBLIC_DATAHUB_QUERY_URL
ARG GH_NEXT_PUBLIC_DATAHUB_SUBSCRIPTION_URL
ARG GH_DATAHUB_QUEUE_URL
ARG GH_DATAHUB_QUEUE_TOKEN
ARG GH_SERVER_MNEMONIC

ENV NEXT_PUBLIC_GA_ID=${GH_GA_ID} \
NEXT_PUBLIC_APP_KIND=${GH_APP_KIND} \
Expand All @@ -18,7 +23,12 @@ ENV NEXT_PUBLIC_GA_ID=${GH_GA_ID} \
NEXT_PUBLIC_OFFCHAIN_SIGNER_URL=${GH_OFFCHAIN_SIGNER_URL} \
NEXT_PUBLIC_CONNECTION_KIND=${GH_CONNECTION_KIND} \
SELLER_CLIENT_ID=${GH_SELLER_CLIENT_ID} \
SELLER_CLIENT_TOKEN_SIGNER=${GH_SELLER_TOKEN_SIGNER}
SELLER_CLIENT_TOKEN_SIGNER=${GH_SELLER_TOKEN_SIGNER} \
NEXT_PUBLIC_DATAHUB_QUERY_URL=${GH_NEXT_PUBLIC_DATAHUB_QUERY_URL} \
NEXT_PUBLIC_DATAHUB_SUBSCRIPTION_URL=${GH_NEXT_PUBLIC_DATAHUB_SUBSCRIPTION_URL} \
DATAHUB_QUEUE_URL=${GH_DATAHUB_QUEUE_URL} \
DATAHUB_QUEUE_TOKEN=${GH_DATAHUB_QUEUE_TOKEN} \
SERVER_MNEMONIC=${GH_SERVER_MNEMONIC}

COPY package.json yarn.lock* ./
RUN yarn install --no-optional
Expand All @@ -42,6 +52,11 @@ ARG GH_AMP_ID
ARG GH_OFFCHAIN_SIGNER_URL
ARG GH_SELLER_CLIENT_ID
ARG GH_SELLER_TOKEN_SIGNER
ARG GH_NEXT_PUBLIC_DATAHUB_QUERY_URL
ARG GH_NEXT_PUBLIC_DATAHUB_SUBSCRIPTION_URL
ARG GH_DATAHUB_QUEUE_URL
ARG GH_DATAHUB_QUEUE_TOKEN
ARG GH_SERVER_MNEMONIC

ENV NEXT_PUBLIC_GA_ID=${GH_GA_ID} \
NEXT_PUBLIC_APP_KIND=${GH_APP_KIND} \
Expand All @@ -50,7 +65,12 @@ ENV NEXT_PUBLIC_GA_ID=${GH_GA_ID} \
NEXT_PUBLIC_OFFCHAIN_SIGNER_URL=${GH_OFFCHAIN_SIGNER_URL} \
NEXT_PUBLIC_CONNECTION_KIND=${GH_CONNECTION_KIND} \
SELLER_CLIENT_ID=${GH_SELLER_CLIENT_ID} \
SELLER_CLIENT_TOKEN_SIGNER=${GH_SELLER_TOKEN_SIGNER}
SELLER_CLIENT_TOKEN_SIGNER=${GH_SELLER_TOKEN_SIGNER} \
NEXT_PUBLIC_DATAHUB_QUERY_URL=${GH_NEXT_PUBLIC_DATAHUB_QUERY_URL} \
NEXT_PUBLIC_DATAHUB_SUBSCRIPTION_URL=${GH_NEXT_PUBLIC_DATAHUB_SUBSCRIPTION_URL} \
DATAHUB_QUEUE_URL=${GH_DATAHUB_QUEUE_URL} \
DATAHUB_QUEUE_TOKEN=${GH_DATAHUB_QUEUE_TOKEN} \
SERVER_MNEMONIC=${GH_SERVER_MNEMONIC}

WORKDIR /opt/subsocial/app

Expand Down
9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
"@typescript-eslint/parser": "^5.45.0",
"@welldone-software/why-did-you-render": "^6.2.1",
"apollo": "^2.34.0",
"cypress": "^10.11.0",
"cypress-network-idle": "^1.10.2",
"cypress-wait-until": "^1.7.2",
"eslint": "^8.46.0",
Expand Down Expand Up @@ -90,6 +89,7 @@
"@polkadot/ui-keyring": "^2.9.8",
"@reduxjs/toolkit": "^1.3.4",
"@subsocial/api": "0.8.10",
"@subsocial/data-hub-sdk": "dappforce/subsocial-data-hub-sdk#staging",
"@subsocial/definitions": "0.8.10",
"@subsocial/elasticsearch": "0.8.10",
"@subsocial/grill-widget": "^0.0.13",
Expand Down Expand Up @@ -122,7 +122,9 @@
"graphql": "^15.5.0",
"graphql-request": "^5.2.0",
"graphql-tag": "^2.11.0",
"graphql-ws": "^5.14.3",
"isbot": "^3.0.14",
"isomorphic-ws": "^5.0.0",
"jdenticon": "^3.2.0",
"jwt-decode": "^3.1.2",
"localforage": "^1.7.4",
Expand All @@ -146,7 +148,7 @@
"react-embed": "^3.6.0",
"react-ga": "^3.3.0",
"react-hook-form": "~5.6.0",
"react-icons": "^4.4.0",
"react-icons": "^4.12.0",
"react-infinite-scroll-component": "^6.1.0",
"react-lite-youtube-embed": "^2.4.0",
"react-markdown": "6.0.3",
Expand All @@ -160,6 +162,7 @@
"store": "^2.0.12",
"strip-markdown": "^4.0.0",
"url-loader": "^4.1.1",
"yup": "^0.32.9"
"yup": "^0.32.9",
"zod": "^3.22.4"
}
}
Binary file added public/images/creators/subsocial-tokens-large.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions public/images/diamond.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/wallets/nova-wallet.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions src/components/auth/MyAccountsContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import {
signOut,
unsetMyEmailAddress,
} from 'src/rtk/features/accounts/myAccountSlice'
import { fetchAddressLikeCounts } from 'src/rtk/features/activeStaking/addressLikeCountSlice'
import { fetchChainsInfo } from 'src/rtk/features/chainsInfo/chainsInfoSlice'
import { fetchProfileSpace } from 'src/rtk/features/profiles/profilesSlice'
import { fetchEntityOfSpaceIdsByFollower } from 'src/rtk/features/spaceIds/followedSpaceIdsSlice'
Expand Down Expand Up @@ -148,6 +149,7 @@ export function MyAccountsProvider(props: React.PropsWithChildren<{}>) {
dispatch(fetchProfileSpace({ id: address, api: subsocial })),
dispatch(fetchEntityOfSpaceIdsByFollower({ id: address, reload: true, api: subsocial })),
dispatch(fetchChainsInfo({})),
dispatch(fetchAddressLikeCounts({ address, postIds: null })),
])

unsubAccountInfo = await readyApi.query.system.account(
Expand Down
25 changes: 24 additions & 1 deletion src/components/auth/WalletButton.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { AvatarOrSkeleton } from '../utils'
import Link from 'next/link'
import { hasInjectedWallet } from 'src/utils/window'
import { AvatarOrSkeleton, isClientSide } from '../utils'
import { StepsEnum } from './AuthContext'
import styles from './WalletButton.module.sass'

Expand All @@ -11,6 +13,27 @@ const WalletButton = ({ setCurrentStep }: Props) => {
setCurrentStep(StepsEnum.SelectAccount)
}

const isInMobileWalletBrowser = isClientSide() && hasInjectedWallet()
if (!isInMobileWalletBrowser) {
return (
<Link passHref href='https://novawallet.io/'>
<a className={styles.WalletButton} target='_blank'>
<div className='d-flex align-items-center'>
<AvatarOrSkeleton
externalIcon
icon={'/images/wallets/nova-wallet.jpeg'}
size={'default'}
className='mr-2 align-items-start'
/>
<div className='font-weight-bold pl-1' style={{ color: 'black' }}>
Install Nova Wallet
</div>
</div>
</a>
</Link>
)
}

return (
<div className={styles.WalletButton} onClick={() => handleClick()}>
<div className='d-flex align-items-center'>
Expand Down
43 changes: 29 additions & 14 deletions src/components/auth/signIn/SignInModal.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
import React, { useState } from 'react'
import LoadingTransaction from 'src/components/utils/LoadingTransaction'
import WalletButton from '../WalletButton'

import { ArrowLeftOutlined } from '@ant-design/icons'
import { Button } from 'antd'
import Modal from 'antd/lib/modal'
import clsx from 'clsx'
import React, { useState } from 'react'
import { useResponsiveSize } from 'src/components/responsive'
import LoadingTransaction from 'src/components/utils/LoadingTransaction'
import { setCurrentEmailAddress } from 'src/components/utils/OffchainSigner/ExternalStorage'
import config from 'src/config'
import { isMobileDevice } from 'src/config/Size.config'
import { EmailAccount } from 'src/types'
import { hasInjectedWallet } from 'src/utils/window'
import { AccountSelector } from '../../profile-selector/AccountSelector'
import ExternalLink from '../../spaces/helpers/ExternalLink'
import { MutedDiv } from '../../utils/MutedText'
import PrivacyPolicyLinks from '../../utils/PrivacyPolicyLinks'
import WalletList from '../../wallets/wallet-list/WalletsList'
import { CompletedSteps, StepsEnum, useAuth } from '../AuthContext'
import { useMyAccountsContext } from '../MyAccountsContext'
import WalletButton from '../WalletButton'
import ConfirmationModalContent from './email/ConfirmationModalContent'
import ShowMnemonicModalContent from './email/ShowMnemonicModalContent'
import SignInEmailButton from './email/SignInEmailButton'
Expand Down Expand Up @@ -186,22 +187,36 @@ const ModalContent = ({

const dividerText = isMobile ? 'Or' : 'Or connect wallet'

const isMobileDeviceAndWidth = isMobileDevice && isMobile

switch (currentStep) {
case StepsEnum.SelectWallet: {
return (
<div>
<ModalBodyWrapper
title='Sign In'
desc={
<>
Choose one of the available wallet providers to connect to {config.appName}, or sign
in with your email address.{' '}
<ExternalLink
url='https://docs.subsocial.network/docs/tutorials/#polkadotjs'
value='How do I set up a wallet?'
/>
</>
}
desc={(() => {
teodorus-nathaniel marked this conversation as resolved.
Show resolved Hide resolved
if (isMobileDeviceAndWidth) {
if (hasInjectedWallet()) {
return <>To use Polkaverse, you need to connect your wallet</>
}
return (
<>
To use PolkaVerse, you need a wallet to manage your account. We recommend Nova
Wallet.
</>
)
}
return (
<>
Choose one of the available wallet providers to connect to {config.appName}.{' '}
<ExternalLink
url='https://docs.subsocial.network/docs/tutorials/#polkadotjs'
value='How do I set up a wallet?'
/>
</>
)
})()}
>
{config.enableConfirmationLessMode ? (
<>
Expand Down
24 changes: 20 additions & 4 deletions src/components/common/balances/Balance.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,15 @@ function format(
decimals: number,
withSi?: boolean,
_isShort?: boolean,
precision?: number,
withMutedDecimals = true,
): React.ReactNode {
const [prefix, postfix] = formatBalance(value, { forceUnit: '-', decimals, withSi: false }).split(
'.',
)
const [prefix, postfix] = formatBalance(value, {
forceUnit: '-',
decimals,
withSi: false,
withZero: true,
}).split('.')
const isShort = _isShort || (withSi && prefix.length >= K_LENGTH)

if (prefix.length > M_LENGTH) {
Expand All @@ -45,7 +50,12 @@ function format(
{prefix}
{!isShort && (
<>
.<span className='DfBalanceDecimals'>{postfix || '0000'}</span>
.
<span className={clsx(withMutedDecimals && 'DfBalanceDecimals')}>
{precision
? parseFloat(`0.${postfix}`).toPrecision(precision).substring(2)
: postfix || '0000'}
</span>
</>
)}
&nbsp;{currency}
Expand All @@ -58,6 +68,8 @@ type FormatBalanceProps = BareProps & {
decimals?: number
currency?: string
isShort?: boolean
precision?: number
withMutedDecimals?: boolean
}

export const FormatBalance = ({
Expand All @@ -66,6 +78,8 @@ export const FormatBalance = ({
currency,
isShort,
className,
precision,
withMutedDecimals = true,
...bareProps
}: FormatBalanceProps) => {
if (!value) return null
Expand All @@ -78,6 +92,8 @@ export const FormatBalance = ({
decimals || defaultDecimal,
true,
isShort,
precision,
withMutedDecimals,
)

return (
Expand Down
Loading