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

old web: add TM app banner #4303

Merged
merged 3 commits into from
Dec 20, 2024
Merged
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
3 changes: 3 additions & 0 deletions apps/tlon-web/src/app.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright 2022, Tlon Corporation
import * as Toast from '@radix-ui/react-toast';
import { TooltipProvider } from '@radix-ui/react-tooltip';
import cookies from 'browser-cookies';
import { usePostHog } from 'posthog-js/react';
Expand Down Expand Up @@ -98,6 +99,7 @@ import ThreadVolumeDialog from './channels/ThreadVolumeDialog';
import MobileChatSearch from './chat/ChatSearch/MobileChatSearch';
import DevLog from './components/DevLog/DevLog';
import DevLogsView from './components/DevLog/DevLogView';
import MobileAppToast from './components/MobileAppToast';
import ReportContent from './components/ReportContent';
import BlockedUsersDialog from './components/Settings/BlockedUsersDialog';
import BlockedUsersView from './components/Settings/BlockedUsersView';
Expand Down Expand Up @@ -639,6 +641,7 @@ const App = React.memo(function AppComponent() {
return (
<div className="flex h-full w-full flex-col">
<DisconnectNotice />
<MobileAppToast />
<Firehose />
<LeapProvider>
<ChatInputFocusProvider>
Expand Down
54 changes: 54 additions & 0 deletions apps/tlon-web/src/components/MobileAppToast.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import * as Toast from '@radix-ui/react-toast';
import { useLocalStorage } from 'usehooks-ts';

import TlonIcon from './icons/TlonIcon';

export default function MobileAppToast() {
const [open, setOpen] = useLocalStorage('showMobileAppToast', true);

return (
<Toast.Provider>
<div className="relative flex flex-col items-center">
<Toast.Root duration={10000} open={open} onOpenChange={setOpen}>
<Toast.Description asChild>
<div className="absolute w-full z-50 flex flex-col md:flex-row -translate-x-2/4 items-center justify-between space-x-2 bg-white font-semibold text-black shadow-xl dark:bg-gray-200 p-4">
<div className="flex items-center space-x-2">
<TlonIcon className="w-6 h-6" />
<span className="px-4 py-2">
The all-new Tlon Messenger mobile app is now available.
</span>
</div>
<div className="flex space-x-2">
<a
href="https://apps.apple.com/us/app/tlon-tlon-messenger/id6451392109"
target="_blank"
rel="noreferrer"
className="button"
>
App Store
</a>
<a
href="https://play.google.com/store/apps/details?id=io.tlon.groups"
target="_blank"
rel="noreferrer"
className="button"
>
Google Play
</a>
<button
className="secondary-button"
onClick={() => {
setOpen(false);
}}
>
Dismiss
</button>
</div>
</div>
</Toast.Description>
</Toast.Root>
<Toast.Viewport label="new app notice" />
</div>
</Toast.Provider>
);
}
Loading