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

Channels Integration #38

Merged
merged 79 commits into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from 77 commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
e5cfa0c
Add channels page
teodorus-nathaniel Aug 21, 2024
69a7b09
Remove unnecessary props
teodorus-nathaniel Aug 21, 2024
3ff36b9
Finish channels page ui
teodorus-nathaniel Aug 26, 2024
3a8e7b0
Finish most channels page UI
teodorus-nathaniel Aug 26, 2024
a3f6906
Integrate content container data to navbar
teodorus-nathaniel Aug 27, 2024
2369249
Refactor meme chat room
teodorus-nathaniel Aug 27, 2024
f257158
Fix prefetching not working
teodorus-nathaniel Aug 27, 2024
a81b332
Integrate thresholdandrules and tasks with new params
teodorus-nathaniel Aug 27, 2024
3b682b8
Add tasks query
teodorus-nathaniel Aug 28, 2024
2c1c9df
Add moderation mode button
teodorus-nathaniel Aug 28, 2024
81b7e88
Add channel filter in moderator page
teodorus-nathaniel Aug 28, 2024
462e7df
Add evm linking
teodorus-nathaniel Aug 29, 2024
b18e4da
Add unlink
teodorus-nathaniel Aug 29, 2024
e1bd17a
Add solana provider
teodorus-nathaniel Aug 29, 2024
ef9b875
Integrate unlink call
teodorus-nathaniel Aug 29, 2024
60ca13b
Add rootSpace
teodorus-nathaniel Aug 29, 2024
38276e0
Finish integration for tasks
teodorus-nathaniel Aug 29, 2024
630ebcf
Add enabled true to all add provider calls
teodorus-nathaniel Aug 30, 2024
02cec9d
Fix type errors
teodorus-nathaniel Aug 30, 2024
576b30e
Remove enabled true from identity calls
teodorus-nathaniel Aug 30, 2024
e1d7ca2
wallet not appearing text only showing after user click sign
teodorus-nathaniel Aug 30, 2024
c75787e
Merge branch 'dev/channels' into dev/epic
samchuk-vlad Sep 2, 2024
7709783
Fix after merge
samchuk-vlad Sep 2, 2024
344e287
Fix height
samchuk-vlad Sep 2, 2024
1da462f
Finish solana connect flow
teodorus-nathaniel Sep 2, 2024
07aacf4
Change add external provider to normal call
teodorus-nathaniel Sep 2, 2024
77b96db
Add error pages
teodorus-nathaniel Sep 3, 2024
71a97ee
Remove log
teodorus-nathaniel Sep 3, 2024
08c65e6
Fix wrong bot redirect
teodorus-nathaniel Sep 3, 2024
d89a66b
Change back link to use deeplink
teodorus-nathaniel Sep 3, 2024
8cac9c1
Fix type error
teodorus-nathaniel Sep 3, 2024
5811f6d
Add query for top memes
samchuk-vlad Sep 4, 2024
f6b19b0
Merge remote-tracking branch 'origin/dev/channels' into dev/epic
samchuk-vlad Sep 4, 2024
8cdeddf
Add some logic for token gated
teodorus-nathaniel Sep 4, 2024
e7dbdd1
Add env settings
teodorus-nathaniel Sep 4, 2024
1b58f85
Refactor and separate components
teodorus-nathaniel Sep 4, 2024
a2b0298
Add evm connect wallet modal
samchuk-vlad Sep 4, 2024
d5a5b48
Merge branch 'dev/channels' into dev/epic
samchuk-vlad Sep 4, 2024
f6337c1
Add external token mutation
teodorus-nathaniel Sep 4, 2024
542dc2d
Add back redirect to telegram if accessed from desktop
teodorus-nathaniel Sep 4, 2024
2b59e25
Add sign message button
teodorus-nathaniel Sep 4, 2024
e8b32ed
Fix unlink modal
samchuk-vlad Sep 4, 2024
d2237da
Merge remote-tracking branch 'origin/dev/channels' into dev/epic
samchuk-vlad Sep 4, 2024
a025eb5
Fix after merge
samchuk-vlad Sep 4, 2024
b90df84
Add sync token balance button
teodorus-nathaniel Sep 4, 2024
10f44a3
Finish connect wallet modal if not pass requirement
teodorus-nathaniel Sep 4, 2024
78c6e09
Add token gated not enough token UI
teodorus-nathaniel Sep 4, 2024
2cea066
Finish sync loading feature
teodorus-nathaniel Sep 4, 2024
cad172a
Fix modals in crypto addresses menu item
samchuk-vlad Sep 4, 2024
d9d8777
Add identity subscription
samchuk-vlad Sep 4, 2024
333c47e
Fix redirect to channels page
samchuk-vlad Sep 4, 2024
87079dd
Fix solana address not updating
teodorus-nathaniel Sep 5, 2024
ac3f64a
Add user info to meme preview
samchuk-vlad Sep 5, 2024
c54b078
Merge remote-tracking branch 'origin/dev/channels' into dev/epic
samchuk-vlad Sep 5, 2024
65853f6
Fix after merge
samchuk-vlad Sep 5, 2024
33c8da5
Change redirect for memes preview on home page
samchuk-vlad Sep 5, 2024
db2f3ef
Add success modal
teodorus-nathaniel Sep 5, 2024
5d200a2
Reset state after close modal in tokengated modal
teodorus-nathaniel Sep 5, 2024
06595b6
Adjust channel detail ui
teodorus-nathaniel Sep 5, 2024
d57239f
Add tg no scroll to channels page
teodorus-nathaniel Sep 5, 2024
8b9421b
Change evm modal to drawer
teodorus-nathaniel Sep 5, 2024
555a4ea
Minor fixes
teodorus-nathaniel Sep 5, 2024
70b78ed
Refactor linked provider and add solana address validation in token g…
teodorus-nathaniel Sep 5, 2024
06c5b76
Minor code style
teodorus-nathaniel Sep 5, 2024
940c91f
Fix z index issue
teodorus-nathaniel Sep 5, 2024
e35eeb5
Fix names
teodorus-nathaniel Sep 5, 2024
c108006
Update solana wallet to open in new tab
teodorus-nathaniel Sep 5, 2024
efe53d7
Add hack to save last redirect
teodorus-nathaniel Sep 5, 2024
705d8be
Add open wallet step
teodorus-nathaniel Sep 5, 2024
57ea550
Improve loading of top memes and remove duplicate
teodorus-nathaniel Sep 5, 2024
8641cfb
Remove old meme page and integrate new place to get create comment po…
teodorus-nathaniel Sep 5, 2024
c1adeb3
Add unread count
teodorus-nathaniel Sep 5, 2024
500f5e4
Merge branch 'main' of https://github.com/dappforce/epic-app into dev…
teodorus-nathaniel Sep 6, 2024
ad17d80
Add prod env
teodorus-nathaniel Sep 6, 2024
c18419a
Remove unused image
teodorus-nathaniel Sep 6, 2024
eb068a8
Put public key in build deploy
teodorus-nathaniel Sep 6, 2024
d830a7b
Remove chat unread count in old component
teodorus-nathaniel Sep 6, 2024
3ec03e1
Prevent error
teodorus-nathaniel Sep 6, 2024
5e20ef4
Remove comment
teodorus-nathaniel Sep 6, 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
4 changes: 4 additions & 0 deletions .github/workflows/build-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ jobs:
GH_NEYNAR_API_KEY=${{ secrets.GH_NEYNAR_API_KEY }}
GH_NEXT_PUBLIC_TELEGRAM_BOT_ID=6523818125
GH_NEXT_PUBLIC_TELEGRAM_BOT_USERNAME=EpicAppBot
GH_NEXT_PUBLIC_DAPP_PUBLIC_KEY=7iXtxm8bXK7XGSvnHzYZSojYHYoNiMa4m59ZovYwBzy5
GH_DAPP_SECRET_KEY=${{ secrets.GH_DAPP_SECRET_KEY }}
target: runner
tags: |
${{ env.image }}
Expand Down Expand Up @@ -135,6 +137,8 @@ jobs:
GH_NEXT_PUBLIC_TELEGRAM_BOT_USERNAME=subsocial_staging_bot
GH_NEXT_PUBLIC_NEYNAR_CLIENT_ID=e8dc01b0-046c-4698-98ac-05432050961d
GH_FRAMES_SECRET=JG/W96svVHQ3bdaEKWm1h8xJXqxDtqZ6t7tKCZNWhh0=
GH_NEXT_PUBLIC_DAPP_PUBLIC_KEY=GqJKFQavHPEvngh6hNwt9FbqcEYsNvduGvyQuT6ARTHk
GH_DAPP_SECRET_KEY=85Nb7L8gVozH99wYYu4Ggx64DVFKUXH15iwxSNGCgHBs
target: runner
tags: |
${{ env.image }}
Expand Down
4 changes: 3 additions & 1 deletion ci.env
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ NEXT_PUBLIC_IS_MAINTENANCE='$GH_NEXT_PUBLIC_IS_MAINTENANCE'
NEXT_PUBLIC_NEYNAR_CLIENT_ID='$GH_NEXT_PUBLIC_NEYNAR_CLIENT_ID'
FRAMES_SECRET='$GH_FRAMES_SECRET'
NEYNAR_API_KEY='$GH_NEYNAR_API_KEY'
NEXT_PUBLIC_DAPP_PUBLIC_KEY='$GH_NEXT_PUBLIC_DAPP_PUBLIC_KEY'
DAPP_SECRET_KEY='$GH_DAPP_SECRET_KEY'
NEXT_PUBLIC_TELEGRAM_BOT_ID='$GH_NEXT_PUBLIC_TELEGRAM_BOT_ID'
NEXT_PUBLIC_TELEGRAM_BOT_USERNAME='$GH_NEXT_PUBLIC_TELEGRAM_BOT_USERNAME'
MODERATION_URL='$GH_MODERATION_URL'
Expand Down Expand Up @@ -48,4 +50,4 @@ NEXT_PUBLIC_OFFCHAIN_POSTING_HUBS='$GH_NEXT_PUBLIC_OFFCHAIN_POSTING_HUBS'
NEXT_PUBLIC_TELEGRAM_NOTIFICATION_BOT='$GH_NEXT_PUBLIC_TELEGRAM_NOTIFICATION_BOT'
NEXTAUTH_SECRET='$GH_NEXTAUTH_SECRET'
NEXTAUTH_URL='$GH_NEXTAUTH_URL'
NEXT_PUBLIC_BASE_URL='$GH_NEXT_PUBLIC_BASE_URL'
NEXT_PUBLIC_BASE_URL='$GH_NEXT_PUBLIC_BASE_URL'
7 changes: 7 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ ARG GH_NEXT_PUBLIC_IS_MAINTENANCE
ARG GH_NEXT_PUBLIC_NEYNAR_CLIENT_ID
ARG GH_FRAMES_SECRET
ARG GH_NEYNAR_API_KEY
ARG GH_NEXT_PUBLIC_DAPP_PUBLIC_KEY
ARG GH_NEXT_PUBLIC_TELEGRAM_BOT_ID
ARG GH_NEXT_PUBLIC_TELEGRAM_BOT_USERNAME
ARG GH_NEXT_PUBLIC_AMP_ID
Expand Down Expand Up @@ -56,6 +57,8 @@ ENV NEXTAUTH_URL=${GH_NEXTAUTH_URL} \
NEXT_PUBLIC_NEYNAR_CLIENT_ID=${GH_NEXT_PUBLIC_NEYNAR_CLIENT_ID} \
FRAMES_SECRET=${GH_FRAMES_SECRET} \
NEYNAR_API_KEY=${GH_NEYNAR_API_KEY} \
NEXT_PUBLIC_DAPP_PUBLIC_KEY=${GH_NEXT_PUBLIC_DAPP_PUBLIC_KEY} \
DAPP_SECRET_KEY=${GH_DAPP_SECRET_KEY} \
NEXT_PUBLIC_TELEGRAM_BOT_ID=${GH_NEXT_PUBLIC_TELEGRAM_BOT_ID} \
NEXT_PUBLIC_TELEGRAM_BOT_USERNAME=${GH_NEXT_PUBLIC_TELEGRAM_BOT_USERNAME} \
NEXT_PUBLIC_SUBSTRATE_WSS=${GH_NEXT_PUBLIC_SUBSTRATE_WSS} \
Expand Down Expand Up @@ -119,6 +122,8 @@ ARG GH_NEXT_PUBLIC_BASE_PATH
ARG GH_NEXT_PUBLIC_IS_MAINTENANCE
ARG GH_NEXT_PUBLIC_NEYNAR_CLIENT_ID
ARG GH_FRAMES_SECRET
ARG GH_NEXT_PUBLIC_DAPP_PUBLIC_KEY
ARG GH_DAPP_SECRET_KEY
ARG GH_NEYNAR_API_KEY
ARG GH_NEXT_PUBLIC_TELEGRAM_BOT_ID
ARG GH_NEXT_PUBLIC_TELEGRAM_BOT_USERNAME
Expand Down Expand Up @@ -154,6 +159,8 @@ ENV NEXTAUTH_URL=${GH_NEXTAUTH_URL} \
NEXT_PUBLIC_NEYNAR_CLIENT_ID=${GH_NEXT_PUBLIC_NEYNAR_CLIENT_ID} \
FRAMES_SECRET=${GH_FRAMES_SECRET} \
NEYNAR_API_KEY=${GH_NEYNAR_API_KEY} \
NEXT_PUBLIC_DAPP_PUBLIC_KEY=${GH_NEXT_PUBLIC_DAPP_PUBLIC_KEY} \
DAPP_SECRET_KEY=${GH_DAPP_SECRET_KEY} \
NEXT_PUBLIC_TELEGRAM_BOT_ID=${GH_NEXT_PUBLIC_TELEGRAM_BOT_ID} \
NEXT_PUBLIC_TELEGRAM_BOT_USERNAME=${GH_NEXT_PUBLIC_TELEGRAM_BOT_USERNAME} \
NEXT_PUBLIC_SUBSTRATE_WSS=${GH_NEXT_PUBLIC_SUBSTRATE_WSS} \
Expand Down
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@
"@polkadot/react-identicon": "^3.6.5",
"@polkadot/util": "^12.1.2",
"@rainbow-me/rainbowkit": "^1.3.5",
"@solana/wallet-adapter-base": "^0.9.23",
"@solana/wallet-adapter-react": "^0.15.35",
"@solana/wallet-adapter-react-ui": "^0.9.35",
"@solana/wallet-adapter-wallets": "^0.19.32",
"@solana/web3.js": "^1.95.3",
"@subsocial/api": "^0.8.14",
"@subsocial/data-hub-sdk": "dappforce/subsocial-data-hub-sdk#staging",
Expand Down
Binary file added src/assets/emojis/confused.png
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 src/assets/emojis/success.png
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 src/assets/graphics/eth-logo.png
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 src/assets/graphics/phantom-wallet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/components/BottomDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export default function BottomDrawer({
)}
<div className='mx-auto flex w-full max-w-screen-md flex-col gap-6 overflow-auto px-5 py-6 pb-6'>
<div className='flex flex-col gap-2'>
<span className='text-2xl font-medium'>{title}</span>
<span className={cx('text-2xl font-medium')}>{title}</span>
<span className='text-text-muted'>{description}</span>
</div>
<div className='flex w-full flex-col'>
Expand Down
39 changes: 39 additions & 0 deletions src/components/TabButtons.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { cx } from '@/utils/class-names'
import Button from './Button'

