Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

add routing to open-startup and move open-startup to remix

Maksim Mrug17d4a15bd0e8
diff --git a/app/pages/OpenStartup/index.tsx b/app/pages/OpenStartup/index.tsx
index da35c2f6b..b1ebac18d 100644
--- a/app/pages/OpenStartup/index.tsx
+++ b/app/pages/OpenStartup/index.tsx
@@ -1,18 +1,25 @@
/* eslint-disable */
import React, { useEffect } from 'react'
+import type { LinksFunction } from '@remix-run/node'
import _map from 'lodash/map'
import bb, {
bar, line,
} from 'billboard.js'
import { useTranslation, Trans } from 'react-i18next'
-import { Link } from 'react-router-dom'
+import { Link } from '@remix-run/react'
import { useSelector } from 'react-redux'
import { nFormatterSeparated } from 'utils/generic'
import { StateType } from 'redux/store/index'
-import Title from 'components/Title'
import { LIVE_DEMO_URL } from 'redux/constants'
-import '../Project/View/styles.css'
+
+import Style from 'styles/ProjectViewStyle.css'
+
+export const links: LinksFunction = () => {
+ return [
+ { rel: 'stylesheet', href: Style },
+ ]
+}
// This should be generated on the API side, will be done later.
const financeData = {
@@ -288,87 +295,85 @@ const OpenStartup = (): JSX.Element => {
}, [])
return (
- <Title title={t('titles.open')}>
- <div className='min-h-page bg-gray-50 dark:bg-slate-900'>
- <div className='w-11/12 md:w-4/5 mx-auto pb-16 pt-12 px-4 sm:px-6 lg:px-8 whitespace-pre-line'>
- <h1 className='text-4xl font-bold text-gray-900 dark:text-gray-50 tracking-tight'>
- {t('titles.open')}
- </h1>
+ <div className='min-h-page bg-gray-50 dark:bg-slate-900'>
+ <div className='w-11/12 md:w-4/5 mx-auto pb-16 pt-12 px-4 sm:px-6 lg:px-8 whitespace-pre-line'>
+ <h1 className='text-4xl font-bold text-gray-900 dark:text-gray-50 tracking-tight'>
+ {t('titles.open')}
+ </h1>
- <p className='mt-2 text-lg text-gray-900 dark:text-gray-50 tracking-tight'>
- {t('open.desc')}
- </p>
+ <p className='mt-2 text-lg text-gray-900 dark:text-gray-50 tracking-tight'>
+ {t('open.desc')}
+ </p>
- <p className='mt-2 text-lg text-gray-900 dark:text-gray-50 tracking-tight'>
- {t('open.updated')}
- </p>
+ <p className='mt-2 text-lg text-gray-900 dark:text-gray-50 tracking-tight'>
+ {t('open.updated')}
+ </p>
- <h2 className='mt-8 text-2xl font-bold text-gray-900 dark:text-gray-50 tracking-tight'>
- {t('open.finance.title')}
- </h2>
+ <h2 className='mt-8 text-2xl font-bold text-gray-900 dark:text-gray-50 tracking-tight'>
+ {t('open.finance.title')}
+ </h2>
- <p className='mt-2 text-lg text-gray-900 dark:text-gray-50 tracking-tight'>
- {t('open.finance.desc')}
- </p>
+ <p className='mt-2 text-lg text-gray-900 dark:text-gray-50 tracking-tight'>
+ {t('open.finance.desc')}
+ </p>
- <div className='h-80 mt-4' id='open-startup' />
+ <div className='h-80 mt-4' id='open-startup' />
- <h2 className='mt-8 text-2xl font-bold text-gray-900 dark:text-gray-50 tracking-tight'>
- {t('open.usage.title')}
- </h2>
+ <h2 className='mt-8 text-2xl font-bold text-gray-900 dark:text-gray-50 tracking-tight'>
+ {t('open.usage.title')}
+ </h2>
- <p className='mt-2 text-lg text-gray-900 dark:text-gray-50 tracking-tight'>
- {t('open.usage.desc')}
- </p>
+ <p className='mt-2 text-lg text-gray-900 dark:text-gray-50 tracking-tight'>
+ {t('open.usage.desc')}
+ </p>
- <p className='mt-2 text-md text-gray-900 dark:text-gray-50 tracking-tight'>
- {t('main.users')}
- {': '}
- {users[0]}
- {users[1] && (
- <span className='text-gray-900 dark:text-indigo-200'>
- {users[1]}
- +
- </span>
- )}
- </p>
+ <p className='mt-2 text-md text-gray-900 dark:text-gray-50 tracking-tight'>
+ {t('main.users')}
+ {': '}
+ {users[0]}
+ {users[1] && (
+ <span className='text-gray-900 dark:text-indigo-200'>
+ {users[1]}
+ +
+ </span>
+ )}
+ </p>
- <p className='mt-2 text-md text-gray-900 dark:text-gray-50 tracking-tight'>
- {t('main.websites')}
- {': '}
- {websites[0]}
- {websites[1] && (
- <span className='text-gray-900 dark:text-indigo-200'>
- {websites[1]}
- +
- </span>
- )}
- </p>
+ <p className='mt-2 text-md text-gray-900 dark:text-gray-50 tracking-tight'>
+ {t('main.websites')}
+ {': '}
+ {websites[0]}
+ {websites[1] && (
+ <span className='text-gray-900 dark:text-indigo-200'>
+ {websites[1]}
+ +
+ </span>
+ )}
+ </p>
- <p className='mt-2 text-md text-gray-900 dark:text-gray-50 tracking-tight'>
- {t('main.pageviews')}
- {': '}
- {events[0]}
- {events[1] && (
- <span className='text-gray-900 dark:text-indigo-200'>
- {events[1]}
- +
- </span>
- )}
- </p>
+ <p className='mt-2 text-md text-gray-900 dark:text-gray-50 tracking-tight'>
+ {t('main.pageviews')}
+ {': '}
+ {events[0]}
+ {events[1] && (
+ <span className='text-gray-900 dark:text-indigo-200'>
+ {events[1]}
+ +
+ </span>
+ )}
+ </p>
- <p className='mt-2 text-lg text-gray-900 dark:text-gray-50 tracking-tight'>
- <Trans
- t={t}
- i18nKey='open.usage.live'
- components={{
- livedemo: <Link to={LIVE_DEMO_URL} className='font-medium hover:underline text-indigo-600 hover:text-indigo-500 dark:text-indigo-400 dark:hover:text-indigo-500' />,
- }}
- />
- </p>
- </div>
+ <p className='mt-2 text-lg text-gray-900 dark:text-gray-50 tracking-tight'>
+ <Trans
+ t={t}
+ i18nKey='open.usage.live'
+ components={{
+ livedemo: <Link to={LIVE_DEMO_URL} className='font-medium hover:underline text-indigo-600 hover:text-indigo-500 dark:text-indigo-400 dark:hover:text-indigo-500' />,
+ }}
+ />
+ </p>
</div>
- </Title>
+ </div>
)
}
diff --git a/app/root.tsx b/app/root.tsx
index ce723199d..cb8d0382c 100644
--- a/app/root.tsx
+++ b/app/root.tsx
@@ -19,6 +19,7 @@ import AppWrapper from 'App'
import mainCss from 'styles/index.css'
import tailwindCss from 'styles/tailwind.css'
+import BillboardCss from 'billboard.js/dist/billboard.min.css'
trackViews()
@@ -38,6 +39,7 @@ if (process.env.NODE_ENV !== 'production') {
export const links: LinksFunction = () => [
{ rel: 'stylesheet', href: tailwindCss },
{ rel: 'stylesheet', href: mainCss },
+ { rel: 'stylesheet', href: BillboardCss },
]
const removeObsoleteAuthTokens = () => {
diff --git a/app/routes/open-startup.tsx b/app/routes/open-startup.tsx
new file mode 100644
index 000000000..b6be497ab
--- /dev/null
+++ b/app/routes/open-startup.tsx
@@ -0,0 +1,10 @@
+import OpenStartup from 'pages/OpenStartup'
+import type { V2_MetaFunction } from '@remix-run/node'
+
+export const meta: V2_MetaFunction = () => {
+ return [{ title: 'OpenStartup' }, { name: 'description', content: 'OpenStartup' }]
+}
+
+export default function Index() {
+ return <OpenStartup />
+}
diff --git a/app/routesPath/index.ts b/app/routesPath/index.ts
index a23d75aa8..80256d1d8 100644
--- a/app/routesPath/index.ts
+++ b/app/routesPath/index.ts
@@ -31,7 +31,7 @@ const routes = Object.freeze({
transfer_reject: '/project/transfer/cancel',
socialised: '/socialised', // add
project_protected_password: '/projects/:id/password',
- open: '/open',
+ open: '/open-startup', // add
})
export default routes