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!

dark theme improvements

Blue Mouse4a1bd24cf83c
diff --git a/src/App.js b/src/App.js
index bd4222193..60f0d0a0c 100644
--- a/src/App.js
+++ b/src/App.js
@@ -70,26 +70,24 @@ const App = () => {
const { message, type } = useSelector(state => state.alerts)
const accessToken = getAccessToken()
- const paddleCallback = (data) => {
- dispatch(UIActions.setPaddleLastEvent(data))
- }
-
useEffect(() => {
+ const eventCallback = (data) => {
+ dispatch(UIActions.setPaddleLastEvent(data))
+ }
const interval = setInterval(paddleSetup, 200)
+
function paddleSetup() {
- if (!isSelfhosted) {
- if (window.Paddle) {
- window.Paddle.Setup({
- vendor: 139393,
- eventCallback: paddleCallback,
- })
- clearInterval(interval)
- }
- } else {
+ if (isSelfhosted) {
+ clearInterval(interval)
+ } else if (window.Paddle) {
+ window.Paddle.Setup({
+ vendor: 139393,
+ eventCallback,
+ })
clearInterval(interval)
}
}
- }, [])
+ }, [dispatch])
useEffect(() => {
const loaderEl = document.getElementById('loader')
diff --git a/src/pages/Auth/Signin/Signin.jsx b/src/pages/Auth/Signin/Signin.jsx
index b3fd65320..4c01b630e 100644
--- a/src/pages/Auth/Signin/Signin.jsx
+++ b/src/pages/Auth/Signin/Signin.jsx
@@ -121,7 +121,7 @@ const Signin = ({ login }) => {
<Link to={routes.reset_password} className='underline text-blue-600 hover:text-indigo-800 dark:text-blue-400 dark:hover:text-blue-500'>
{t('auth.signin.forgot')}
</Link>
- <span>&nbsp;|&nbsp;</span>
+ <span className='text-gray-900 dark:text-gray-50'>&nbsp;|&nbsp;</span>
<Link to={routes.signup} className='underline text-blue-600 hover:text-indigo-800 dark:text-blue-400 dark:hover:text-blue-500'>
{t('auth.common.signupInstead')}
</Link>
diff --git a/src/pages/Dashboard/Dashboard.jsx b/src/pages/Dashboard/Dashboard.jsx
index 332cda6ad..f83a96939 100644
--- a/src/pages/Dashboard/Dashboard.jsx
+++ b/src/pages/Dashboard/Dashboard.jsx
@@ -167,7 +167,7 @@ const Dashboard = ({ projects, isLoading, error, user }) => {
<NoProjects t={t} />
) : (
<div className='bg-white shadow overflow-hidden sm:rounded-md mt-10'>
- <ul className='divide-y divide-gray-200'>
+ <ul className='divide-y divide-gray-200 dark:divide-gray-500'>
{_map(_filter(projects, ({ uiHidden }) => !uiHidden), ({ name, id, created, active, overall, live, public: isPublic }) => (
<ProjectCart
key={id}
diff --git a/src/pages/MainPage/Pricing.jsx b/src/pages/MainPage/Pricing.jsx
index c44a17fbb..f2b3d3195 100644
--- a/src/pages/MainPage/Pricing.jsx
+++ b/src/pages/MainPage/Pricing.jsx
@@ -5,9 +5,12 @@ import { CheckIcon } from '@heroicons/react/solid'
import _map from 'lodash/map'
import _isNil from 'lodash/isNil'
import _findIndex from 'lodash/findIndex'
+import { Trans } from 'react-i18next'
import cx from 'clsx'
+import Modal from 'ui/Modal'
import Spin from '../../ui/icons/Spin'
+import { CONTACT_EMAIL } from 'redux/constants'
import { errorsActions } from 'redux/actions/errors'
import { alertsActions } from 'redux/actions/alerts'
import { authActions } from 'redux/actions/auth'
@@ -76,6 +79,8 @@ const Pricing = ({ t, language }) => {
const { theme } = useSelector(state => state.ui.theme)
const { lastEvent } = useSelector(state => state.ui.misc.paddle)
const [planCodeLoading, setPlanCodeLoading] = useState(null)
+ const [downgradeTo, setDowngradeTo] = useState(null)
+ const [showDowngradeModal, setShowDowngradeModal] = useState(false)
const tiers = getTiers(t)
useEffect(() => {
@@ -83,24 +88,26 @@ const Pricing = ({ t, language }) => {
if (_isNil(data)) {
return
}
-
+
if (data.event === 'Checkout.Complete') {
// giving some time to the API to process tier upgrate via Paddle webhook
setTimeout(async () => {
try {
const me = await authMe()
-
+
dispatch(authActions.loginSuccess(me))
dispatch(authActions.finishLoading())
} catch (e) {
dispatch(authActions.logout())
}
-
+
dispatch(alertsActions.accountUpdated('The subscription has been upgraded.'))
}, 1000)
setPlanCodeLoading(null)
+ setDowngradeTo(null)
} else if (data.event === 'Checkout.Close') {
setPlanCodeLoading(null)
+ setDowngradeTo(null)
}
}
@@ -117,6 +124,19 @@ const Pricing = ({ t, language }) => {
return
}
+ if (tier.planCode === 'free') {
+ window.Paddle.Checkout.open({
+ override: user.subCancelURL,
+ method: 'inline',
+ // frameTarget: 'checkout-container',
+ // frameInitialHeight: 416,
+ // frameStyle: 'width:100%; min-width:312px; background-color: transparent; border: none;',
+ locale: paddleLanguageMapping[language] || language,
+ displayModeTheme: theme,
+ })
+ return
+ }
+
window.Paddle.Checkout.open({
product: tier.pid,
email: user.email,
@@ -128,23 +148,31 @@ const Pricing = ({ t, language }) => {
}
}
+ const downgradeHandler = (tier) => {
+ if (planCodeLoading === null && user.planCode !== tier.planCode) {
+ setDowngradeTo(tier)
+ setShowDowngradeModal(true)
+ }
+ }
+
const userPlancodeID = _findIndex(tiers, (el) => el.planCode === user.planCode)
return (
- <div id='pricing' className={cx({ 'bg-white dark:bg-gray-750': !authenticated })}>
- <div className={cx('w-11/12 max-w-7xl mx-auto whitespace-pre-line', { 'px-4 sm:px-6 lg:px-8 py-24': !authenticated })}>
- <div className='sm:flex sm:flex-col sm:align-center'>
- {!authenticated && (
- <>
- <h1 className='text-3xl font-extrabold text-gray-900 dark:text-gray-50 sm:text-center'>
- {t('pricing.title')}
- </h1>
- <p className='mt-5 text-xl text-gray-500 dark:text-gray-200 sm:text-center'>
- {t('pricing.adv')}
- </p>
- </>
- )}
- {/* <div className='relative self-center mt-6 bg-gray-100 rounded-lg p-0.5 flex sm:mt-8'>
+ <>
+ <div id='pricing' className={cx({ 'bg-white dark:bg-gray-750': !authenticated })}>
+ <div className={cx('w-11/12 max-w-7xl mx-auto whitespace-pre-line', { 'px-4 sm:px-6 lg:px-8 py-24': !authenticated })}>
+ <div className='sm:flex sm:flex-col sm:align-center'>
+ {!authenticated && (
+ <>
+ <h1 className='text-3xl font-extrabold text-gray-900 dark:text-gray-50 sm:text-center'>
+ {t('pricing.title')}
+ </h1>
+ <p className='mt-5 text-xl text-gray-500 dark:text-gray-200 sm:text-center'>
+ {t('pricing.adv')}
+ </p>
+ </>
+ )}
+ {/* <div className='relative self-center mt-6 bg-gray-100 rounded-lg p-0.5 flex sm:mt-8'>
<button
type='button'
className='relative w-1/2 bg-white border-gray-200 rounded-md shadow-sm py-2 text-sm font-medium text-gray-900 whitespace-nowrap focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:z-10 sm:w-auto sm:px-8'
@@ -158,108 +186,112 @@ const Pricing = ({ t, language }) => {
Yearly billing
</button>
</div> */}
- </div>
- <div className='mt-12 space-y-4 sm:mt-16 sm:space-y-0 sm:grid sm:grid-cols-2 sm:gap-6 lg:max-w-4xl lg:mx-auto xl:max-w-none xl:mx-0 xl:grid-cols-4'>
- {_map(tiers, (tier) => {
- const planCodeID = _findIndex(tiers, (el) => el.planCode === tier.planCode)
+ </div>
+ <div className='mt-12 space-y-4 sm:mt-16 sm:space-y-0 sm:grid sm:grid-cols-2 sm:gap-6 lg:max-w-4xl lg:mx-auto xl:max-w-none xl:mx-0 xl:grid-cols-4'>
+ {_map(tiers, (tier) => {
+ const planCodeID = _findIndex(tiers, (el) => el.planCode === tier.planCode)
+ const downgrade = planCodeID < userPlancodeID
- return (
- <div key={tier.name} className={cx('relative border rounded-lg shadow-sm divide-y divide-gray-200', {
- 'border-indigo-400': user.planCode === tier.planCode,
- 'border-gray-200': user.planCode !== tier.planCode,
- })}>
- {user.planCode === tier.planCode && (
- <div className='absolute inset-x-0 top-0 transform translate-y-px'>
- <div className='flex justify-center transform -translate-y-1/2'>
- <span className='inline-flex rounded-full bg-indigo-600 px-4 py-1 text-sm font-semibold tracking-wider uppercase text-white'>
- {t('pricing.currentPlan')}
- </span>
+ return (
+ <div key={tier.name} className={cx('relative border rounded-lg shadow-sm divide-y divide-gray-200 dark:divide-gray-500', {
+ 'border-indigo-400': user.planCode === tier.planCode,
+ 'border-gray-200 dark:border-gray-500': user.planCode !== tier.planCode,
+ })}>
+ {user.planCode === tier.planCode && (
+ <div className='absolute inset-x-0 top-0 transform translate-y-px'>
+ <div className='flex justify-center transform -translate-y-1/2'>
+ <span className='inline-flex rounded-full bg-indigo-600 px-4 py-1 text-sm font-semibold tracking-wider uppercase text-white'>
+ {t('pricing.currentPlan')}
+ </span>
+ </div>
</div>
- </div>
- )}
- <div className='p-6'>
- <h2 className='text-lg leading-6 font-medium text-gray-900 dark:text-gray-50'>{tier.name}</h2>
- <p className='mt-4'>
- {_isNil(tier.priceMonthly) ? (
- <span className='text-4xl font-extrabold text-gray-900 dark:text-gray-50'>
- {t('pricing.free')}
- </span>
- ) : (
- <>
+ )}
+ <div className='p-6 border-none'>
+ <h2 className='text-lg leading-6 font-medium text-gray-900 dark:text-gray-50'>{tier.name}</h2>
+ <p className='mt-4'>
+ {tier.planCode === 'free' ? (
<span className='text-4xl font-extrabold text-gray-900 dark:text-gray-50'>
- ${tier.priceMonthly}
+ {t('pricing.free')}
</span>
- &nbsp;
- <span className='text-base font-medium text-gray-500 dark:text-gray-400'>
- /
- {t('pricing.perMonth')}
- </span>
- </>
- )}
- </p>
- {_isNil(tier.priceMonthly) ? (
- authenticated ? (
+ ) : (
+ <>
+ <span className='text-4xl font-extrabold text-gray-900 dark:text-gray-50'>
+ ${tier.priceMonthly}
+ </span>
+ &nbsp;
+ <span className='text-base font-medium text-gray-500 dark:text-gray-400'>
+ /
+ {t('pricing.perMonth')}
+ </span>
+ </>
+ )}
+ </p>
+ {authenticated ? (
<span
- onClick={() => onPlanChange(tier)}
- className={cx('inline-flex items-center justify-center mt-8 w-full rounded-md py-2 text-sm font-semibold text-white text-center cursor-pointer select-none', {
- 'bg-indigo-600 hover:bg-indigo-700': planCodeLoading === null && tier.planCode !== user.planCode,
+ onClick={() => downgrade ? downgradeHandler(tier) : onPlanChange(tier)}
+ className={cx('inline-flex items-center justify-center mt-8 w-full rounded-md py-2 text-sm font-semibold text-white text-center select-none', {
+ 'bg-indigo-600 hover:bg-indigo-700 cursor-pointer': planCodeLoading === null && tier.planCode !== user.planCode,
'bg-indigo-400 cursor-default': planCodeLoading !== null || tier.planCode === user.planCode,
})}
>
{planCodeLoading === tier.planCode && (
<Spin />
)}
- {tier.planCode === user.planCode ? t('pricing.yourPlan') : t('pricing.downgrade')}
+ {planCodeID > userPlancodeID ? t('pricing.upgrade') : downgrade ? t('pricing.downgrade') : t('pricing.yourPlan')}
</span>
) : (
<Link
- className='inline-flex items-center justify-center mt-8 w-full rounded-md py-2 text-sm font-semibold text-white text-center cursor-pointer select-none bg-indigo-600 hover:bg-indigo-700'
+ className='mt-8 block w-full bg-indigo-600 rounded-md py-2 text-sm font-semibold text-white text-center hover:bg-indigo-700'
to={routes.signup}
>
- {t('common.getStarted')}
+ {tier.planCode === 'free' ? t('common.getStarted') : t('pricing.upgrade')}
</Link>
- )
- ) : authenticated ? (
- <span
- onClick={() => onPlanChange(tier)}
- className={cx('inline-flex items-center justify-center mt-8 w-full rounded-md py-2 text-sm font-semibold text-white text-center cursor-pointer select-none', {
- 'bg-indigo-600 hover:bg-indigo-700': planCodeLoading === null && tier.planCode !== user.planCode,
- 'bg-indigo-400 cursor-default': planCodeLoading !== null || tier.planCode === user.planCode,
- })}
- >
- {planCodeLoading === tier.planCode && (
- <Spin />
- )}
- {planCodeID > userPlancodeID ? t('pricing.upgrade') : planCodeID < userPlancodeID ? t('pricing.downgrade') : t('pricing.yourPlan')}
- </span>
- ) : (
- <Link
- className='mt-8 block w-full bg-indigo-600 rounded-md py-2 text-sm font-semibold text-white text-center hover:bg-indigo-700'
- to={routes.signup}
- >
- {t('pricing.upgrade')}
- </Link>
- )}
- </div>
- <div className='pt-6 pb-8 px-6'>
- <h3 className='text-xs font-medium text-gray-900 dark:text-gray-50 tracking-wide uppercase'>
- {t('pricing.whatIncl')}
- </h3>
- <ul className='mt-6 space-y-4'>
- {_map(tier.includedFeatures, (feature) => (
- <li key={feature} className='flex space-x-3'>
- <CheckIcon className='flex-shrink-0 h-5 w-5 text-green-500' aria-hidden='true' />
- <span className='text-sm text-gray-500 dark:text-gray-200'>{feature}</span>
- </li>
- ))}
- </ul>
+ )}
+ </div>
+ <div className='pt-6 pb-8 px-6'>
+ <h3 className='text-xs font-medium text-gray-900 dark:text-gray-50 tracking-wide uppercase'>
+ {t('pricing.whatIncl')}
+ </h3>
+ <ul className='mt-6 space-y-4'>
+ {_map(tier.includedFeatures, (feature) => (
+ <li key={feature} className='flex space-x-3'>
+ <CheckIcon className='flex-shrink-0 h-5 w-5 text-green-500' aria-hidden='true' />
+ <span className='text-sm text-gray-500 dark:text-gray-200'>{feature}</span>
+ </li>
+ ))}
+ </ul>
+ </div>
</div>
- </div>
- )
- })}
+ )
+ })}
+ </div>
</div>
</div>
- </div>
+ <Modal
+ onClose={() => {
+ setDowngradeTo(null)
+ setShowDowngradeModal(false)
+ }}
+ onSubmit={() => {
+ setShowDowngradeModal(false)
+ onPlanChange(downgradeTo)
+ }}
+ submitText={t('common.yes')}
+ closeText={t('common.no')}
+ title={t('pricing.downgradeTitle')}
+ type='warning'
+ message={(
+ <Trans
+ t={t}
+ i18nKey='pricing.downgradeDesc'
+ values={{
+ email: CONTACT_EMAIL,
+ }}
+ />
+ )}
+ isOpened={showDowngradeModal}
+ />
+ </>
)
}
diff --git a/src/pages/MainPage/index.jsx b/src/pages/MainPage/index.jsx
index fdac8f015..7598f52d5 100644
--- a/src/pages/MainPage/index.jsx
+++ b/src/pages/MainPage/index.jsx
@@ -135,7 +135,7 @@ const Main = () => {
<SignUp />
</div>
</div>
- <div className='px-4 py-6 bg-gray-50 dark:bg-gray-700 border-t-2 border-gray-200 sm:px-10'>
+ <div className='px-4 py-6 bg-gray-50 dark:bg-gray-700 border-t-2 border-gray-200 dark:border-gray-500 sm:px-10'>
<p className='text-xs leading-5 text-gray-500 dark:text-gray-100'>
<Trans
t={t}
diff --git a/src/pages/Project/Settings/ProjectSettings.jsx b/src/pages/Project/Settings/ProjectSettings.jsx
index af4d6f27e..e4368a964 100644
--- a/src/pages/Project/Settings/ProjectSettings.jsx
+++ b/src/pages/Project/Settings/ProjectSettings.jsx
@@ -227,7 +227,7 @@ const ProjectSettings = ({
/>
</>
) : (
- <p className='text-gray-500 italic mt-2 text-sm'>
+ <p className='text-gray-500 dark:text-gray-300 italic mt-2 text-sm'>
{t('project.settings.createHint')}
</p>
)}
diff --git a/src/pages/Project/View/ViewProject.jsx b/src/pages/Project/View/ViewProject.jsx
index 5f61ac48a..b7630115f 100644
--- a/src/pages/Project/View/ViewProject.jsx
+++ b/src/pages/Project/View/ViewProject.jsx
@@ -135,7 +135,7 @@ const typeNameMapping = (t) => ({
const NoEvents = ({ t }) => (
<div className='flex flex-col py-6 sm:px-6 lg:px-8 mt-5'>
- <div className='max-w-7xl w-full mx-auto'>
+ <div className='max-w-7xl w-full mx-auto text-gray-900 dark:text-gray-50'>
<h2 className='text-4xl text-center leading-tight my-3'>
{t('project.noEvTitle')}
</h2>
@@ -422,7 +422,7 @@ const ViewProject = ({
const url = new URL(name)
return (
- <a className='flex label hover:underline text-blue-600' href={name} target='_blank' rel='noopener noreferrer'>
+ <a className='flex label hover:underline text-blue-600 dark:text-blue-500' href={name} target='_blank' rel='noopener noreferrer'>
{showIcons && !_isEmpty(url.hostname) && (
<img className='w-5 h-5 mr-1.5' src={`https://icons.duckduckgo.com/ip3/${url.hostname}.ico`} alt='' />
)}