export default function TabButtons({
className,
selectedTab,
setSelectedTab,
tabs,
}: {
className?: string
tabs: string[]
selectedTab: string
setSelectedTab: (tab: string) => void
}) {
return (
<div
className={cx(
'grid grid-cols-2 gap-px rounded-full bg-background-light text-sm font-medium',
className
)}
>
{tabs.map((tab) => (
<Button
key={tab}
variant={selectedTab === tab ? 'primary' : 'transparent'}
className={cx(
'h-10 py-0',
selectedTab === tab
? 'bg-background-primary/30'
: 'bg-background-light'
)}
onClick={() => setSelectedTab(tab)}
>
{tab}
</Button>
))}
</div>
)
}
105 changes: 105 additions & 0 deletions src/components/TaskCard.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
import Diamond from '@/assets/emojis/diamond.png'
import Check from '@/assets/icons/check.svg'
import Card from '@/components/Card'
import { Skeleton } from '@/components/SkeletonFallback'
import { cx } from '@/utils/class-names'
import { formatNumber } from '@/utils/strings'
import Image, { ImageProps } from 'next/image'
import Link from 'next/link'
import { CSSProperties } from 'react'
import { FaChevronRight } from 'react-icons/fa6'

export default function TaskCard({
completed,
image,
reward,
title,
customAction,
onClick,
href,
openInNewTab,
isLoadingReward,
withoutDiamondIcon,
topBanner,
}: {
image: ImageProps['src']
title: React.ReactNode
reward: number | string
completed: boolean
customAction?: React.ReactNode
onClick?: () => void
href?: string
openInNewTab?: boolean
isLoadingReward?: boolean
withoutDiamondIcon?: boolean
topBanner?: {
icon: JSX.Element
text: string
className?: string
textStyle?: CSSProperties
textClassName?: string
}
}) {
const card = (
<Card className='flex cursor-pointer flex-col overflow-clip rounded-2xl p-0'>
{topBanner && (
<div className='bg-background'>
<div
className={cx(
'flex items-center justify-center gap-1 py-1.5 text-xs',
topBanner.className
)}
>
<span className='text-sm'>{topBanner.icon}</span>
<span
className={cx('font-medium', topBanner.textClassName)}
style={topBanner.textStyle}
>
{topBanner.text}
</span>
</div>
</div>
)}
<div
className='flex items-center gap-2.5 bg-background-light p-2.5 transition active:bg-background-lighter'
onClick={onClick}
>
<Image src={image} alt='' className='h-14 w-14' />
<div className='flex flex-col gap-1'>
<span className='font-bold'>{title}</span>
<div className='flex items-center gap-0.5'>
{!withoutDiamondIcon && (
<Image src={Diamond} alt='' className='relative top-px h-5 w-5' />
)}
{isLoadingReward ? (
<Skeleton className='w-12' />
) : (
<span className='text-text-muted'>
{typeof reward === 'number'
? `+${formatNumber(reward)}`
: reward}
</span>
)}
</div>
</div>
<div className='ml-auto flex items-center justify-center pr-1'>
{completed ? (
<Check />
) : customAction ? (
customAction
) : (
<FaChevronRight className='text-text-muted' />
)}
</div>
</div>
</Card>
)
if (href) {
return (
<Link target={openInNewTab ? '_blank' : undefined} href={href}>
{card}
</Link>
)
}
return card
}
14 changes: 14 additions & 0 deletions src/components/auth/common/evm/CommonEvmModalContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
getLinkedIdentityQuery,
} from '@/services/datahub/identity/query'
import { useMyAccount, useMyGrillAddress } from '@/stores/my-account'
import { lastRedirectProtocol } from '@/utils/globals'
import { getCurrentUrlOrigin } from '@/utils/links'
import { openNewWindow, twitterShareUrl } from '@/utils/social-share'
import { IdentityProvider as SDKIdentityProvider } from '@subsocial/data-hub-sdk'
Expand Down Expand Up @@ -146,6 +147,19 @@ export const CommonEVMLoginContent = ({
className='w-full'
label={buttonLabel}
secondLabel='Sign Message'
hideButton={isSigning}
additionalSecondActionLabel={
isSigning && (
<Button
size='lg'
href={`${lastRedirectProtocol.protocol}://`}
target='_blank'
className='w-full'
>
Open wallet
</Button>
)
}
loadingText={!isSigned ? 'Pending Confirmation...' : 'Please wait...'}
/>
)
Expand Down
37 changes: 24 additions & 13 deletions src/components/auth/common/evm/CustomConnectButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ type CustomConnectButtonProps = ButtonProps & {
className?: string
label?: React.ReactNode
secondLabel?: React.ReactNode
additionalSecondActionLabel?: React.ReactNode
withWalletActionImage?: boolean
onSuccessConnect: (evmAddress: string) => Promise<void>
isLoading: boolean
hideButton?: boolean
}

export const CustomConnectButton = ({
Expand All @@ -23,6 +25,8 @@ export const CustomConnectButton = ({
label = 'Connect Ethereum Address',
withWalletActionImage = true,
secondLabel,
additionalSecondActionLabel,
hideButton,
isLoading,
...buttonProps
}: CustomConnectButtonProps) => {
Expand Down Expand Up @@ -81,7 +85,7 @@ export const CustomConnectButton = ({
commonButtonProps.onClick?.(e as any)
}}
>
{usedLabel}
{label}
</Button>
)
}
Expand All @@ -102,17 +106,22 @@ export const CustomConnectButton = ({
}

return (
<Button
{...commonButtonProps}
onClick={async () => {
setHasInteractedOnce(true)
const connector = getConnector()
isTouchDevice() && (await openMobileWallet({ connector }))
onSuccess(account.address)
}}
>
{usedLabel}
</Button>
<>
{!hideButton && (
<Button
{...commonButtonProps}
onClick={async () => {
setHasInteractedOnce(true)
const connector = getConnector()
isTouchDevice() && (await openMobileWallet({ connector }))
onSuccess(account.address)
}}
>
{usedLabel}
</Button>
)}
{additionalSecondActionLabel}
</>
)
}}
</ConnectButton.Custom>
Expand All @@ -126,7 +135,9 @@ export const CustomConnectButton = ({
<LinkingDark className='hidden w-full dark:block' />
</div>

{customButton}
<div className='flex w-full flex-col items-center gap-2'>
{customButton}
</div>
</div>
)
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/chats/ChatForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ export default function ChatForm({
const isSufficient = await refetch()
if (!isSufficient.data) {
refetch()
setOpenMessageModal('not-enough-balance', chatId)
setOpenMessageModal('not-enough-balance', { chatId })
return
}
resetForm()
Expand Down
Loading
Loading