📈 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!
TypeScript chartsclickhousedockergdprgoogle-analyticsmetricsmonitoringmysqlnestjsprivacyredisself-hostedselfhostedstatisticstailwindcssweb-analyticswebanalyticswebsite
Added dynamic page titles, smooth scrolling, fixed pricing colours & other improvements
Blue Mouse3355e508b742
diff --git a/.env.example b/.env.exampleindex 99f8b1119..fca0453f4 100644--- a/.env.example+++ b/.env.example@@ -1,2 +1,3 @@REACT_APP_API_URL=https://example.com/api/+REACT_APP_TITLE_SUFFIX=| SwetrixCHOKIDAR_USEPOLLING=true\ No newline at end of filediff --git a/package.json b/package.jsonindex 2f3a8a596..b11affbe7 100644--- a/package.json+++ b/package.json@@ -21,17 +21,20 @@"moment": "^2.29.1","nanoid": "^3.1.22","node-sass": "^5.0.0",+ "prismjs": "^1.24.1","react": "^17.0.1","react-alert": "^7.0.2","react-alert-template-basic": "^1.0.0","react-dom": "^17.0.1","react-feather": "^2.0.9",+ "react-helmet": "^6.1.0","react-redux": "^7.2.2","react-router-dom": "^5.2.0","react-scripts": "4.0.3","redux": "^4.0.5","redux-auth-wrapper": "^3.0.0","redux-saga": "^1.1.3",+ "tailwind-scroll-behavior": "^1.0.0","web-vitals": "^1.1.1"},"scripts": {diff --git a/public/index.html b/public/index.htmlindex 904c3c91f..83154f08d 100644--- a/public/index.html+++ b/public/index.html@@ -26,7 +26,7 @@--><title>Swetrix Analytics</title></head>- <body>+ <body class="motion-safe:scroll-smooth"><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body>diff --git a/src/components/Footer/index.jsx b/src/components/Footer/index.jsxindex fd5e7a569..dd79e805d 100644--- a/src/components/Footer/index.jsx+++ b/src/components/Footer/index.jsx@@ -39,14 +39,10 @@ const Footer = () => {<h2 id='footer-heading' className='sr-only'>Footer</h2>- <div className='w-11/12 mx-auto py-12 px-4 sm:px-6 lg:py-16 lg:px-8'>+ <div className='w-11/12 mx-auto py-12 px-4 sm:px-6 lg:px-8'><div className='xl:grid xl:grid-cols-3 xl:gap-8'><div className='space-y-8 xl:col-span-1'>- <img- className='h-10'- src='https://tailwindui.com/img/logos/workflow-mark-gray-300.svg'- alt='Swetrix Analytics'- />+ <img className='h-10' src='https://tailwindui.com/img/logos/workflow-mark-gray-300.svg' alt='Swetrix Analytics' /><p className='text-gray-300 text-base'>The best apps need the best services.<br />Swetrix is a powerful analytics platform that respects user privacy.diff --git a/src/components/Title.jsx b/src/components/Title.jsxnew file mode 100644index 000000000..b9069f928--- /dev/null+++ b/src/components/Title.jsx@@ -0,0 +1,14 @@+import React from 'react'+import { Helmet } from 'react-helmet'+import { TITLE_SUFFIX } from 'redux/constants'++const Title = ({ title, children }) => (+ <>+ <Helmet>+ <title>{title} {TITLE_SUFFIX}</title>+ </Helmet>+ {children}+ </>+)++export default Titlediff --git a/src/index.js b/src/index.jsindex 6b7506aa9..28d2d1531 100644--- a/src/index.js+++ b/src/index.js@@ -6,6 +6,7 @@ import { Provider } from 'react-redux'import { transitions, positions, Provider as AlertProvider } from 'react-alert'import AlertTemplate from 'ui/Alert'import 'billboard.js/dist/billboard.min.css'+import 'prismjs/themes/prism-tomorrow.css'import App from './App'import reportWebVitals from './reportWebVitals'@@ -35,4 +36,4 @@ ReactDOM.render(document.getElementById('root'))-reportWebVitals()\ No newline at end of file+reportWebVitals()diff --git a/src/pages/Auth/CreateNewPassword/CreateNewPassword.jsx b/src/pages/Auth/CreateNewPassword/CreateNewPassword.jsxindex 91a8e4fb7..e167321b8 100644--- a/src/pages/Auth/CreateNewPassword/CreateNewPassword.jsx+++ b/src/pages/Auth/CreateNewPassword/CreateNewPassword.jsx@@ -1,6 +1,7 @@import React, { useState, useEffect, memo } from 'react'import { Link } from 'react-router-dom'+import Title from 'components/Title'import routes from 'routes'import Input from 'ui/Input'import Button from 'ui/Button'@@ -57,44 +58,46 @@ const CreateNewPassword = ({ onSubmit }) => {}return (- <div className='min-h-page bg-gray-50 flex flex-col py-6 sm:px-6 lg:px-8'>- <form className='max-w-7xl w-full mx-auto' onSubmit={handleSubmit}>- <h2 className='mt-2 text-3xl font-extrabold text-gray-900'>- Account recovery+ <Title title='Account recovery'>+ <div className='min-h-page bg-gray-50 flex flex-col py-6 sm:px-6 lg:px-8'>+ <form className='max-w-7xl w-full mx-auto' onSubmit={handleSubmit}>+ <h2 className='mt-2 text-3xl font-extrabold text-gray-900'>+ Account recovery</h2>- <Input- name='password'- id='password'- type='password'- label='Your new password'- hint='Longer than 8 chars'- value={form.password}- placeholder='Password'- className='mt-4'- onChange={handleInput}- error={beenSubmitted && errors.password}- />- <Input- name='repeat'- id='repeat'- type='password'- label='Repeat password'- value={form.password}- placeholder='Password'- className='mt-4'- onChange={handleInput}- error={beenSubmitted && errors.repeat}- />- <div className='flex justify-between mt-3'>- <Link to={routes.signin} className='underline text-blue-600 hover:text-indigo-800'>- Sign in instead+ <Input+ name='password'+ id='password'+ type='password'+ label='Your new password'+ hint='Longer than 8 chars'+ value={form.password}+ placeholder='Password'+ className='mt-4'+ onChange={handleInput}+ error={beenSubmitted && errors.password}+ />+ <Input+ name='repeat'+ id='repeat'+ type='password'+ label='Repeat password'+ value={form.password}+ placeholder='Password'+ className='mt-4'+ onChange={handleInput}+ error={beenSubmitted && errors.repeat}+ />+ <div className='flex justify-between mt-3'>+ <Link to={routes.signin} className='underline text-blue-600 hover:text-indigo-800'>+ Sign in instead</Link>- <Button type='submit' primary large>- Save new password+ <Button type='submit' primary large>+ Save new password</Button>- </div>- </form>- </div>+ </div>+ </form>+ </div>+ </Title>)}diff --git a/src/pages/Auth/ForgotPassword/ForgotPassword.jsx b/src/pages/Auth/ForgotPassword/ForgotPassword.jsxindex 46c867ceb..f2de80dcb 100644--- a/src/pages/Auth/ForgotPassword/ForgotPassword.jsx+++ b/src/pages/Auth/ForgotPassword/ForgotPassword.jsx@@ -1,6 +1,7 @@import React, { useState, useEffect, memo } from 'react'import { Link } from 'react-router-dom'+import Title from 'components/Title'import routes from 'routes'import Input from 'ui/Input'import Button from 'ui/Button'@@ -52,32 +53,34 @@ const ForgotPassword = ({ onSubmit }) => {}return (- <div className='min-h-page bg-gray-50 flex flex-col py-6 sm:px-6 lg:px-8'>- <form className='max-w-7xl w-full mx-auto' onSubmit={handleSubmit}>- <h2 className='mt-2 text-3xl font-extrabold text-gray-900'>- Account recovery+ <Title title='Account recovery'>+ <div className='min-h-page bg-gray-50 flex flex-col py-6 sm:px-6 lg:px-8'>+ <form className='max-w-7xl w-full mx-auto' onSubmit={handleSubmit}>+ <h2 className='mt-2 text-3xl font-extrabold text-gray-900'>+ Account recovery</h2>- <Input- name='email'- id='email'- type='email'- label='Email'- value={form.email}- placeholder='[email protected]'- className='mt-4'- onChange={handleInput}- error={beenSubmitted && errors.email}- />- <div className='flex justify-between mt-3'>- <Link to={routes.signin} className='mt-1 underline text-blue-600 hover:text-indigo-800'>- Sign in+ <Input+ name='email'+ id='email'+ type='email'+ label='Email'+ value={form.email}+ placeholder='[email protected]'+ className='mt-4'+ onChange={handleInput}+ error={beenSubmitted && errors.email}+ />+ <div className='flex justify-between mt-3'>+ <Link to={routes.signin} className='mt-1 underline text-blue-600 hover:text-indigo-800'>+ Sign in</Link>- <Button type='submit' primary large>- Reset password+ <Button type='submit' primary large>+ Reset password</Button>- </div>- </form>- </div>+ </div>+ </form>+ </div>+ </Title>)}diff --git a/src/pages/Auth/Signin/Signin.jsx b/src/pages/Auth/Signin/Signin.jsxindex 92527baaa..fcd26e33c 100644--- a/src/pages/Auth/Signin/Signin.jsx+++ b/src/pages/Auth/Signin/Signin.jsx@@ -2,6 +2,7 @@ import React, { useState, useEffect, memo } from 'react'import { Link } from 'react-router-dom'import PropTypes from 'prop-types'+import Title from 'components/Title'import routes from 'routes'import Input from 'ui/Input'import Button from 'ui/Button'@@ -60,58 +61,60 @@ const Signin = ({ onSubmit }) => {}return (- <div className='min-h-page bg-gray-50 flex flex-col py-6 sm:px-6 lg:px-8'>- <form className='max-w-7xl w-full mx-auto' onSubmit={handleSubmit}>- <h2 className='mt-2 text-3xl font-extrabold text-gray-900'>- Sign in to your account- </h2>- <Input- name='email'- id='email'- type='email'- label='Email'- value={form.email}- placeholder='[email protected]'- className='mt-4'- onChange={handleInput}- error={beenSubmitted && errors.email}- />- <Input- name='password'- id='password'- type='password'- label='Password'- hint='Longer than 8 chars'- value={form.password}- placeholder='Password'- className='mt-4'- onChange={handleInput}- error={beenSubmitted && errors.password}- />- <Checkbox- checked={form.keep_signedin}- onChange={handleInput}- name='keep_signedin'- id='keep_signedin'- className='mt-4'- label={'Don\'t remember me.'}- />- <div className='flex justify-between mt-3'>- <div className='pt-1'>- <Link to={routes.reset_password} className='underline text-blue-600 hover:text-indigo-800'>- Forgot password?- </Link>- <span> | </span>- <Link to={routes.signup} className='underline text-blue-600 hover:text-indigo-800'>- Sign up instead- </Link>+ <Title title='Sign in'>+ <div className='min-h-page bg-gray-50 flex flex-col py-6 sm:px-6 lg:px-8'>+ <form className='max-w-7xl w-full mx-auto' onSubmit={handleSubmit}>+ <h2 className='mt-2 text-3xl font-extrabold text-gray-900'>+ Sign in to your account+ </h2>+ <Input+ name='email'+ id='email'+ type='email'+ label='Email'+ value={form.email}+ placeholder='[email protected]'+ className='mt-4'+ onChange={handleInput}+ error={beenSubmitted && errors.email}+ />+ <Input+ name='password'+ id='password'+ type='password'+ label='Password'+ hint='Longer than 8 chars'+ value={form.password}+ placeholder='Password'+ className='mt-4'+ onChange={handleInput}+ error={beenSubmitted && errors.password}+ />+ <Checkbox+ checked={form.keep_signedin}+ onChange={handleInput}+ name='keep_signedin'+ id='keep_signedin'+ className='mt-4'+ label={'Don\'t remember me.'}+ />+ <div className='flex justify-between mt-3'>+ <div className='pt-1'>+ <Link to={routes.reset_password} className='underline text-blue-600 hover:text-indigo-800'>+ Forgot password?+ </Link>+ <span> | </span>+ <Link to={routes.signup} className='underline text-blue-600 hover:text-indigo-800'>+ Sign up instead+ </Link>+ </div>+ <Button type='submit' primary large>+ Sign in+ </Button></div>- <Button type='submit' primary large>- Sign in- </Button>- </div>- </form>- </div>+ </form>+ </div>+ </Title>)}diff --git a/src/pages/Auth/Signup/Signup.jsx b/src/pages/Auth/Signup/Signup.jsxindex 1ecacfac0..1dba9588e 100644--- a/src/pages/Auth/Signup/Signup.jsx+++ b/src/pages/Auth/Signup/Signup.jsx@@ -2,6 +2,7 @@ import React, { useState, useEffect, memo } from 'react'import { Link } from 'react-router-dom'import PropTypes from 'prop-types'+import Title from 'components/Title'import routes from 'routes'import Input from 'ui/Input'import Checkbox from 'ui/Checkbox'@@ -70,71 +71,73 @@ const Signup = ({ onSubmit }) => {}return (- <div className='min-h-page bg-gray-50 flex flex-col py-6 sm:px-6 lg:px-8'>- <form className='max-w-7xl w-full mx-auto' onSubmit={handleSubmit}>- <h2 className='mt-2 text-3xl font-extrabold text-gray-900'>- Sign up- </h2>- <Input- name='email'- id='email'- type='email'- label='Email'- value={form.email}- placeholder='[email protected]'- className='mt-4'- onChange={handleInput}- error={beenSubmitted && errors.email}- />- <Input- name='password'- id='password'- type='password'- label='Password'- hint='Longer than 8 chars'- value={form.password}- placeholder='Password'- className='mt-4'- onChange={handleInput}- error={beenSubmitted && errors.password}- />- <Input- name='repeat'- id='repeat'- type='password'- label='Repeat password'- value={form.repeat}- placeholder='Repeat password'- className='mt-4'- onChange={handleInput}- error={beenSubmitted && errors.repeat}- />- <Checkbox- checked={form.tos}- onChange={handleInput}- name='tos'- id='tos'- className='mt-4'- label='I do accept terms and conditions and the privacy policy.'- />- <Checkbox- checked={form.keep_signedin}- onChange={handleInput}- name='keep_signedin'- id='keep_signedin'- className='mt-4'- label={'Don\'t remember me.'}- />- <div className='pt-1 flex justify-between mt-3'>- <Link to={routes.signin} className='underline text-blue-600 hover:text-indigo-800'>- Sign in instead- </Link>- <Button type='submit' primary large>+ <Title title='Sign up'>+ <div className='min-h-page bg-gray-50 flex flex-col py-6 sm:px-6 lg:px-8'>+ <form className='max-w-7xl w-full mx-auto' onSubmit={handleSubmit}>+ <h2 className='mt-2 text-3xl font-extrabold text-gray-900'>Sign up- </Button>- </div>- </form>- </div>+ </h2>+ <Input+ name='email'+ id='email'+ type='email'+ label='Email'+ value={form.email}+ placeholder='[email protected]'+ className='mt-4'+ onChange={handleInput}+ error={beenSubmitted && errors.email}+ />+ <Input+ name='password'+ id='password'+ type='password'+ label='Password'+ hint='Longer than 8 chars'+ value={form.password}+ placeholder='Password'+ className='mt-4'+ onChange={handleInput}+ error={beenSubmitted && errors.password}+ />+ <Input+ name='repeat'+ id='repeat'+ type='password'+ label='Repeat password'+ value={form.repeat}+ placeholder='Repeat password'+ className='mt-4'+ onChange={handleInput}+ error={beenSubmitted && errors.repeat}+ />+ <Checkbox+ checked={form.tos}+ onChange={handleInput}+ name='tos'+ id='tos'+ className='mt-4'+ label='I do accept terms and conditions and the privacy policy.'+ />+ <Checkbox+ checked={form.keep_signedin}+ onChange={handleInput}+ name='keep_signedin'+ id='keep_signedin'+ className='mt-4'+ label={'Don\'t remember me.'}+ />+ <div className='pt-1 flex justify-between mt-3'>+ <Link to={routes.signin} className='underline text-blue-600 hover:text-indigo-800'>+ Sign in instead+ </Link>+ <Button type='submit' primary large>+ Sign up+ </Button>+ </div>+ </form>+ </div>+ </Title>)}diff --git a/src/pages/Auth/VerifyEmail/index.jsx b/src/pages/Auth/VerifyEmail/index.jsxindex 75ddf8db6..8c204d89c 100644--- a/src/pages/Auth/VerifyEmail/index.jsx+++ b/src/pages/Auth/VerifyEmail/index.jsx@@ -4,6 +4,7 @@ import { useParams } from 'react-router-dom'import { CheckCircleIcon } from '@heroicons/react/solid'import { XCircleIcon } from '@heroicons/react/solid'+import Title from 'components/Title'import { authActions } from 'redux/actions/auth'import Loader from 'ui/Loader'@@ -28,42 +29,48 @@ const VerifyEmail = () => {if (loading) {return (- <Loader />+ <Title title='Email verification'>+ <Loader />+ </Title>)}if (error) {return (- <div className='flex justify-center pt-10'>- <div className='rounded-md p-4 w-11/12 bg-red-50 lg:w-4/6'>- <div className='flex'>- <div className='flex-shrink-0'>- <XCircleIcon className='h-5 w-5 text-red-400' aria-hidden='true' />- </div>- <div className='ml-3'>- <h3 className='text-sm font-medium text-red-800'>{error}</h3>+ <Title title='Email verification'>+ <div className='flex justify-center pt-10'>+ <div className='rounded-md p-4 w-11/12 bg-red-50 lg:w-4/6'>+ <div className='flex'>+ <div className='flex-shrink-0'>+ <XCircleIcon className='h-5 w-5 text-red-400' aria-hidden='true' />+ </div>+ <div className='ml-3'>+ <h3 className='text-sm font-medium text-red-800'>{error}</h3>+ </div></div></div></div>- </div>+ </Title>)}return (- <div className='flex justify-center pt-10'>- <div className='rounded-md p-4 w-11/12 bg-green-50 lg:w-4/6'>- <div className='flex'>- <div className='flex-shrink-0'>- <CheckCircleIcon className='h-5 w-5 text-green-400' aria-hidden='true' />- </div>- <div className='ml-3'>- <h3 className='text-sm font-medium text-green-800'>- Your email has been successfully verified!- </h3>+ <Title title='Email verification'>+ <div className='flex justify-center pt-10'>+ <div className='rounded-md p-4 w-11/12 bg-green-50 lg:w-4/6'>+ <div className='flex'>+ <div className='flex-shrink-0'>+ <CheckCircleIcon className='h-5 w-5 text-green-400' aria-hidden='true' />+ </div>+ <div className='ml-3'>+ <h3 className='text-sm font-medium text-green-800'>+ Your email has been successfully verified!+ </h3>+ </div></div></div></div>- </div>+ </Title>)}diff --git a/src/pages/Dashboard/Dashboard.jsx b/src/pages/Dashboard/Dashboard.jsxindex c11483a5b..4cdafe064 100644--- a/src/pages/Dashboard/Dashboard.jsx+++ b/src/pages/Dashboard/Dashboard.jsx@@ -12,6 +12,7 @@ import { ArrowSmUpIcon } from '@heroicons/react/solid'import { ArrowSmDownIcon } from '@heroicons/react/solid'import { XCircleIcon } from '@heroicons/react/solid'+import Title from 'components/Title'import Loader from 'ui/Loader'import { ActivePin, InactivePin } from 'ui/Pin'import routes from 'routes'@@ -104,49 +105,55 @@ const NoProjects = () => (const Dashboard = ({ projects, isLoading, error }) => {if (error && !isLoading) {return (- <div className='flex justify-center pt-10'>- <div className='rounded-md bg-red-50 p-4 w-11/12 lg:w-4/6'>- <div className='flex'>- <div className='flex-shrink-0'>- <XCircleIcon className='h-5 w-5 text-red-400' aria-hidden='true' />- </div>- <div className='ml-3'>- <h3 className='text-sm font-medium text-red-800'>{error}</h3>+ <Title title='Dashboard'>+ <div className='flex justify-center pt-10'>+ <div className='rounded-md bg-red-50 p-4 w-11/12 lg:w-4/6'>+ <div className='flex'>+ <div className='flex-shrink-0'>+ <XCircleIcon className='h-5 w-5 text-red-400' aria-hidden='true' />+ </div>+ <div className='ml-3'>+ <h3 className='text-sm font-medium text-red-800'>{error}</h3>+ </div></div></div></div>- </div>+ </Title>)}if (!isLoading) {return (- <div className='min-h-page bg-gray-50 flex flex-col py-6 px-4 sm:px-6 lg:px-8'>- <div className='max-w-7xl w-full mx-auto'>- <div className='flex justify-between'>- <h2 className='mt-2 text-3xl font-extrabold text-gray-900'>Dashboard</h2>- <Link to={routes.new_project} className='inline-flex items-center border border-transparent leading-4 font-medium rounded-md focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 shadow-sm text-white bg-indigo-600 hover:bg-indigo-700 px-4 py-2 text-sm'>- New project- </Link>- </div>- {_isEmpty(projects) ? (- <NoProjects />- ) : (- <div className='bg-white shadow overflow-hidden sm:rounded-md mt-10'>- <ul className='divide-y divide-gray-200'>- {_map(projects, ({ name, id, created, active, overall }) => (- <ProjectCart key={id} name={name} created={created} active={active} overall={overall} url={routes.project.replace(':id', id)} />- ))}- </ul>+ <Title title='Dashboard'>+ <div className='min-h-page bg-gray-50 flex flex-col py-6 px-4 sm:px-6 lg:px-8'>+ <div className='max-w-7xl w-full mx-auto'>+ <div className='flex justify-between'>+ <h2 className='mt-2 text-3xl font-extrabold text-gray-900'>Dashboard</h2>+ <Link to={routes.new_project} className='inline-flex items-center border border-transparent leading-4 font-medium rounded-md focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 shadow-sm text-white bg-indigo-600 hover:bg-indigo-700 px-4 py-2 text-sm'>+ New project+ </Link></div>- )}+ {_isEmpty(projects) ? (+ <NoProjects />+ ) : (+ <div className='bg-white shadow overflow-hidden sm:rounded-md mt-10'>+ <ul className='divide-y divide-gray-200'>+ {_map(projects, ({ name, id, created, active, overall }) => (+ <ProjectCart key={id} name={name} created={created} active={active} overall={overall} url={routes.project.replace(':id', id)} />+ ))}+ </ul>+ </div>+ )}+ </div></div>- </div>+ </Title>)}return (- <Loader />+ <Title title='Dashboard'>+ <Loader />+ </Title>)}diff --git a/src/pages/MainPage/Pricing.jsx b/src/pages/MainPage/Pricing.jsxindex bea437f00..d51d4fba9 100644--- a/src/pages/MainPage/Pricing.jsx+++ b/src/pages/MainPage/Pricing.jsx@@ -93,7 +93,7 @@ const Pricing = () => {</p>{_isNil(tier.priceMonthly) ? (<Link- className='mt-8 block w-full bg-gray-800 border border-gray-800 rounded-md py-2 text-sm font-semibold text-white text-center hover:bg-gray-900'+ 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}>Get started@@ -101,7 +101,7 @@ const Pricing = () => {) : (<ahref={tier.href}- className='mt-8 block w-full bg-gray-800 border border-gray-800 rounded-md py-2 text-sm font-semibold text-white text-center hover:bg-gray-900'+ 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'>Buy {tier.name}</a>diff --git a/src/pages/MainPage/index.jsx b/src/pages/MainPage/index.jsxindex 31a741d23..c39e646b4 100644--- a/src/pages/MainPage/index.jsx+++ b/src/pages/MainPage/index.jsx@@ -1,4 +1,6 @@-import React, { memo } from 'react'+import React, { memo } from 'react'++import Title from 'components/Title'import SignUp from '../Auth/Signup/BasicSignup'import Pricing from './Pricing'@@ -129,121 +131,123 @@ const Features = () => (const Main = () => {return (- <div className='relative bg-gray-800'>- <SquareDots className='absolute bottom-0 left-0 transform translate-x-0 mb-0 text-gray-700 lg:top-0 xl:transform-none lg:mt-72' />- <SquareDots className='absolute bottom-0 right-0 transform translate-x-1/2 mb-48 text-gray-700 lg:top-0 lg:mb-0 xl:transform-none xl:translate-x-0 lg:mt-16' />- <div className='relative pt-6 pb-16 sm:pb-24'>- <main className='mt-16 sm:mt-24'>- <div className='mx-auto w-11/12'>- <div className='lg:grid lg:grid-cols-12 lg:gap-8'>- <div className='px-4 sm:px-6 sm:text-center md:max-w-2xl md:mx-auto lg:col-span-6 lg:text-left lg:flex lg:items-center'>- <div>- <h1 className='mt-4 text-4xl tracking-tight font-extrabold text-white sm:mt-5 sm:leading-none lg:mt-6 lg:text-5xl xl:text-6xl'>- <span className='text-indigo-400'>Powerful</span>{' '}- <span>analytics platform that respects</span>{' '}- <span className='text-indigo-400'>user privacy</span>- </h1>- <p className='mt-3 text-base text-gray-300 sm:mt-5 sm:text-xl lg:text-lg xl:text-xl'>- Swetrix brings an advanced and customisable analytics service for your web applications.<br />+ <Title title='Privacy Respecting Web Analytics Platform'>+ <div className='relative bg-gray-800'>+ <SquareDots className='absolute bottom-0 left-0 transform translate-x-0 mb-0 text-gray-700 lg:top-0 xl:transform-none lg:mt-72' />+ <SquareDots className='absolute bottom-0 right-0 transform translate-x-1/2 mb-48 text-gray-700 lg:top-0 lg:mb-0 xl:transform-none xl:translate-x-0 lg:mt-16' />+ <div className='relative pt-6 pb-16 sm:pb-24'>+ <main className='mt-16 sm:mt-24'>+ <div className='mx-auto w-11/12'>+ <div className='lg:grid lg:grid-cols-12 lg:gap-8'>+ <div className='px-4 sm:px-6 sm:text-center md:max-w-2xl md:mx-auto lg:col-span-6 lg:text-left lg:flex lg:items-center'>+ <div>+ <h1 className='mt-4 text-4xl tracking-tight font-extrabold text-white sm:mt-5 sm:leading-none lg:mt-6 lg:text-5xl xl:text-6xl'>+ <span className='text-indigo-400'>Powerful</span>{' '}+ <span>analytics platform that respects</span>{' '}+ <span className='text-indigo-400'>user privacy</span>+ </h1>+ <p className='mt-3 text-base text-gray-300 sm:mt-5 sm:text-xl lg:text-lg xl:text-xl'>+ Swetrix brings an advanced and customisable analytics service for your web applications.<br />Track every metric your bisuness needs without invading your users privacy.</p>+ </div></div>- </div>- <div className='mt-16 sm:mt-24 lg:mt-0 lg:col-span-6'>- <div className='bg-white sm:max-w-md sm:w-full sm:mx-auto sm:rounded-lg sm:overflow-hidden'>- <div className='px-4 py-8 sm:px-10'>- <p className='text-lg text-gray-900 text-center'>Sign up, it's free!</p>- <div className='mt-6'>- <SignUp />+ <div className='mt-16 sm:mt-24 lg:mt-0 lg:col-span-6'>+ <div className='bg-white sm:max-w-md sm:w-full sm:mx-auto sm:rounded-lg sm:overflow-hidden'>+ <div className='px-4 py-8 sm:px-10'>+ <p className='text-lg text-gray-900 text-center'>Sign up, it's free!</p>+ <div className='mt-6'>+ <SignUp />+ </div></div>- </div>- <div className='px-4 py-6 bg-gray-50 border-t-2 border-gray-200 sm:px-10'>- <p className='text-xs leading-5 text-gray-500'>- By signing up, you agree to our{' '}- <a href='#/' className='font-medium text-gray-900 hover:underline'>- Terms of Service+ <div className='px-4 py-6 bg-gray-50 border-t-2 border-gray-200 sm:px-10'>+ <p className='text-xs leading-5 text-gray-500'>+ By signing up, you agree to our{' '}+ <a href='#/' className='font-medium text-gray-900 hover:underline'>+ Terms of Service</a>- {' '}and{' '}- <a href='#/' className='font-medium text-gray-900 hover:underline'>- Privacy Policy+ {' '}and{' '}+ <a href='#/' className='font-medium text-gray-900 hover:underline'>+ Privacy Policy</a>.</p>+ </div></div></div></div></div>- </div>- </main>- </div>-- <div className='relative'>- <div className='absolute inset-0 flex flex-col' aria-hidden='true'>- <div className='flex-1' />- <div className='flex-1 w-full bg-white' />+ </main></div>- <div className='w-11/12 mx-auto px-4 sm:px-6'>- <img- className='relative rounded-lg shadow-lg'- src='/assets/test_screenshot.png'- alt='App screenshot'- />++ <div className='relative'>+ <div className='absolute inset-0 flex flex-col' aria-hidden='true'>+ <div className='flex-1' />+ <div className='flex-1 w-full bg-white' />+ </div>+ <div className='w-11/12 mx-auto px-4 sm:px-6'>+ <img+ className='relative rounded-lg shadow-lg'+ src='/assets/test_screenshot.png'+ alt='App screenshot'+ />+ </div></div>- </div>- <Features />- <div className='bg-indigo-600'>- <div className='w-11/12 mx-auto pb-16 pt-12 px-4 sm:px-6 lg:w-11/12 lg:px-8 lg:flex lg:items-center lg:justify-between'>- <h2 className='text-3xl sm:text-4xl font-extrabold tracking-tight text-gray-900'>- <span className='block text-white'>Want to know more technical details?</span>- <span className='block text-gray-300'>- Look at the documentation and features pags.+ <Features />+ <div className='bg-indigo-600'>+ <div className='w-11/12 mx-auto pb-16 pt-12 px-4 sm:px-6 lg:w-11/12 lg:px-8 lg:flex lg:items-center lg:justify-between'>+ <h2 className='text-3xl sm:text-4xl font-extrabold tracking-tight text-gray-900'>+ <span className='block text-white'>Want to know more technical details?</span>+ <span className='block text-gray-300'>+ Look at the documentation and features pags.</span>- </h2>- <div className='mt-6 space-y-4 sm:space-y-0 sm:flex sm:space-x-5'>- <a- href='#/'- className='flex items-center justify-center px-3 py-2 border border-transparent text-lg font-medium rounded-md shadow-sm text-indigo-800 bg-indigo-50 hover:bg-indigo-100'- >- Features+ </h2>+ <div className='mt-6 space-y-4 sm:space-y-0 sm:flex sm:space-x-5'>+ <a+ href='#/'+ className='flex items-center justify-center px-3 py-2 border border-transparent text-lg font-medium rounded-md shadow-sm text-indigo-800 bg-indigo-50 hover:bg-indigo-100'+ >+ Features</a>- <a- href='#/'- className='flex items-center justify-center px-3 py-2 border border-transparent text-lg font-medium rounded-md shadow-sm text-indigo-800 bg-indigo-50 hover:bg-indigo-100'- >- Docs+ <a+ href='#/'+ className='flex items-center justify-center px-3 py-2 border border-transparent text-lg font-medium rounded-md shadow-sm text-indigo-800 bg-indigo-50 hover:bg-indigo-100'+ >+ Docs</a>+ </div></div></div>- </div>- <Pricing />- <FAQs />+ <Pricing />+ <FAQs />- <div className='bg-white'>- <div className='w-11/12 mx-auto pb-16 pt-12 px-4 sm:px-6 lg:w-11/12 lg:px-8 lg:flex lg:items-center lg:justify-between'>- <h2 className='text-3xl sm:text-4xl font-extrabold tracking-tight text-gray-900'>- <span className='block'>Ready to get started?</span>- <span className='block bg-gradient-to-r from-purple-600 to-indigo-600 bg-clip-text text-transparent'>- Explore our service or create an account.+ <div className='bg-white'>+ <div className='w-11/12 mx-auto pb-16 pt-12 px-4 sm:px-6 lg:w-11/12 lg:px-8 lg:flex lg:items-center lg:justify-between'>+ <h2 className='text-3xl sm:text-4xl font-extrabold tracking-tight text-gray-900'>+ <span className='block'>Ready to get started?</span>+ <span className='block bg-gradient-to-r from-purple-600 to-indigo-600 bg-clip-text text-transparent'>+ Explore our service or create an account.</span>- </h2>- <div className='mt-6 space-y-4 sm:space-y-0 sm:flex sm:space-x-5'>- <a- href='#/'- className='flex items-center justify-center bg-gradient-to-r from-purple-600 to-indigo-600 bg-origin-border px-4 py-3 border border-transparent text-base font-medium rounded-md shadow-sm text-white hover:from-purple-700 hover:to-indigo-700'- >- Learn more+ </h2>+ <div className='mt-6 space-y-4 sm:space-y-0 sm:flex sm:space-x-5'>+ <a+ href='#/'+ className='flex items-center justify-center bg-gradient-to-r from-purple-600 to-indigo-600 bg-origin-border px-4 py-3 border border-transparent text-base font-medium rounded-md shadow-sm text-white hover:from-purple-700 hover:to-indigo-700'+ >+ Learn more</a>- <a- href='#/'- className='flex items-center justify-center px-4 py-3 border border-transparent text-base font-medium rounded-md shadow-sm text-indigo-800 bg-indigo-50 hover:bg-indigo-100'- >- Get started+ <a+ href='#/'+ className='flex items-center justify-center px-4 py-3 border border-transparent text-base font-medium rounded-md shadow-sm text-indigo-800 bg-indigo-50 hover:bg-indigo-100'+ >+ Get started</a>+ </div></div></div></div>- </div>+ </Title>)}diff --git a/src/pages/Project/Settings/ProjectSettings.jsx b/src/pages/Project/Settings/ProjectSettings.jsxindex 68bddd31e..0d23187b4 100644--- a/src/pages/Project/Settings/ProjectSettings.jsx+++ b/src/pages/Project/Settings/ProjectSettings.jsx@@ -8,6 +8,7 @@ import _join from 'lodash/join'import _split from 'lodash/split'import PropTypes from 'prop-types'+import Title from 'components/Title'import { createProject, updateProject, deleteProject } from 'api'import Input from 'ui/Input'import Button from 'ui/Button'@@ -148,89 +149,93 @@ const ProjectSettings = ({history.push(isSettings ? _replace(routes.project, ':id', id) : routes.dashboard)}+ const title = isSettings ? `${form.name} settings` : 'Create a new project'+return (- <div className='min-h-page bg-gray-50 flex flex-col py-6 px-4 sm:px-6 lg:px-8'>- <form className='max-w-7xl w-full mx-auto' onSubmit={handleSubmit}>- <h2 className='mt-2 text-3xl font-extrabold text-gray-900'>- {isSettings ? `${form.name} settings` : 'Create a new project'}- </h2>- <Input- name='name'- id='name'- type='text'- label='Project name'- value={form.name}- placeholder='My awesome project'- className='mt-4'- onChange={handleInput}- error={beenSubmitted ? errors.name : null}- />- <Input- name='id'- id='id'- type='text'- label='Project ID'- value={form.id}- className='mt-4'- onChange={handleInput}- error={beenSubmitted ? errors.id : null}- disabled- />- {isSettings ? (- <>- <Input- name='origins'- id='origins'- type='text'- label='Allowed origins'- hint={'A list of allowed origins (domains) which are allowed to use script with your ProjectID, separated by commas.\nLeave it empty to allow all origins (default setting).\nExample: cornell.edu, app.example.com, ssu.gov.ua'}- value={form.origins}- className='mt-4'- onChange={handleInput}- error={beenSubmitted ? errors.origins : null}- />- <Checkbox- checked={Boolean(form.active)}- onChange={handleInput}- name='active'- id='active'- className='mt-4'- label='Is project enabled'- hint={'Disabled projects will not count any newly incoming events or pageviews.\nYou will still be able to access the project\'s analytics in dashboard.'}- />- </>- ) : (- <p className='text-gray-500 italic mt-2 text-sm'>*you will be able to set up your project more thoroughly after you have created it</p>- )}- <div className='flex justify-between mt-4'>- <div>- <Button className='mr-2' onClick={onCancel} secondary regular>- Cancel- </Button>- <Button type='submit' loading={projectSaving} primary regular>- Save- </Button>- </div>- {isSettings && (- <Button onClick={() => !projectDeleting && setShowDelete(true)} loading={projectDeleting} danger large>- Delete project- </Button>+ <Title title={title}>+ <div className='min-h-page bg-gray-50 flex flex-col py-6 px-4 sm:px-6 lg:px-8'>+ <form className='max-w-7xl w-full mx-auto' onSubmit={handleSubmit}>+ <h2 className='mt-2 text-3xl font-extrabold text-gray-900'>+ {title}+ </h2>+ <Input+ name='name'+ id='name'+ type='text'+ label='Project name'+ value={form.name}+ placeholder='My awesome project'+ className='mt-4'+ onChange={handleInput}+ error={beenSubmitted ? errors.name : null}+ />+ <Input+ name='id'+ id='id'+ type='text'+ label='Project ID'+ value={form.id}+ className='mt-4'+ onChange={handleInput}+ error={beenSubmitted ? errors.id : null}+ disabled+ />+ {isSettings ? (+ <>+ <Input+ name='origins'+ id='origins'+ type='text'+ label='Allowed origins'+ hint={'A list of allowed origins (domains) which are allowed to use script with your ProjectID, separated by commas.\nLeave it empty to allow all origins (default setting).\nExample: cornell.edu, app.example.com, ssu.gov.ua'}+ value={form.origins}+ className='mt-4'+ onChange={handleInput}+ error={beenSubmitted ? errors.origins : null}+ />+ <Checkbox+ checked={Boolean(form.active)}+ onChange={handleInput}+ name='active'+ id='active'+ className='mt-4'+ label='Is project enabled'+ hint={'Disabled projects will not count any newly incoming events or pageviews.\nYou will still be able to access the project\'s analytics in dashboard.'}+ />+ </>+ ) : (+ <p className='text-gray-500 italic mt-2 text-sm'>*you will be able to set up your project more thoroughly after you have created it</p>)}- </div>- </form>-- <Modal- onClose={() => setShowDelete(false)}- onSubmit={onDelete}- submitText='Delete project'- closeText='Close'- title={`Delete ${form.name || 'the project'}?`}- message={'By pressing \'Delete project\' you understand, that this action is irreversible.\nThe project and all the data related to it will be deleted from our servers.'}- submitType='danger'- type='error'- isOpened={showDelete}- />- </div>+ <div className='flex justify-between mt-4'>+ <div>+ <Button className='mr-2' onClick={onCancel} secondary regular>+ Cancel+ </Button>+ <Button type='submit' loading={projectSaving} primary regular>+ Save+ </Button>+ </div>+ {isSettings && (+ <Button onClick={() => !projectDeleting && setShowDelete(true)} loading={projectDeleting} danger large>+ Delete project+ </Button>+ )}+ </div>+ </form>++ <Modal+ onClose={() => setShowDelete(false)}+ onSubmit={onDelete}+ submitText='Delete project'+ closeText='Close'+ title={`Delete ${form.name || 'the project'}?`}+ message={'By pressing \'Delete project\' you understand, that this action is irreversible.\nThe project and all the data related to it will be deleted from our servers.'}+ submitType='danger'+ type='error'+ isOpened={showDelete}+ />+ </div>+ </Title>)}diff --git a/src/pages/Project/View/ViewProject.jsx b/src/pages/Project/View/ViewProject.jsxindex 726d5b474..2e9efd216 100644--- a/src/pages/Project/View/ViewProject.jsx+++ b/src/pages/Project/View/ViewProject.jsx@@ -13,6 +13,7 @@ import _replace from 'lodash/replace'import _find from 'lodash/find'import PropTypes from 'prop-types'+import Title from 'components/Title'import { tbPeriodPairs, tbsFormatMapper } from 'redux/constants'import Button from 'ui/Button'import Loader from 'ui/Loader'@@ -167,68 +168,72 @@ const ViewProject = ({if (!isLoading) {return (- <div className='min-h-page bg-gray-50 py-6 px-4 sm:px-6 lg:px-8'>- <div className='flex flex-col md:flex-row items-center md:items-start justify-between h-10'>- <h2 className='text-3xl font-extrabold text-gray-900 break-words'>{name}</h2>- <div className='flex mt-3 md:mt-0'>- <div className='md:border-r border-gray-200 md:pr-3 mr-3'>- <span className='relative z-0 inline-flex shadow-sm rounded-md'>- {_map(activePeriod.tbs, (tb, index, { length }) => (- <button- key={tb}- type='button'- onClick={() => setTimebucket(tb)}- className={cx('relative capitalize inline-flex items-center px-4 py-2 border border-gray-300 bg-white text-sm font-medium text-gray-700 hover:bg-gray-50 focus:z-10 focus:outline-none focus:ring-1 focus:ring-indigo-500 focus:border-indigo-500', {- '-ml-px': index > 0,- 'rounded-l-md': index === 0,- 'rounded-r-md': 1 + index === length,- 'z-10 border-indigo-500 text-indigo-600': timeBucket === tb,- })}- >- {tb}- </button>- ))}- </span>- </div>- <Dropdown- items={tbPeriodPairs}- title={activePeriod.label}- labelExtractor={pair => pair.label}- keyExtractor={pair => pair.label}- onSelect={pair => updatePeriod(pair.period)}- />- <div className='h-full ml-3'>- <Button onClick={openSettingsHandler} className='py-2.5' secondary large>- Settings- </Button>+ <Title title={name}>+ <div className='min-h-page bg-gray-50 py-6 px-4 sm:px-6 lg:px-8'>+ <div className='flex flex-col md:flex-row items-center md:items-start justify-between h-10'>+ <h2 className='text-3xl font-extrabold text-gray-900 break-words'>{name}</h2>+ <div className='flex mt-3 md:mt-0'>+ <div className='md:border-r border-gray-200 md:pr-3 mr-3'>+ <span className='relative z-0 inline-flex shadow-sm rounded-md'>+ {_map(activePeriod.tbs, (tb, index, { length }) => (+ <button+ key={tb}+ type='button'+ onClick={() => setTimebucket(tb)}+ className={cx('relative capitalize inline-flex items-center px-4 py-2 border border-gray-300 bg-white text-sm font-medium text-gray-700 hover:bg-gray-50 focus:z-10 focus:outline-none focus:ring-1 focus:ring-indigo-500 focus:border-indigo-500', {+ '-ml-px': index > 0,+ 'rounded-l-md': index === 0,+ 'rounded-r-md': 1 + index === length,+ 'z-10 border-indigo-500 text-indigo-600': timeBucket === tb,+ })}+ >+ {tb}+ </button>+ ))}+ </span>+ </div>+ <Dropdown+ items={tbPeriodPairs}+ title={activePeriod.label}+ labelExtractor={pair => pair.label}+ keyExtractor={pair => pair.label}+ onSelect={pair => updatePeriod(pair.period)}+ />+ <div className='h-full ml-3'>+ <Button onClick={openSettingsHandler} className='py-2.5' secondary large>+ Settings+ </Button>+ </div></div></div>- </div>- <div className='flex flex-col md:flex-row items-center md:items-start justify-end h-10 mt-10 md:mt-5 mb-4'>- <Checkbox label='Show all views' id='views' checked={showTotal} onChange={(e) => setShowTotal(e.target.checked)} />- </div>- {_isEmpty(panelsData) ? (- analyticsLoading ? (- <Loader />+ <div className='flex flex-col md:flex-row items-center md:items-start justify-end h-10 mt-10 md:mt-5 mb-4'>+ <Checkbox label='Show all views' id='views' checked={showTotal} onChange={(e) => setShowTotal(e.target.checked)} />+ </div>+ {_isEmpty(panelsData) ? (+ analyticsLoading ? (+ <Loader />+ ) : (+ <NoEvents />+ )) : (- <NoEvents />- )- ) : (- <div className='pt-4 md:pt-0'>- <div id='dataChart' />- <div className='mt-5 grid grid-cols-1 gap-5 sm:grid-cols-2 lg:grid-cols-3'>- {_map(panelsData.types, type => (- <Panel key={type} name={typeNameMapping[type]} data={panelsData.data[type]} />- ))}+ <div className='pt-4 md:pt-0'>+ <div id='dataChart' />+ <div className='mt-5 grid grid-cols-1 gap-5 sm:grid-cols-2 lg:grid-cols-3'>+ {_map(panelsData.types, type => (+ <Panel key={type} name={typeNameMapping[type]} data={panelsData.data[type]} />+ ))}+ </div></div>- </div>- )}- </div>+ )}+ </div>+ </Title>)}return (- <Loader />+ <Title title={name}>+ <Loader />+ </Title>)}diff --git a/src/pages/UserSettings/UserSettings.jsx b/src/pages/UserSettings/UserSettings.jsxindex 826fbb25a..354bcaa9a 100644--- a/src/pages/UserSettings/UserSettings.jsx+++ b/src/pages/UserSettings/UserSettings.jsx@@ -4,6 +4,7 @@ import _size from 'lodash/size'import _isEmpty from 'lodash/isEmpty'import { MailIcon } from '@heroicons/react/outline'+import Title from 'components/Title'import Input from 'ui/Input'import Button from 'ui/Button'import Modal from 'ui/Modal'@@ -70,106 +71,108 @@ const UserSettings = ({ onDelete, onExport, onSubmit, onEmailConfirm }) => {}return (- <div className='min-h-page bg-gray-50 flex flex-col py-6 px-4 sm:px-6 lg:px-8'>- <form className='max-w-7xl w-full mx-auto' onSubmit={handleSubmit}>- <h2 className='mt-2 text-3xl font-extrabold text-gray-900'>- Profile settings+ <Title title='Profile settings'>+ <div className='min-h-page bg-gray-50 flex flex-col py-6 px-4 sm:px-6 lg:px-8'>+ <form className='max-w-7xl w-full mx-auto' onSubmit={handleSubmit}>+ <h2 className='mt-2 text-3xl font-extrabold text-gray-900'>+ Profile settings</h2>- <Input- name='email'- id='email'- type='email'- label='Email'- value={form.email}- placeholder='[email protected]'- className='mt-4'- onChange={handleInput}- error={beenSubmitted ? errors.email : null}- />- <div className='grid grid-cols-1 gap-y-6 gap-x-4 sm:grid-cols-6 mt-4'><Input- name='password'- id='password'- type='password'- label='Password'- hint='Longer than 8 chars'- value={form.password}- placeholder='Password'- className='sm:col-span-3'+ name='email'+ id='email'+ type='email'+ label='Email'+ value={form.email}+ placeholder='[email protected]'+ className='mt-4'onChange={handleInput}- error={beenSubmitted ? errors.password : null}+ error={beenSubmitted ? errors.email : null}/>- <Input- name='repeat'- id='repeat'- type='password'- label='Repeat password'- value={form.repeat}- placeholder='Repeat password'- className='sm:col-span-3'- onChange={handleInput}- error={beenSubmitted ? errors.repeat : null}- />- </div>- <Button className='mt-4' type='submit' primary large>- Update profile+ <div className='grid grid-cols-1 gap-y-6 gap-x-4 sm:grid-cols-6 mt-4'>+ <Input+ name='password'+ id='password'+ type='password'+ label='Password'+ hint='Longer than 8 chars'+ value={form.password}+ placeholder='Password'+ className='sm:col-span-3'+ onChange={handleInput}+ error={beenSubmitted ? errors.password : null}+ />+ <Input+ name='repeat'+ id='repeat'+ type='password'+ label='Repeat password'+ value={form.repeat}+ placeholder='Repeat password'+ className='sm:col-span-3'+ onChange={handleInput}+ error={beenSubmitted ? errors.repeat : null}+ />+ </div>+ <Button className='mt-4' type='submit' primary large>+ Update profile</Button>- <hr className='mt-3' />- {!user?.isActive && (- <div href='#' className='flex cursor-pointer mt-4 pl-0 underline text-blue-600 hover:text-indigo-800' onClick={() => onEmailConfirm(setError)}>- <MailIcon className='mt-0.5 mr-2 w-6 h-6 text-blue-500' />+ <hr className='mt-3' />+ {!user?.isActive && (+ <div href='#' className='flex cursor-pointer mt-4 pl-0 underline text-blue-600 hover:text-indigo-800' onClick={() => onEmailConfirm(setError)}>+ <MailIcon className='mt-0.5 mr-2 w-6 h-6 text-blue-500' />Didn't receive a link to confirm the email address? Request a new one!- </div>- )}- <div className='flex justify-between mt-4'>- <Button- onClick={() => setShowExportModal(true)}- regular- primary- >- Request data export+ </div>+ )}+ <div className='flex justify-between mt-4'>+ <Button+ onClick={() => setShowExportModal(true)}+ regular+ primary+ >+ Request data export</Button>- <Button- className='ml-3'- onClick={() => setShowModal(true)}- regular- danger- >- Delete account+ <Button+ className='ml-3'+ onClick={() => setShowModal(true)}+ regular+ danger+ >+ Delete account</Button>- </div>- </form>-- <Modal- onClose={() => setShowExportModal(false)}- onSubmit={() => { setShowExportModal(false); onExport() }}- submitText='Continue'- closeText='Close'- title='Data export'- type='info'- message={'As requested by Art. 20 of General Data Protection Regulation (GDPR) the you have the right to receive your personal data that we store.\nThe data export will be ready within 24 hours and sent to your email account.\nNote: you can request the data export only once per two weeks.'}- isOpened={showExportModal}- />- <Modal- onClose={() => setShowModal(false)}- onSubmit={() => { setShowModal(false); onDelete() }}- submitText='Delete my account'- closeText='Close'- title='Delete your account?'- submitType='danger'- type='error'- message={'Are you sure you want to deactivate your account?\nAll of your data will be permanently removed from our servers forever.\nThis action cannot be undone. '}- isOpened={showModal}- />- <Modal- onClose={() => { setError('') }}- closeText='Got it'- type='error'- title='Error'- message={error}- isOpened={Boolean(error)}- />- </div>+ </div>+ </form>++ <Modal+ onClose={() => setShowExportModal(false)}+ onSubmit={() => { setShowExportModal(false); onExport() }}+ submitText='Continue'+ closeText='Close'+ title='Data export'+ type='info'+ message={'As requested by Art. 20 of General Data Protection Regulation (GDPR) the you have the right to receive your personal data that we store.\nThe data export will be ready within 24 hours and sent to your email account.\nNote: you can request the data export only once per two weeks.'}+ isOpened={showExportModal}+ />+ <Modal+ onClose={() => setShowModal(false)}+ onSubmit={() => { setShowModal(false); onDelete() }}+ submitText='Delete my account'+ closeText='Close'+ title='Delete your account?'+ submitType='danger'+ type='error'+ message={'Are you sure you want to deactivate your account?\nAll of your data will be permanently removed from our servers forever.\nThis action cannot be undone. '}+ isOpened={showModal}+ />+ <Modal+ onClose={() => { setError('') }}+ closeText='Got it'+ type='error'+ title='Error'+ message={error}+ isOpened={Boolean(error)}+ />+ </div>+ </Title>)}diff --git a/src/redux/constants/index.js b/src/redux/constants/index.jsindex 78694fa4e..05955a825 100644--- a/src/redux/constants/index.js+++ b/src/redux/constants/index.js@@ -38,3 +38,5 @@ export const tbsFormatMapper = {}export const TOKEN = 'access_token'++export const TITLE_SUFFIX = process.env.REACT_APP_TITLE_SUFFIXdiff --git a/src/ui/Code.jsx b/src/ui/Code.jsxnew file mode 100644index 000000000..452f94af1--- /dev/null+++ b/src/ui/Code.jsx@@ -0,0 +1,23 @@+import React, { memo } from 'react'+import PropTypes from 'prop-types'+import cx from 'classnames'++const Code = ({ text, className, language }) => (+ <pre className={cx('whitespace-pre-line w-full rounded-md bg-gray-800', className)}>+ <code className={`language-${language}`}>{text}</code>+ </pre>+)++Code.propTypes = {+ text: PropTypes.oneOfType([+ PropTypes.string, PropTypes.number, PropTypes.node,+ ]).isRequired,+ language: PropTypes.string.isRequired,+ className: PropTypes.string,+}++Code.defaultProps = {+ className: '',+}++export default memo(Code)diff --git a/tailwind.config.js b/tailwind.config.jsindex d5e37b351..997fbfea7 100644--- a/tailwind.config.js+++ b/tailwind.config.js@@ -1,5 +1,6 @@module.exports = {// mode: 'jit',+ important: true,purge: ['./src/**/*.{js,jsx,ts,tsx}', './public/index.html'],darkMode: false, // or 'media' or 'class'theme: {@@ -14,8 +15,10 @@ module.exports = {},variants: {extend: {},+ scrollBehavior: ['motion-safe', 'motion-reduce', 'responsive'],},plugins: [require('@tailwindcss/forms'),+ require('tailwind-scroll-behavior')(),]}