diff --git a/conferences/big-party-v/schedule.tsx b/conferences/big-party-v/schedule.tsx
index 009ef2a..345207a 100644
--- a/conferences/big-party-v/schedule.tsx
+++ b/conferences/big-party-v/schedule.tsx
@@ -1,4 +1,5 @@
import { styles } from './schedule.styles'
+import { Fragment } from 'react'
const DATA: ScheduleItemModel[] = [
{
@@ -176,7 +177,7 @@ const ScheduleItem = (props: ScheduleItemModel) => {
{speakerBios.map((item, idx) => {
return (
- <>
+
: null}
- >
+
Redirecting...
+ > + ) + } + + return Redirect +} + +export const redirectTo = (redirectUrl: string, { external = true } = {}) => { + const Redirect = () => { + const router = useRouter() + + useEffect(() => { + if (external) { + window.location.href = redirectUrl + return + } + router.push(redirectUrl) + }, []) + + return React.createElement('div', null, 'Redirecting...') + } + + return Redirect +} + +function serverRedirect(res: NextPageContext['res'], redirectUrl: string) { + if (res) { + res.writeHead(302, { Location: redirectUrl }) + res.end() + } +} diff --git a/shared/index.ts b/shared/index.ts index 7f16534..a8c2ffa 100644 --- a/shared/index.ts +++ b/shared/index.ts @@ -1 +1,3 @@ export * from './data' +export * from './external-redirect' +export * from './environment' diff --git a/typings/amp.d.ts b/typings/amp.d.ts index 4496aa7..1b80e57 100644 --- a/typings/amp.d.ts +++ b/typings/amp.d.ts @@ -1,4 +1,13 @@ declare namespace AMP { + type Layouts = + | 'responsive' + | 'fixed' + | 'fill' + | 'fixed-height' + | 'flex-item' + | 'container' + | 'nodisplay' + | 'intrinsic' interface AmpBaseElement extends JSX.IntrinsicAttributes {} interface AmpLightBox extends AmpBaseElement { @@ -18,15 +27,7 @@ declare namespace AMP { src?: string width?: string height?: string - layout?: - | 'responsive' - | 'fixed' - | 'fill' - | 'fixed-height' - | 'flex-item' - | 'container' - | 'nodisplay' - | 'intrinsic' + layout?: Layouts className?: string children?: React.ReactNode } @@ -42,4 +43,13 @@ declare namespace AMP { children?: React.ReactNode } interface AmpAnalytics extends AmpBaseElement {} + + interface AmpScript { + width?: string + height?: string + script?: string + src?: string + layout?: Layouts + children?: React.ReactNode + } }