diff --git a/pkg/grid/src/nav/notifications/OnboardingNotification.tsx b/pkg/grid/src/nav/notifications/OnboardingNotification.tsx index 1919c9eeb..cc6b91eaa 100644 --- a/pkg/grid/src/nav/notifications/OnboardingNotification.tsx +++ b/pkg/grid/src/nav/notifications/OnboardingNotification.tsx @@ -43,6 +43,16 @@ const cards: OnboardingCardProps[] = [ // } ]; +if (window?.navigator?.registerProtocolHandler) { + cards.push({ + title: 'Open Urbit-Native Links', + body: 'Enable your Urbit to open links you find in the wild', + button: 'Enable Link Handler', + color: '#82A6CA', + href: '/apps/grid/leap/system-preferences/interface' + }); +} + interface OnboardingCardProps { title: string; button: string; diff --git a/pkg/interface/src/views/apps/launch/components/tiles.tsx b/pkg/interface/src/views/apps/launch/components/tiles.tsx index 5833333b3..f7cf13433 100644 --- a/pkg/interface/src/views/apps/launch/components/tiles.tsx +++ b/pkg/interface/src/views/apps/launch/components/tiles.tsx @@ -1,9 +1,7 @@ import React, { ReactElement } from 'react'; import useLaunchState from '~/logic/state/launch'; import { WeatherState } from '~/types'; -import BasicTile from './tiles/basic'; import ClockTile from './tiles/clock'; -import CustomTile from './tiles/custom'; import WeatherTile from './tiles/weather'; const Tiles = (): ReactElement => { @@ -16,16 +14,7 @@ const Tiles = (): ReactElement => { return tile.isShown; }).map((key) => { const tile = tileState[key]; - if ('basic' in tile.type) { - const basic = tile.type.basic; - return ( - - ); - } else if ('custom' in tile.type) { + if ('custom' in tile.type) { if (key === 'weather') { return ( @@ -35,14 +24,6 @@ const Tiles = (): ReactElement => { return ( ); - } else { - return ( - - ); } } return null; diff --git a/pkg/interface/src/views/apps/permalinks/embed.tsx b/pkg/interface/src/views/apps/permalinks/embed.tsx index 743bc49dd..ceee42b82 100644 --- a/pkg/interface/src/views/apps/permalinks/embed.tsx +++ b/pkg/interface/src/views/apps/permalinks/embed.tsx @@ -224,8 +224,12 @@ function AppTile({ color, image, ...props }: AppTileProps) { ); } +window.navigator.registerProtocolHandler = undefined; + function AppPermalink({ link, ship, desk }: Omit) { const treaty = useTreaty(ship, desk); + const hasProtocolHandling = Boolean(window?.navigator?.registerProtocolHandler); + const href = hasProtocolHandling ? link : `/apps/grid/perma?ext=${link}`; useEffect(() => { if (!treaty) { @@ -252,7 +256,7 @@ function AppPermalink({ link, ship, desk }: Omit) { {treaty?.info} - + );