diff --git a/apps/website/next.config.mjs b/apps/website/next.config.mjs index 15137965..fe30adab 100644 --- a/apps/website/next.config.mjs +++ b/apps/website/next.config.mjs @@ -30,6 +30,7 @@ let config = { experimental: { legacyBrowsers: false, // esmExternals: 'loose', + scrollRestoration: true, }, } diff --git a/apps/website/public/assets/favicon/blog.png b/apps/website/public/assets/favicon/blog.png new file mode 100644 index 00000000..2f8ffe74 Binary files /dev/null and b/apps/website/public/assets/favicon/blog.png differ diff --git a/apps/website/public/assets/favicon/default.png b/apps/website/public/assets/favicon/default.png new file mode 100644 index 00000000..2f8ffe74 Binary files /dev/null and b/apps/website/public/assets/favicon/default.png differ diff --git a/apps/website/public/assets/favicon/dev.png b/apps/website/public/assets/favicon/dev.png new file mode 100644 index 00000000..7e42a30d Binary files /dev/null and b/apps/website/public/assets/favicon/dev.png differ diff --git a/apps/website/public/assets/favicon/learn.png b/apps/website/public/assets/favicon/learn.png new file mode 100644 index 00000000..1ea7d020 Binary files /dev/null and b/apps/website/public/assets/favicon/learn.png differ diff --git a/apps/website/public/favicon.ico b/apps/website/public/favicon.ico deleted file mode 100644 index e6bb1a61..00000000 Binary files a/apps/website/public/favicon.ico and /dev/null differ diff --git a/apps/website/src/components/head.tsx b/apps/website/src/components/head.tsx deleted file mode 100644 index 8bb42724..00000000 --- a/apps/website/src/components/head.tsx +++ /dev/null @@ -1,53 +0,0 @@ -import Head from 'next/head' - -type Props = { - index?: boolean - children?: React.ReactElement - imageUrl?: string -} - -function _Head(props: Props) { - const { index = true, children, imageUrl } = props - return ( - - Status - - - - {/* todo: app stores banners/redirects */} - {/* todo: eval following meta tags */} - - - - - - - {imageUrl && } - - - - {/* */} - - - - - - - - - {/* todo?: except communities; ask product */} - {!index && } - {/* todo?: entity QR */} - {/* todo?: fallback OG */} - {children} - - ) -} - -export { _Head as Head } diff --git a/apps/website/src/components/logo.tsx b/apps/website/src/components/logo.tsx index 10cd64af..ca9d307f 100644 --- a/apps/website/src/components/logo.tsx +++ b/apps/website/src/components/logo.tsx @@ -2,6 +2,7 @@ import Image from 'next/image' import { useRouter } from 'next/router' import { match, P } from 'ts-pattern' +import logoBlogSrc from '../../public/images/logo/blog.svg' import logoSrc from '../../public/images/logo/default.svg' import logoDevSrc from '../../public/images/logo/dev.svg' import logoLearnSrc from '../../public/images/logo/learn.svg' @@ -29,7 +30,7 @@ export const Logo = (props: Props) => { ) .with( P.when(p => p.startsWith('/blog')), - () => Status logo + () => Status logo ) .otherwise(() => ( Status logo diff --git a/apps/website/src/components/preview-page.tsx b/apps/website/src/components/preview-page.tsx index 63893dc8..624734fb 100644 --- a/apps/website/src/components/preview-page.tsx +++ b/apps/website/src/components/preview-page.tsx @@ -21,9 +21,9 @@ import { QrCodeIcon, } from '@status-im/icons' import { useQuery } from '@tanstack/react-query' +import Head from 'next/head' import { useRouter } from 'next/router' -import { Head } from '@/components/head' import { ERROR_CODES } from '@/consts/error-codes' import { useURLData } from '@/hooks/use-url-data' import { getRequestClient } from '@/lib/request-client' @@ -80,6 +80,12 @@ export type Data = info: UserInfo } +const ACTION_VERB: Record = { + community: 'Join', + channel: 'View', + profile: 'Open', +} + const INSTRUCTIONS_HEADING: Record = { community: 'How to join this community:', channel: 'How to join this channel:', @@ -93,7 +99,7 @@ const JOIN_BUTTON_LABEL: Record = { } export function PreviewPage(props: PreviewPageProps) { - const { type, decodedData, encodedData } = props + const { type, decodedData, encodedData, index } = props const { asPath } = useRouter() @@ -216,9 +222,34 @@ export function PreviewPage(props: PreviewPageProps) { return } + // const urlOrigin = process.env.VERCEL_URL + // ? 'https://' + process.env.VERCEL_URL + // : '' + if ((loading && !data) || !data || !publicKey) { return ( <> + + + {/* todo: test if server-rendered version with which a (social) card would be + generated would not effectively override actual shared link on clicking */} + {/* */} + + + {!index && } +
@@ -326,10 +357,33 @@ export function PreviewPage(props: PreviewPageProps) { return ( <> - + + + {`${ACTION_VERB[type]} ${data.info.displayName} in Status`} + + + + + {/* */} + + + {!index && } + <> {/* todo: theme; based on user system settings */} - {/* todo: (system or both?) install banner */}
page) + // const urlOrigin = process.env.VERCEL_URL + // ? 'https://' + process.env.VERCEL_URL + // : '' + + const { pathname, asPath } = useRouter() + return ( -
- - {getLayout()} - -
+ <> + + Status - Private, Secure Communication + + + + + + + + {/* */} + + + + + + + + + + + {match(pathname) + .with( + P.when(p => p.startsWith('/insights')), + () => ( + <> + + {/* + */} + + ) + ) + .with( + P.when(p => p.startsWith('/learn')), + () => ( + <> + + {/* + */} + + ) + ) + .with( + P.when(p => p.startsWith('/blog')), + () => ( + <> + + {/* + */} + + ) + ) + .otherwise(() => ( + <> + + {/* + */} + + ))} + +
+ + + {getLayout()} + + +
+ ) } diff --git a/apps/website/src/pages/_document.tsx b/apps/website/src/pages/_document.tsx index d352f7e2..df9bd6c0 100644 --- a/apps/website/src/pages/_document.tsx +++ b/apps/website/src/pages/_document.tsx @@ -29,7 +29,6 @@ export default class Document extends NextDocument { id="tamagui" dangerouslySetInnerHTML={{ __html: Tamagui.getCSS() }} /> -
diff --git a/apps/website/src/pages/blog/[slug].tsx b/apps/website/src/pages/blog/[slug].tsx index 5732b894..e0d603b3 100644 --- a/apps/website/src/pages/blog/[slug].tsx +++ b/apps/website/src/pages/blog/[slug].tsx @@ -223,7 +223,7 @@ const BlogDetailPage: Page = ({ post, relatedPosts }) => {
- {relatedPosts.length && ( + {relatedPosts.length > 0 && (