Support app deep-linking
This commit is contained in:
parent
84907930cb
commit
318d7fdc48
|
@ -3,6 +3,7 @@ import React from 'react';
|
||||||
import { useHistory } from 'react-router-dom';
|
import { useHistory } from 'react-router-dom';
|
||||||
|
|
||||||
import Helmet from 'soapbox/components/helmet';
|
import Helmet from 'soapbox/components/helmet';
|
||||||
|
import { useSoapboxConfig } from 'soapbox/hooks';
|
||||||
|
|
||||||
import { Card, CardBody, CardHeader, CardTitle } from '../card/card';
|
import { Card, CardBody, CardHeader, CardTitle } from '../card/card';
|
||||||
|
|
||||||
|
@ -24,6 +25,7 @@ const Column: React.FC<IColumn> = React.forwardRef((props, ref: React.ForwardedR
|
||||||
const { backHref, children, label, transparent = false, withHeader = true, className } = props;
|
const { backHref, children, label, transparent = false, withHeader = true, className } = props;
|
||||||
|
|
||||||
const history = useHistory();
|
const history = useHistory();
|
||||||
|
const soapboxConfig = useSoapboxConfig();
|
||||||
|
|
||||||
const handleBackClick = () => {
|
const handleBackClick = () => {
|
||||||
if (backHref) {
|
if (backHref) {
|
||||||
|
@ -60,7 +62,17 @@ const Column: React.FC<IColumn> = React.forwardRef((props, ref: React.ForwardedR
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div role='region' className='relative' ref={ref} aria-label={label} column-type={transparent ? 'transparent' : 'filled'}>
|
<div role='region' className='relative' ref={ref} aria-label={label} column-type={transparent ? 'transparent' : 'filled'}>
|
||||||
<Helmet><title>{label}</title></Helmet>
|
<Helmet>
|
||||||
|
<title>{label}</title>
|
||||||
|
|
||||||
|
{soapboxConfig.appleAppId && (
|
||||||
|
<meta
|
||||||
|
data-react-helmet='true'
|
||||||
|
name='apple-itunes-app'
|
||||||
|
content={`app-id=${soapboxConfig.appleAppId}, app-argument=${location.href}`}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</Helmet>
|
||||||
|
|
||||||
{renderChildren()}
|
{renderChildren()}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -151,10 +151,6 @@ const SoapboxMount = () => {
|
||||||
<body className={bodyClass} />
|
<body className={bodyClass} />
|
||||||
{themeCss && <style id='theme' type='text/css'>{`:root{${themeCss}}`}</style>}
|
{themeCss && <style id='theme' type='text/css'>{`:root{${themeCss}}`}</style>}
|
||||||
<meta name='theme-color' content={soapboxConfig.brandColor} />
|
<meta name='theme-color' content={soapboxConfig.brandColor} />
|
||||||
|
|
||||||
{soapboxConfig.appleAppId && (
|
|
||||||
<meta name='apple-itunes-app' content={`app-id=${soapboxConfig.appleAppId}`} />
|
|
||||||
)}
|
|
||||||
</Helmet>
|
</Helmet>
|
||||||
|
|
||||||
<ErrorBoundary>
|
<ErrorBoundary>
|
||||||
|
|
Loading…
Reference in New Issue