Skip to content

Commit

Permalink
Merge branch 'deploy/epic' into epic-base
Browse files Browse the repository at this point in the history
  • Loading branch information
samchuk-vlad committed Jun 27, 2024
2 parents 5dce9a3 + c219acc commit 3ca61e2
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 5 deletions.
Binary file added src/assets/icons/warning.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/components/chats/ChatList/ChatList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ function ChatListContent({
hubId,
chatId,
})

const lastFocusedTime = useLastFocusedMessageTime(chatId, messageIds[0] ?? '')

useEffect(() => {
Expand Down
8 changes: 8 additions & 0 deletions src/components/modals/RewardPerDayModal.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Diamond from '@/assets/emojis/diamond.png'
import WarningIcon from '@/assets/icons/warning.png'
import { getUserYesterdayRewardQuery } from '@/services/datahub/content-staking/query'
import { useSendEvent } from '@/stores/analytics'
import { useMyMainAddress } from '@/stores/my-account'
Expand Down Expand Up @@ -101,6 +102,13 @@ Sounds too good to be true? Join me and see for yourself! 😉`
</span>
</Card>
)}
<div className='flex items-center gap-2 rounded-2xl bg-[#EF444480] p-4'>
<Image src={WarningIcon} alt='' className='' />
<span className='flex-1 text-sm font-medium text-red-300'>
Some of your rewards could have been removed for activity with{' '}
<span className='text-text underline'>irrelevant content</span>
</span>
</div>
</div>
<div className='grid w-full grid-cols-2 gap-4'>
<Button
Expand Down
8 changes: 7 additions & 1 deletion src/modules/points/PointsPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,22 @@ import SlotCounter from 'react-slot-counter'

function Points({
shorten,
shortWhenValueTooBig,
withPointsAnimation = true,
}: {
shorten?: boolean
shortWhenValueTooBig?: boolean
withPointsAnimation?: boolean
}) {
const isInitializedProxy = useMyAccount.use.isInitializedProxy()
const myAddress = useMyMainAddress()
const { data, isLoading } = getBalanceQuery.useQuery(myAddress || '')

const formatted = formatNumber(data ?? '0', { shorten })
const value = data ?? 0

const shortenValue = shortWhenValueTooBig && value > 99999 ? true : shorten

const formatted = formatNumber(value, { shorten: shortenValue })
const splitValues = useMemo(() => {
return formatted.split('')
}, [formatted])
Expand Down
16 changes: 14 additions & 2 deletions src/modules/points/PointsWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import Button from '@/components/Button'
import Card from '@/components/Card'
import LinkText from '@/components/LinkText'
import Name from '@/components/Name'
import RewardPerDayModal from '@/components/modals/RewardPerDayModal'
import SubsocialProfileModal from '@/components/subsocial-profile/SubsocialProfileModal'
import useIsMounted from '@/hooks/useIsMounted'
import { useSendEvent } from '@/stores/analytics'
Expand Down Expand Up @@ -206,6 +207,7 @@ const UserStatsSection = ({
const myAddress = useMyMainAddress()
const sendEvent = useSendEvent()
const [openProfileModal, setOpenProfileModal] = useState(false)
const [openRewardModal, setOpenRewardModal] = useState(false)

return (
<>
Expand Down Expand Up @@ -269,10 +271,14 @@ const UserStatsSection = ({
</div>
<div className='flex w-full flex-col gap-2'>
<span className='text-text-muted'>POINTS EARNED:</span>
<div className='mr-1 flex items-center gap-3'>
<div
className='mr-1 flex items-center gap-3'
onClick={() => setOpenRewardModal(true)}
>
<Image src={Diamond} alt='' className='h-8 w-8' />
<span className='flex h-8 items-center text-2xl font-bold'>
<Points />
<Points shortWhenValueTooBig />{' '}
<span className='ml-1 text-red-400'>*</span>
</span>
</div>
<div className='flex'>
Expand All @@ -283,6 +289,12 @@ const UserStatsSection = ({
</div>
</div>
</div>
<RewardPerDayModal
isOpen={openRewardModal}
close={() => {
setOpenRewardModal(false)
}}
/>
<SubsocialProfileModal
title='✏️ Edit Profile'
closeModal={() => setOpenProfileModal(false)}
Expand Down
2 changes: 2 additions & 0 deletions src/modules/telegram/MemesPage.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import LayoutWithBottomNavigation from '@/components/layouts/LayoutWithBottomNavigation'
import HomePageModals from '@/components/modals/HomePageModals'
import LikeIntroModal from '@/components/modals/LikeIntroModal'
import { env } from '@/env.mjs'
import useTgNoScroll from '@/hooks/useTgNoScroll'
Expand All @@ -13,6 +14,7 @@ const MemesPage = () => {
<LayoutWithBottomNavigation withFixedHeight className='relative'>
<LikeIntroModal />
<ChatsContent />
<HomePageModals />
</LayoutWithBottomNavigation>
)
}
Expand Down
2 changes: 0 additions & 2 deletions src/modules/telegram/TapPage/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import TapFromMobileImage from '@/assets/graphics/tap-from-mobile.png'
import SkeletonFallback from '@/components/SkeletonFallback'
import LayoutWithBottomNavigation from '@/components/layouts/LayoutWithBottomNavigation'
import HomePageModals from '@/components/modals/HomePageModals'
import useTgNoScroll from '@/hooks/useTgNoScroll'
import PointsWidget from '@/modules/points/PointsWidget'
import {
Expand All @@ -28,7 +27,6 @@ const TapPage = () => {
className='sticky top-0'
/>
<TapPageContent />
<HomePageModals />
</LayoutWithBottomNavigation>
)
}
Expand Down

0 comments on commit 3ca61e2

Please sign in to comment.