Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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 packages/shared/src/components/MainLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import classNames from 'classnames';
import { useRouter } from 'next/router';
import dynamic from 'next/dynamic';
import PromotionalBanner from './PromotionalBanner';
import { MobileAppLoader } from './MobileAppLoader';
import useSidebarRendered from '../hooks/useSidebarRendered';
import { useLogContext } from '../contexts/LogContext';
import SettingsContext from '../contexts/SettingsContext';
Expand All @@ -27,6 +28,7 @@ import {
useActiveFeedNameContext,
} from '../contexts';
import { useFeedLayout, useViewSize, ViewSize } from '../hooks';
import { isPWA } from '../lib/func';
import { BootPopups } from './modals/BootPopups';
import { useFeedName } from '../hooks/feed/useFeedName';
import { AuthTriggers } from '../lib/auth';
Expand Down Expand Up @@ -165,6 +167,9 @@ function MainLayoutComponent({
(!isPageReady && isPageApplicableForOnboarding) ||
shouldRedirectOnboarding
) {
if (typeof window !== 'undefined' && isPWA()) {
Copy link
Contributor

@capJavert capJavert Feb 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also have:

  • iOS native app - isIOSNative helper
  • Android app - isAndroidApp in AuthContext

I know clunky but just if you wanted to target those as well.

return <MobileAppLoader />;
}
return null;
}

Expand Down
29 changes: 29 additions & 0 deletions packages/shared/src/components/MobileAppLoader.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import type { ReactElement } from 'react';
import React from 'react';
import classNames from 'classnames';
import { cloudinaryAppIconMain } from '../lib/image';
import { Loader } from './Loader';

interface MobileAppLoaderProps {
className?: string;
}

export function MobileAppLoader({
className,
}: MobileAppLoaderProps): ReactElement {
return (
<div
className={classNames(
'fixed inset-0 z-50 flex flex-col items-center justify-center gap-6 bg-background-default',
className,
)}
>
<img
src={cloudinaryAppIconMain}
alt="daily.dev"
className="float-animation size-20 rounded-[22%]"
/>
<Loader className="size-5" />
</div>
);
}