Skip to content

Commit

Permalink
Initial changes
Browse files Browse the repository at this point in the history
  • Loading branch information
WRadoslaw committed Apr 23, 2024
1 parent d24f6bd commit 3c5fcdb
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
11 changes: 11 additions & 0 deletions packages/atlas/src/providers/notifications/notifications.hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,17 @@ export const useNotifications = (opts?: Pick<QueryHookOptions, 'notifyOnNetworkS
const refetchFn = networkUtils[refetchAction.name]
refetchedNotifications.set(id, 1)
refetchFn(...(refetchAction.args as Parameters<typeof refetchFn>))
if ('ReactNativeWebView' in window) {
// const rNBridge = window.ReactNativeWebView as any
// rNBridge.postMessage(
// JSON.stringify({
// type: 'notification',
// payload: {
// title: `new notification ${id}`,
// },
// })
// )
}
}
})
}, [networkUtils, notifications])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export const ReferralsVideo = () => {
<LayoutGrid>
<GridItem colSpan={{ base: 12, lg: 10 }} colStart={{ lg: 2 }}>
<StyledVideoWrapper>
<StyledVideo ref={videoRef} autoPlay loop muted>
<StyledVideo ref={videoRef} playsInline autoPlay loop muted>
<source
src="https://eu-central-1.linodeobjects.com/atlas-assets/categories/gleev/videos/referrals/Referrals_dashboard.mp4"
type="video/mp4"
Expand Down
22 changes: 22 additions & 0 deletions packages/atlas/src/views/viewer/HomeView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { VideoTileViewer } from '@/components/_video/VideoTileViewer'
import { getPublicCryptoVideoFilter } from '@/config/contentFilter'
import { useHeadTags } from '@/hooks/useHeadTags'
import { useInfiniteVideoGrid } from '@/hooks/useInfiniteVideoGrid'
import { useMountEffect } from '@/hooks/useMountEffect'
import { useVideoGridRows } from '@/hooks/useVideoGridRows'
import { DEFAULT_VIDEO_GRID, sizes } from '@/styles'
import { createPlaceholderData } from '@/utils/data'
Expand All @@ -22,6 +23,27 @@ export const HomeView: FC = () => {
const headTags = useHeadTags()
const { columns, fetchMore, tiles, loading, pageInfo } = useHomeVideos()

useMountEffect(() => {
const id = setInterval(() => {
if ('ReactNativeWebView' in window) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const rNBridge = window.ReactNativeWebView as any
rNBridge.postMessage(
JSON.stringify({
type: 'notification',
payload: {
title: `new notification ${id}`,
},
})
)
}
}, 30_000)

return () => {
clearInterval(id)
}
})

return (
<VideoContentTemplate>
<ReferralsBanner />
Expand Down

0 comments on commit 3c5fcdb

Please sign in to comment.