📈 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
(improvement) Prettier code formatting (#386)
Andrii Romasiun1690fce8c1ad
diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.ymlindex 8e54d111c..8d4e55f88 100644--- a/.github/workflows/pull_request.yml+++ b/.github/workflows/pull_request.yml@@ -32,5 +32,8 @@ jobs:- name: Lint validationrun: npm run lint+ - name: Code formatting validation+ run: npm run format+- name: Unit testsrun: npm run test:cidiff --git a/.github/workflows/release.yml b/.github/workflows/release.ymlindex 153b5a426..01a44136c 100644--- a/.github/workflows/release.yml+++ b/.github/workflows/release.yml@@ -11,19 +11,19 @@ jobs:steps:- name: Check out the repouses: actions/checkout@v3-+- name: Log in to Docker Hubuses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20awith:username: ${{ secrets.DOCKER_USERNAME }}password: ${{ secrets.DOCKER_PASSWORD }}-+- name: Extract metadata (tags, labels) for Dockerid: metauses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7with:images: swetrix/swetrix-fe-+- name: Build and push Docker imageuses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671with:diff --git a/.prettierignore b/.prettierignorenew file mode 100644index 000000000..2e48e36c4--- /dev/null+++ b/.prettierignore@@ -0,0 +1,6 @@+node_modules+build+dist+piblic+.cache+deployment\ No newline at end of filediff --git a/.prettierrc.js b/.prettierrc.jsnew file mode 100644index 000000000..bd6302ddd--- /dev/null+++ b/.prettierrc.js@@ -0,0 +1,13 @@+module.exports = {+ printWidth: 120, // max 120 chars in line, code is easy to read+ useTabs: false, // use spaces instead of tabs+ tabWidth: 2, // "visual width" of of the "tab"+ trailingComma: 'all', // add trailing commas in objects, arrays, etc.+ semi: false, // Only add semicolons at the beginning of lines that may introduce ASI failures+ singleQuote: true, // '' for stings instead of ""+ bracketSpacing: true, // import { some } ... instead of import {some} ...+ arrowParens: 'always', // braces even for single param in arrow functions (a) => { }+ jsxSingleQuote: true, // '' for react props+ bracketSameLine: false, // pretty JSX+ endOfLine: 'lf', // 'lf' for linux, 'crlf' for windows, we need to use 'lf' for git+}diff --git a/README.md b/README.mdindex 737b732e3..cf8b38d7d 100644--- a/README.md+++ b/README.md@@ -40,6 +40,7 @@ Swetrix is open to pull-requests. Feel free to propose new features or submit buFor severe security issues, please contact us at [email protected]## Contributions+Contributions are welcome! You can find and pick any task on our [public roadmap](https://github.com/orgs/Swetrix/projects/2) page.\Feel free to also offer any feature or improvement proposal, all of it is highly appreciated!\You can also contribute translations on your [Crowdin](https://crowdin.com/project/swetrix) page.@@ -49,5 +50,6 @@ You can also contribute translations on your [Crowdin](https://crowdin.com/projeYou can contact us via email at [email protected]## Donate+You can support the project by donating us at https://ko-fi.com/andriir \We can only run our services by once again asking for your financial support!diff --git a/app/App.tsx b/app/App.tsxindex cc0fb13a0..6ba5b65bd 100644--- a/app/App.tsx+++ b/app/App.tsx@@ -25,35 +25,28 @@ import routesPath from 'routesPath'import { getPageMeta } from 'utils/server'import { authMe } from './api'-const minimalFooterPages = [- '/projects', '/dashboard', '/contact',-]+const minimalFooterPages = ['/projects', '/dashboard', '/contact']interface IApp {ssrTheme: 'dark' | 'light'ssrAuthenticated: boolean}-const TITLE_BLACKLIST = [- '/projects/', '/captchas/', '/blog',-]+const TITLE_BLACKLIST = ['/projects/', '/captchas/', '/blog']const App: React.FC<IApp> = ({ ssrTheme, ssrAuthenticated }) => {const dispatch = useAppDispatch()const { pathname } = useLocation()const { t } = useTranslation('common')const alert = useAlert()- const {- loading,- } = useSelector((state: StateType) => state.auth)+ const { loading } = useSelector((state: StateType) => state.auth)const reduxAuthenticated = useSelector((state: StateType) => state.auth.authenticated)const { error } = useSelector((state: StateType) => state.errors)const { message, type } = useSelector((state: StateType) => state.alerts)const accessToken = getAccessToken()- const authenticated = isBrowser- ? (loading ? !!accessToken : reduxAuthenticated)- : ssrAuthenticated+ const authenticated = isBrowser ? (loading ? !!accessToken : reduxAuthenticated) : ssrAuthenticated+ // prettier-ignoreuseEffect(() => {(async () => {if (accessToken && !reduxAuthenticated) {@@ -103,12 +96,13 @@ const App: React.FC<IApp> = ({ ssrTheme, ssrAuthenticated }) => {const isMinimalFooter = _some(minimalFooterPages, (page) => _includes(pathname, page))const isReferralPage = _startsWith(pathname, '/ref/')- const isProjectViewPage = _startsWith(pathname, '/projects/')- && !_endsWith(pathname, '/new')- && !_endsWith(pathname, '/subscribers/invite')- && !_endsWith(pathname, '/subscribers/invite')- && !_includes(pathname, '/alerts/')- && !_includes(pathname, '/settings/')+ const isProjectViewPage =+ _startsWith(pathname, '/projects/') &&+ !_endsWith(pathname, '/new') &&+ !_endsWith(pathname, '/subscribers/invite') &&+ !_endsWith(pathname, '/subscribers/invite') &&+ !_includes(pathname, '/alerts/') &&+ !_includes(pathname, '/settings/')return (// eslint-disable-next-line react/jsx-no-useless-fragment@@ -117,9 +111,7 @@ const App: React.FC<IApp> = ({ ssrTheme, ssrAuthenticated }) => {<Header ssrTheme={ssrTheme} authenticated={authenticated} />)}<Outlet />- {!isReferralPage && !isProjectViewPage && (- <Footer minimal={isMinimalFooter} authenticated={authenticated} />- )}+ {!isReferralPage && !isProjectViewPage && <Footer minimal={isMinimalFooter} authenticated={authenticated} />}</>)}diff --git a/app/api/ai.ts b/app/api/ai.tsindex ac54b777c..8dd41f294 100644--- a/app/api/ai.ts+++ b/app/api/ai.ts@@ -28,7 +28,5 @@ export const getChartPrediction = (chart: any, periodToForecast: any, frequency:.then((response) => response.data).catch((error) => {debug('%s', error)- throw _isEmpty(error.response.data?.message)- ? error.response.data- : error.response.data.message+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message})diff --git a/app/api/index.ts b/app/api/index.tsindex f1557befb..c90fcce59 100644--- a/app/api/index.ts+++ b/app/api/index.ts@@ -73,9 +73,7 @@ export const authMe = () =>.then((response): IUser => response.data).catch((error) => {debug('%s', error)- throw _isEmpty(error.response.data?.message)- ? error.response.data- : error.response.data.message+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message})export const logoutApi = (refreshToken: string | null) =>@@ -92,9 +90,7 @@ export const logoutApi = (refreshToken: string | null) =>}).catch((error) => {debug('%s', error)- throw _isEmpty(error.response.data?.message)- ? error.response.data- : error.response.data.message+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message})export const logoutAllApi = () =>@@ -109,36 +105,29 @@ export const logoutAllApi = () =>export const refreshToken = () =>api.post('v1/auth/refresh-token')- .then((response): {- access_token: string- refreshToken: string- } => response.data)+ .then(+ (+ response,+ ): {+ access_token: string+ refreshToken: string+ } => response.data,+ ).catch((error) => {debug('%s', error)- throw _isEmpty(error.response.data?.message)- ? error.response.data- : error.response.data.message+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message})-export const login = (credentials: {- email: string- password: string-}) =>+export const login = (credentials: { email: string; password: string }) =>api.post('v1/auth/login', credentials).then((response): IAuth => response.data).catch((error) => {debug('%s', error)- throw _isEmpty(error.response.data?.message)- ? error.response.data- : error.response.data.message+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message})-export const signup = (data: {- email: string,- password: string,- refCode?: string,-}) =>+export const signup = (data: { email: string; password: string; refCode?: string }) =>api.post('v1/auth/register', data).then((response): IAuth => response.data)@@ -222,17 +211,13 @@ export const getReferrals = () =>throw new Error(errorsArray)})-export const forgotPassword = (email: {- email: string-}) =>+export const forgotPassword = (email: { email: string }) =>api.post('v1/auth/reset-password', email).then((response) => response.data).catch((error) => {debug('%s', error)- throw _isEmpty(error.response.data?.message)- ? error.response.data- : error.response.data.message+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message})export const confirmEmail = () =>@@ -241,9 +226,7 @@ export const confirmEmail = () =>.then((response) => response.data).catch((error) => {debug('%s', error)- throw _isEmpty(error.response.data?.message)- ? error.response.data- : error.response.data.message+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message})export const exportUserData = () =>@@ -252,9 +235,7 @@ export const exportUserData = () =>.then((response) => response.data).catch((error) => {debug('%s', error)- throw _isEmpty(error.response.data?.message)- ? error.response.data- : error.response.data.message+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message})export const createNewPassword = (id: string, password: string) =>@@ -275,51 +256,51 @@ export const verifyEmail = ({ id }: { id: string }) =>.then((response) => response.data).catch((error) => {debug('%s', error)- throw _isEmpty(error.response.data?.message)- ? error.response.data- : error.response.data.message+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message})-export const verifyShare = ({ path, id }: { path: string, id: string }) =>+export const verifyShare = ({ path, id }: { path: string; id: string }) =>api.get(`/project/${path}/${id}`).then((response) => response.data).catch((error) => {debug('%s', error)- throw _isEmpty(error.response.data?.message)- ? error.response.data- : error.response.data.message+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message})export const getProjects = (take: number = 0, skip: number = 0, isCaptcha: boolean = false, search?: string) =>api.get(`/project?take=${take}&skip=${skip}&isCaptcha=${isCaptcha}&search=${search}`)- .then((response): {- results: IProject[]- total: number- page_total: number- totalMonthlyEvents: number- } => response.data)+ .then(+ (+ response,+ ): {+ results: IProject[]+ total: number+ page_total: number+ totalMonthlyEvents: number+ } => response.data,+ ).catch((error) => {debug('%s', error)- throw _isEmpty(error.response.data?.message)- ? error.response.data- : error.response.data.message+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message})export const getSharedProjects = (take: number = 0, skip: number = 0, search?: string) =>api.get(`/project/shared?take=${take}&skip=${skip}&search=${search}`)- .then((response): {- results: ISharedProject[]- total: number- page_total: number- } => response.data)+ .then(+ (+ response,+ ): {+ results: ISharedProject[]+ total: number+ page_total: number+ } => response.data,+ ).catch((error) => {debug('%s', error)- throw _isEmpty(error.response.data?.message)- ? error.response.data- : error.response.data.message+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message})// eslint-disable-next-line default-param-last@@ -333,23 +314,16 @@ export const getProject = (pid: string, isCaptcha: boolean = false, password?: s.then((response): IProject => response.data).catch((error) => {debug('%s', error)- throw _isEmpty(error.response.data?.message)- ? error.response.data- : error.response.data.message+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message})-export const createProject = (data: {- name: string- isCaptcha?: boolean-}) =>+export const createProject = (data: { name: string; isCaptcha?: boolean }) =>api.post('/project', data).then((response): IProject => response.data).catch((error) => {debug('%s', error)- throw _isEmpty(error.response.data?.message)- ? error.response.data- : error.response.data.message+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message})export const updateProject = (id: string, data: Partial<IProject>) =>@@ -358,9 +332,7 @@ export const updateProject = (id: string, data: Partial<IProject>) =>.then((response): IProject => response.data).catch((error) => {debug('%s', error)- throw _isEmpty(error.response.data?.message)- ? error.response.data- : error.response.data.message+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message})export const deleteProject = (id: string) =>@@ -369,9 +341,7 @@ export const deleteProject = (id: string) =>.then((response) => response.data).catch((error) => {debug('%s', error)- throw _isEmpty(error.response.data?.message)- ? error.response.data- : error.response.data.message+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message})export const deleteCaptchaProject = (id: string) =>@@ -380,9 +350,7 @@ export const deleteCaptchaProject = (id: string) =>.then((response) => response.data).catch((error) => {debug('%s', error)- throw _isEmpty(error.response.data?.message)- ? error.response.data- : error.response.data.message+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message})export const resetProject = (id: string) =>@@ -391,9 +359,7 @@ export const resetProject = (id: string) =>.then((response) => response.data).catch((error) => {debug('%s', error)- throw _isEmpty(error.response.data?.message)- ? error.response.data- : error.response.data.message+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message})export const resetCaptchaProject = (id: string) =>@@ -402,9 +368,7 @@ export const resetCaptchaProject = (id: string) =>.then((response) => response.data).catch((error) => {debug('%s', error)- throw _isEmpty(error.response.data?.message)- ? error.response.data- : error.response.data.message+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message})export const getProjectData = (@@ -420,7 +384,9 @@ export const getProjectData = () =>api.get(- `log?pid=${pid}&timeBucket=${tb}&period=${period}&filters=${JSON.stringify(filters)}&from=${from}&to=${to}&timezone=${timezone}&mode=${mode}`,+ `log?pid=${pid}&timeBucket=${tb}&period=${period}&filters=${JSON.stringify(+ filters,+ )}&from=${from}&to=${to}&timezone=${timezone}&mode=${mode}`,{headers: {'x-password': password,@@ -430,9 +396,7 @@ export const getProjectData = (.then((response) => response.data).catch((error) => {debug('%s', error)- throw _isEmpty(error.response.data?.message)- ? error.response.data- : error.response.data.message+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message})export const getCustomEventsMetadata = (@@ -457,9 +421,7 @@ export const getCustomEventsMetadata = (.then((response) => response.data).catch((error) => {debug('%s', error)- throw _isEmpty(error.response.data?.message)- ? error.response.data- : error.response.data.message+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message})export const getProjectCompareData = (@@ -475,7 +437,9 @@ export const getProjectCompareData = () =>api.get(- `log/chart?pid=${pid}&timeBucket=${tb}&period=${period}&filters=${JSON.stringify(filters)}&from=${from}&to=${to}&timezone=${timezone}&mode=${mode}`,+ `log/chart?pid=${pid}&timeBucket=${tb}&period=${period}&filters=${JSON.stringify(+ filters,+ )}&from=${from}&to=${to}&timezone=${timezone}&mode=${mode}`,{headers: {'x-password': password,@@ -485,9 +449,7 @@ export const getProjectCompareData = (.then((response) => response.data).catch((error) => {debug('%s', error)- throw _isEmpty(error.response.data?.message)- ? error.response.data- : error.response.data.message+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message})export const getPerfData = (@@ -502,7 +464,9 @@ export const getPerfData = () =>api.get(- `log/performance?pid=${pid}&timeBucket=${tb}&period=${period}&filters=${JSON.stringify(filters)}&from=${from}&to=${to}&timezone=${timezone}`,+ `log/performance?pid=${pid}&timeBucket=${tb}&period=${period}&filters=${JSON.stringify(+ filters,+ )}&from=${from}&to=${to}&timezone=${timezone}`,{headers: {'x-password': password,@@ -512,9 +476,7 @@ export const getPerfData = (.then((response) => response.data).catch((error) => {debug('%s', error)- throw _isEmpty(error.response.data?.message)- ? error.response.data- : error.response.data.message+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message})export const getSessions = (@@ -530,7 +492,9 @@ export const getSessions = () =>api.get(- `log/sessions?pid=${pid}&take=${take}&skip=${skip}&period=${period}&filters=${JSON.stringify(filters)}&from=${from}&to=${to}&timezone=${timezone}`,+ `log/sessions?pid=${pid}&take=${take}&skip=${skip}&period=${period}&filters=${JSON.stringify(+ filters,+ )}&from=${from}&to=${to}&timezone=${timezone}`,{headers: {'x-password': password,@@ -540,32 +504,20 @@ export const getSessions = (.then((response) => response.data).catch((error) => {debug('%s', error)- throw _isEmpty(error.response.data?.message)- ? error.response.data- : error.response.data.message+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message})-export const getSession = (- pid: string,- psid: string,- timezone: string = '',- password: string | undefined = '',-) =>+export const getSession = (pid: string, psid: string, timezone: string = '', password: string | undefined = '') =>api- .get(- `log/session?pid=${pid}&psid=${psid}&timezone=${timezone}`,- {- headers: {- 'x-password': password,- },+ .get(`log/session?pid=${pid}&psid=${psid}&timezone=${timezone}`, {+ headers: {+ 'x-password': password,},- )+ }).then((response) => response.data).catch((error) => {debug('%s', error)- throw _isEmpty(error.response.data?.message)- ? error.response.data- : error.response.data.message+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message})export const getFunnelData = (@@ -578,41 +530,28 @@ export const getFunnelData = (password: string | undefined = '',) =>api- .get(- `log/funnel?pid=${pid}&period=${period}&from=${from}&to=${to}&timezone=${timezone}&funnelId=${funnelId}`,- {- headers: {- 'x-password': password,- },+ .get(`log/funnel?pid=${pid}&period=${period}&from=${from}&to=${to}&timezone=${timezone}&funnelId=${funnelId}`, {+ headers: {+ 'x-password': password,},- )+ }).then((response) => response.data).catch((error) => {debug('%s', error)- throw _isEmpty(error.response.data?.message)- ? error.response.data- : error.response.data.message+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message})-export const getFunnels = (- pid: string,- password: string | undefined = '',-) =>+export const getFunnels = (pid: string, password: string | undefined = '') =>api- .get(- `project/funnels/${pid}`,- {- headers: {- 'x-password': password,- },+ .get(`project/funnels/${pid}`, {+ headers: {+ 'x-password': password,},- )+ }).then((response) => response.data).catch((error) => {debug('%s', error)- throw _isEmpty(error.response.data?.message)- ? error.response.data- : error.response.data.message+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message})export const getCaptchaData = (@@ -625,20 +564,30 @@ export const getCaptchaData = () =>api.get(- `log/captcha?pid=${pid}&timeBucket=${tb}&period=${period}&filters=${JSON.stringify(filters)}&from=${from}&to=${to}`,+ `log/captcha?pid=${pid}&timeBucket=${tb}&period=${period}&filters=${JSON.stringify(+ filters,+ )}&from=${from}&to=${to}`,).then((response) => response.data).catch((error) => {debug('%s', error)- throw _isEmpty(error.response.data?.message)- ? error.response.data- : error.response.data.message+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message})-export const getOverallStats = (pids: string[], period: string, from = '', to = '', timezone = 'Etc/GMT', filters: any = '', password?: string) =>+export const getOverallStats = (+ pids: string[],+ period: string,+ from = '',+ to = '',+ timezone = 'Etc/GMT',+ filters: any = '',+ password?: string,+) =>api.get(- `log/birdseye?pids=[${_map(pids, (pid) => `"${pid}"`).join(',')}]&period=${period}&from=${from}&to=${to}&timezone=${timezone}&filters=${JSON.stringify(filters)}`,+ `log/birdseye?pids=[${_map(pids, (pid) => `"${pid}"`).join(+ ',',+ )}]&period=${period}&from=${from}&to=${to}&timezone=${timezone}&filters=${JSON.stringify(filters)}`,{headers: {'x-password': password,@@ -648,15 +597,23 @@ export const getOverallStats = (pids: string[], period: string, from = '', to =.then((response): IOverall => response.data).catch((error) => {debug('%s', error)- throw _isEmpty(error.response.data?.message)- ? error.response.data- : error.response.data.message+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message})-export const getPerformanceOverallStats = (pids: string[], period: string, from = '', to = '', timezone = 'Etc/GMT', filters: any = '', password?: string) =>+export const getPerformanceOverallStats = (+ pids: string[],+ period: string,+ from = '',+ to = '',+ timezone = 'Etc/GMT',+ filters: any = '',+ password?: string,+) =>api.get(- `log/performance/birdseye?pids=[${_map(pids, (pid) => `"${pid}"`).join(',')}]&period=${period}&from=${from}&to=${to}&timezone=${timezone}&filters=${JSON.stringify(filters)}`,+ `log/performance/birdseye?pids=[${_map(pids, (pid) => `"${pid}"`).join(+ ',',+ )}]&period=${period}&from=${from}&to=${to}&timezone=${timezone}&filters=${JSON.stringify(filters)}`,{headers: {'x-password': password,@@ -666,20 +623,27 @@ export const getPerformanceOverallStats = (pids: string[], period: string, from.then((response): IOverall => response.data).catch((error) => {debug('%s', error)- throw _isEmpty(error.response.data?.message)- ? error.response.data- : error.response.data.message+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message})-export const getOverallStatsCaptcha = (pids: string[], period: string, from = '', to = '', timezone = 'Etc/GMT', filters: any = '') =>+export const getOverallStatsCaptcha = (+ pids: string[],+ period: string,+ from = '',+ to = '',+ timezone = 'Etc/GMT',+ filters: any = '',+) =>api- .get(`log/captcha/birdseye?pids=[${_map(pids, (pid) => `"${pid}"`).join(',')}]&period=${period}&from=${from}&to=${to}&timezone=${timezone}&filters=${JSON.stringify(filters)}`)+ .get(+ `log/captcha/birdseye?pids=[${_map(pids, (pid) => `"${pid}"`).join(+ ',',+ )}]&period=${period}&from=${from}&to=${to}&timezone=${timezone}&filters=${JSON.stringify(filters)}`,+ ).then((response): IOverall => response.data).catch((error) => {debug('%s', error)- throw _isEmpty(error.response.data?.message)- ? error.response.data- : error.response.data.message+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message})export const getLiveVisitors = (pids: string[], password?: string) =>@@ -692,9 +656,7 @@ export const getLiveVisitors = (pids: string[], password?: string) =>.then((response) => response.data).catch((error) => {debug('%s', error)- throw _isEmpty(error.response.data?.message)- ? error.response.data- : error.response.data.message+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message})export const getGeneralStats = () =>@@ -703,23 +665,22 @@ export const getGeneralStats = () =>.then((response) => response.data).catch((error) => {debug('%s', error)- throw _isEmpty(error.response.data?.message)- ? error.response.data- : error.response.data.message+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message})-export const shareProject = (pid: string, data: {- email: string- role: string-}) =>+export const shareProject = (+ pid: string,+ data: {+ email: string+ role: string+ },+) =>api.post(`/project/${pid}/share`, data).then((response): IProject => response.data).catch((error) => {debug('%s', error)- throw _isEmpty(error.response.data?.message)- ? error.response.data- : error.response.data.message+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message})export const deleteShareProjectUsers = (pid: string, userId: string) =>@@ -728,9 +689,7 @@ export const deleteShareProjectUsers = (pid: string, userId: string) =>.then((response) => response.data).catch((error) => {debug('%s', error)- throw _isEmpty(error.response.data?.message)- ? error.response.data- : error.response.data.message+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message})export const deleteShareProject = (pid: string) =>@@ -739,9 +698,7 @@ export const deleteShareProject = (pid: string) =>.then((response) => response.data).catch((error) => {debug('%s', error)- throw _isEmpty(error.response.data?.message)- ? error.response.data- : error.response.data.message+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message})export const acceptShareProject = (id: string) =>@@ -750,22 +707,21 @@ export const acceptShareProject = (id: string) =>.then((response) => response.data).catch((error) => {debug('%s', error)- throw _isEmpty(error.response.data?.message)- ? error.response.data- : error.response.data.message+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message})-export const changeShareRole = (id: string, data: {- role: string-}) =>+export const changeShareRole = (+ id: string,+ data: {+ role: string+ },+) =>api.put(`project/share/${id}`, data).then((response) => response.data).catch((error) => {debug('%s', error)- throw _isEmpty(error.response.data?.message)- ? error.response.data- : error.response.data.message+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message})export const generate2FA = () =>@@ -774,9 +730,7 @@ export const generate2FA = () =>.then((response) => response.data).catch((error) => {debug('%s', error)- throw _isEmpty(error.response.data?.message)- ? error.response.data- : error.response.data.message+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message})export const enable2FA = (twoFactorAuthenticationCode: string) =>@@ -785,9 +739,7 @@ export const enable2FA = (twoFactorAuthenticationCode: string) =>.then((response) => response.data).catch((error) => {debug('%s', error)- throw _isEmpty(error.response.data?.message)- ? error.response.data- : error.response.data.message+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message})export const disable2FA = (twoFactorAuthenticationCode: string) =>@@ -796,9 +748,7 @@ export const disable2FA = (twoFactorAuthenticationCode: string) =>.then((response) => response.data).catch((error) => {debug('%s', error)- throw _isEmpty(error.response.data?.message)- ? error.response.data- : error.response.data.message+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message})export const submit2FA = (twoFactorAuthenticationCode: string) =>@@ -807,22 +757,22 @@ export const submit2FA = (twoFactorAuthenticationCode: string) =>.then((response) => response.data).catch((error) => {debug('%s', error)- throw _isEmpty(error.response.data?.message)- ? error.response.data- : error.response.data.message+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message})export const generateApiKey = () =>api.post('user/api-key')- .then((response): {- apiKey: string- } => response.data)+ .then(+ (+ response,+ ): {+ apiKey: string+ } => response.data,+ ).catch((error) => {debug('%s', error)- throw _isEmpty(error.response.data?.message)- ? error.response.data- : error.response.data.message+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message})export const deleteApiKey = () =>@@ -831,9 +781,7 @@ export const deleteApiKey = () =>.then((response) => response.data).catch((error) => {debug('%s', error)- throw _isEmpty(error.response.data?.message)- ? error.response.data- : error.response.data.message+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message})export const getInstalledExtensions = (limit = 100, offset = 0) =>@@ -842,9 +790,7 @@ export const getInstalledExtensions = (limit = 100, offset = 0) =>.then((response) => response.data).catch((error) => {debug('%s', error)- throw _isEmpty(error.response.data?.message)- ? error.response.data- : error.response.data.message+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message})export const setTheme = (theme: string) =>@@ -853,9 +799,7 @@ export const setTheme = (theme: string) =>.then((response) => response.data).catch((error) => {debug('%s', error)- throw _isEmpty(error.response.data?.message)- ? error.response.data- : error.response.data.message+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message})export interface IGetLiveVisitorsInfo {@@ -875,9 +819,7 @@ export const getLiveVisitorsInfo = (pid: string, password?: string) =>.then((response): IGetLiveVisitorsInfo[] => response.data).catch((error) => {debug('%s', error)- throw _isEmpty(error.response.data?.message)- ? error.response.data- : error.response.data.message+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message})export const removeTgIntegration = (tgID: string) =>@@ -886,27 +828,27 @@ export const removeTgIntegration = (tgID: string) =>.then((response) => response.data).catch((error) => {debug('%s', error)- throw _isEmpty(error.response.data?.message)- ? error.response.data- : error.response.data.message+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message})export const getAlerts = (take: number = DEFAULT_ALERTS_TAKE, skip: number = 0) =>api.get(`alert?take=${take}&skip=${skip}`)- .then((response): {- results: IAlerts[]- total: number- page_total: number- } => response.data)+ .then(+ (+ response,+ ): {+ results: IAlerts[]+ total: number+ page_total: number+ } => response.data,+ ).catch((error) => {debug('%s', error)- throw _isEmpty(error.response.data?.message)- ? error.response.data- : error.response.data.message+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message})-export interface ICreateAlert extends Omit<IAlerts, 'id' | 'lastTrigger' | 'lastTriggered' | 'created'> { }+export interface ICreateAlert extends Omit<IAlerts, 'id' | 'lastTrigger' | 'lastTriggered' | 'created'> {}export const createAlert = (data: ICreateAlert) =>api@@ -914,9 +856,7 @@ export const createAlert = (data: ICreateAlert) =>.then((response): IAlerts => response.data).catch((error) => {debug('%s', error)- throw _isEmpty(error.response.data?.message)- ? error.response.data- : error.response.data.message+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message})export const updateAlert = (id: string, data: Partial<IAlerts>) =>@@ -925,9 +865,7 @@ export const updateAlert = (id: string, data: Partial<IAlerts>) =>.then((response): IAlerts => response.data).catch((error) => {debug('%s', error)- throw _isEmpty(error.response.data?.message)- ? error.response.data- : error.response.data.message+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message})export const deleteAlert = (id: string) =>@@ -936,9 +874,7 @@ export const deleteAlert = (id: string) =>.then((response) => response.data).catch((error) => {debug('%s', error)- throw _isEmpty(error.response.data?.message)- ? error.response.data- : error.response.data.message+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message})export const reGenerateCaptchaSecretKey = (pid: string) =>@@ -947,23 +883,22 @@ export const reGenerateCaptchaSecretKey = (pid: string) =>.then((response) => response.data).catch((error) => {debug('%s', error)- throw _isEmpty(error.response.data?.message)- ? error.response.data- : error.response.data.message+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message})-export const addSubscriber = (id: string, data: {- email: string- reportFrequency: string-}) =>+export const addSubscriber = (+ id: string,+ data: {+ email: string+ reportFrequency: string+ },+) =>api.post(`project/${id}/subscribers`, data).then((response): ISubscribers => response.data).catch((error) => {debug('%s', error)- throw _isEmpty(error.response.data?.message)- ? error.response.data- : error.response.data.message+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message})export const addFunnel = (pid: string, name: string, steps: string[]) =>@@ -972,9 +907,7 @@ export const addFunnel = (pid: string, name: string, steps: string[]) =>.then((response): any => response.data).catch((error) => {debug('%s', error)- throw _isEmpty(error.response.data?.message)- ? error.response.data- : error.response.data.message+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message})export const updateFunnel = (id: string, pid: string, name: string, steps: string[]) =>@@ -983,9 +916,7 @@ export const updateFunnel = (id: string, pid: string, name: string, steps: strin.then((response): any => response.data).catch((error) => {debug('%s', error)- throw _isEmpty(error.response.data?.message)- ? error.response.data- : error.response.data.message+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message})export const deleteFunnel = (id: string, pid: string) =>@@ -994,36 +925,38 @@ export const deleteFunnel = (id: string, pid: string) =>.then((response): any => response.data).catch((error) => {debug('%s', error)- throw _isEmpty(error.response.data?.message)- ? error.response.data- : error.response.data.message+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message})export const getSubscribers = (id: string, offset: number, limit: number) =>api.get(`project/${id}/subscribers?offset=${offset}&limit=${limit}`)- .then((response): {- subscribers: ISubscribers[]- count: number- } => response.data)+ .then(+ (+ response,+ ): {+ subscribers: ISubscribers[]+ count: number+ } => response.data,+ ).catch((error) => {debug('%s', error)- throw _isEmpty(error.response.data?.message)- ? error.response.data- : error.response.data.message+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message})-export const updateSubscriber = (id: string, subscriberId: string, data: {- reportFrequency: string-}) =>+export const updateSubscriber = (+ id: string,+ subscriberId: string,+ data: {+ reportFrequency: string+ },+) =>api.patch(`project/${id}/subscribers/${subscriberId}`, data).then((response): ISubscribers => response.data).catch((error) => {debug('%s', error)- throw _isEmpty(error.response.data?.message)- ? error.response.data- : error.response.data.message+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message})export const removeSubscriber = (id: string, subscriberId: string) =>@@ -1032,9 +965,7 @@ export const removeSubscriber = (id: string, subscriberId: string) =>.then((response) => response.data).catch((error) => {debug('%s', error)- throw _isEmpty(error.response.data?.message)- ? error.response.data- : error.response.data.message+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message})export const confirmSubscriberInvite = (id: string, token: string) =>@@ -1043,9 +974,7 @@ export const confirmSubscriberInvite = (id: string, token: string) =>.then((response) => response.data).catch((error) => {debug('%s', error)- throw _isEmpty(error.response.data?.message)- ? error.response.data- : error.response.data.message+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message})export const getProjectDataCustomEvents = (@@ -1061,7 +990,9 @@ export const getProjectDataCustomEvents = () =>api.get(- `log/custom-events?pid=${pid}&timeBucket=${tb}&period=${period}&filters=${JSON.stringify(filters)}&from=${from}&to=${to}&timezone=${timezone}&customEvents=${JSON.stringify(customEvents)}`,+ `log/custom-events?pid=${pid}&timeBucket=${tb}&period=${period}&filters=${JSON.stringify(+ filters,+ )}&from=${from}&to=${to}&timezone=${timezone}&customEvents=${JSON.stringify(customEvents)}`,{headers: {'x-password': password,@@ -1071,9 +1002,7 @@ export const getProjectDataCustomEvents = (.then((response) => response.data).catch((error) => {debug('%s', error)- throw _isEmpty(error.response.data?.message)- ? error.response.data- : error.response.data.message+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message})export const transferProject = (uuid: string, email: string) =>@@ -1085,9 +1014,7 @@ export const transferProject = (uuid: string, email: string) =>.then((response): unknown => response.data).catch((error) => {debug('%s', error)- throw _isEmpty(error.response.data?.message)- ? error.response.data- : error.response.data.message+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message})export const rejectTransferProject = (uuid: string) =>@@ -1096,9 +1023,7 @@ export const rejectTransferProject = (uuid: string) =>.then((response): unknown => response.data).catch((error) => {debug('%s', error)- throw _isEmpty(error.response.data?.message)- ? error.response.data- : error.response.data.message+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message})export const confirmTransferProject = (uuid: string) =>@@ -1107,9 +1032,7 @@ export const confirmTransferProject = (uuid: string) =>.then((response): unknown => response.data).catch((error) => {debug('%s', error)- throw _isEmpty(error.response.data?.message)- ? error.response.data- : error.response.data.message+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message})export const generateSSOAuthURL = (provider: string) =>@@ -1120,9 +1043,7 @@ export const generateSSOAuthURL = (provider: string) =>.then((response): unknown => response.data).catch((error) => {debug('%s', error)- throw _isEmpty(error.response.data?.message)- ? error.response.data- : error.response.data.message+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message})export const getJWTBySSOHash = (hash: string, provider: string, refCode?: string) =>@@ -1131,9 +1052,7 @@ export const getJWTBySSOHash = (hash: string, provider: string, refCode?: string.then((response): unknown => response.data).catch((error) => {debug('%s', error)- throw _isEmpty(error.response.data?.message)- ? error.response.data- : error.response.data.message+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message})export const linkBySSOHash = (hash: string, provider: string) =>@@ -1142,9 +1061,7 @@ export const linkBySSOHash = (hash: string, provider: string) =>.then((response): unknown => response.data).catch((error) => {debug('%s', error)- throw _isEmpty(error.response.data?.message)- ? error.response.data- : error.response.data.message+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message})export const unlinkSSO = (provider: string) =>@@ -1153,9 +1070,7 @@ export const unlinkSSO = (provider: string) =>.then((response): unknown => response.data).catch((error) => {debug('%s', error)- throw _isEmpty(error.response.data?.message)- ? error.response.data- : error.response.data.message+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message})export const processSSOToken = (token: string, hash: string) =>@@ -1164,9 +1079,7 @@ export const processSSOToken = (token: string, hash: string) =>.then((response): unknown => response.data).catch((error) => {debug('%s', error)- throw _isEmpty(error.response.data?.message)- ? error.response.data- : error.response.data.message+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message})export const getProjectsNames = () =>@@ -1175,9 +1088,7 @@ export const getProjectsNames = () =>.then((response): IProjectNames[] => response.data).catch((error) => {debug('%s', error)- throw _isEmpty(error.response.data?.message)- ? error.response.data- : error.response.data.message+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message})export const createCaptchaInherited = (id: string) =>@@ -1186,23 +1097,22 @@ export const createCaptchaInherited = (id: string) =>.then((response): IProject => response.data).catch((error) => {debug('%s', error)- throw _isEmpty(error.response.data?.message)- ? error.response.data- : error.response.data.message+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message})-export const deletePartially = (id: string, data: {- from: string- to: string-}) =>+export const deletePartially = (+ id: string,+ data: {+ from: string+ to: string+ },+) =>api.delete(`project/partially/${id}?from=${data.from}&to=${data.to}`).then((response) => response.data).catch((error) => {debug('%s', error)- throw _isEmpty(error.response.data?.message)- ? error.response.data- : error.response.data.message+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message})export const getUserFlow = (@@ -1217,7 +1127,9 @@ export const getUserFlow = () =>api.get(- `log/user-flow?pid=${pid}&timeBucket=${tb}&period=${period}&filters=${JSON.stringify(filters)}&from=${from}&to=${to}&timezone=${timezone}`,+ `log/user-flow?pid=${pid}&timeBucket=${tb}&period=${period}&filters=${JSON.stringify(+ filters,+ )}&from=${from}&to=${to}&timezone=${timezone}`,{headers: {'x-password': password,@@ -1227,9 +1139,7 @@ export const getUserFlow = (.then((response) => response.data).catch((error) => {debug('%s', error)- throw _isEmpty(error.response.data?.message)- ? error.response.data- : error.response.data.message+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message})export const checkPassword = (pid: string, password: string) =>@@ -1242,9 +1152,7 @@ export const checkPassword = (pid: string, password: string) =>.then((response): Boolean => response.data).catch((error) => {debug('%s', error)- throw _isEmpty(error.response.data?.message)- ? error.response.data- : error.response.data.message+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message})export const getPaymentMetainfo = () =>@@ -1253,9 +1161,7 @@ export const getPaymentMetainfo = () =>.then((response) => response.data).catch((error) => {debug('%s', error)- throw _isEmpty(error.response.data?.message)- ? error.response.data- : error.response.data.message+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message})export const getUsageInfo = () =>@@ -1264,9 +1170,7 @@ export const getUsageInfo = () =>.then((response) => response.data).catch((error) => {debug('%s', error)- throw _isEmpty(error.response.data?.message)- ? error.response.data- : error.response.data.message+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message})export const getFilters = (pid: string, type: string, password = '') =>@@ -1366,13 +1270,15 @@ export const getBlogPostWithCategory = (category: string, slug: string) =>export const getLastPost = () =>api.get('v1/blog/last-post')- .then((response): {- title: string- handle: string- } => response.data)+ .then(+ (+ response,+ ): {+ title: string+ handle: string+ } => response.data,+ ).catch((error) => {debug('%s', error)- throw _isEmpty(error.response.data?.message)- ? error.response.data- : error.response.data.message+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message})diff --git a/app/components/EventsRunningOutBanner.tsx b/app/components/EventsRunningOutBanner.tsxindex 6d24e9a89..d0b01d18f 100644--- a/app/components/EventsRunningOutBanner.tsx+++ b/app/components/EventsRunningOutBanner.tsx@@ -9,10 +9,15 @@ import UIActions from 'redux/reducers/ui'import { SHOW_BANNER_AT_PERC } from 'redux/constants'const EventsRunningOutBanner = () => {- const { t }: {- t: (key: string, item?: {- [key: string]: string | number- }) => string+ const {+ t,+ }: {+ t: (+ key: string,+ item?: {+ [key: string]: string | number+ },+ ) => string} = useTranslation('common')const dispatch = useAppDispatch()const showNoEventsLeftBanner = useSelector((state: StateType) => state.ui.misc.showNoEventsLeftBanner)@@ -36,9 +41,7 @@ const EventsRunningOutBanner = () => {<ExclamationTriangleIcon className='h-6 w-6 text-white' aria-hidden='true' /></span><p className='ml-3 font-medium text-black truncate'>- <span className='md:hidden'>- {t('dashboard.lowEventsTitle')}- </span>+ <span className='md:hidden'>{t('dashboard.lowEventsTitle')}</span><span className='hidden md:inline'>{t('dashboard.eventsXPercUsed', {amount: SHOW_BANNER_AT_PERC,@@ -60,9 +63,7 @@ const EventsRunningOutBanner = () => {onClick={closeHandler}className='-mr-1 flex p-2 rounded-md hover:bg-yellow-500 focus:outline-none focus:ring-2 focus:ring-white sm:-mr-2'>- <span className='sr-only'>- {t('common.close')}- </span>+ <span className='sr-only'>{t('common.close')}</span><XMarkIcon className='h-6 w-6 text-black' aria-hidden='true' /></button></div>diff --git a/app/components/Footer/index.tsx b/app/components/Footer/index.tsxindex f93460907..47b827c66 100644--- a/app/components/Footer/index.tsx+++ b/app/components/Footer/index.tsx@@ -7,9 +7,21 @@ import Flag from 'react-flagkit'import PropTypes from 'prop-types'import {- isSelfhosted, DONATE_URL, FIREFOX_ADDON_URL, CHROME_EXTENSION_URL, GITHUB_URL,- LINKEDIN_URL, STATUSPAGE_URL, TWITTER_URL, UTM_GENERATOR_URL, SWETRIX_VS_GOOGLE,- SWETRIX_VS_CLOUDFLARE, DOCS_URL, SWETRIX_VS_SIMPLE_ANALYTICS, DISCORD_URL, CAPTCHA_URL,+ isSelfhosted,+ DONATE_URL,+ FIREFOX_ADDON_URL,+ CHROME_EXTENSION_URL,+ GITHUB_URL,+ LINKEDIN_URL,+ STATUSPAGE_URL,+ TWITTER_URL,+ UTM_GENERATOR_URL,+ SWETRIX_VS_GOOGLE,+ SWETRIX_VS_CLOUDFLARE,+ DOCS_URL,+ SWETRIX_VS_SIMPLE_ANALYTICS,+ DISCORD_URL,+ CAPTCHA_URL,} from 'redux/constants'import routesPath from 'routesPath'@@ -24,11 +36,16 @@ const navigation = {{ key: 'blog', href: routesPath.blog, internal: true },],legal: [- (authenticated: boolean | undefined): {+ (+ authenticated: boolean | undefined,+ ): {key: stringhref: stringinternal: boolean- } => (authenticated ? { key: 'billing', href: routesPath.billing, internal: true } : { key: 'pricing', href: `${routesPath.main}#pricing`, internal: true }),+ } =>+ authenticated+ ? { key: 'billing', href: routesPath.billing, internal: true }+ : { key: 'pricing', href: `${routesPath.main}#pricing`, internal: true },(): {key: stringhref: string@@ -102,14 +119,24 @@ const navigation = {name: 'LinkedIn',href: LINKEDIN_URL,icon: () => (- <img className='h-6 w-6 opacity-75 hover:opacity-90 bg-white rounded' aria-hidden='true' src='/assets/linkedin.svg' alt='LinkedIn' />+ <img+ className='h-6 w-6 opacity-75 hover:opacity-90 bg-white rounded'+ aria-hidden='true'+ src='/assets/linkedin.svg'+ alt='LinkedIn'+ />),},{name: 'Firefox Addon',href: FIREFOX_ADDON_URL,icon: () => (- <img className='h-6 w-6 opacity-75 hover:opacity-90' aria-hidden='true' src='/assets/firefox.svg' alt='Firefox' />+ <img+ className='h-6 w-6 opacity-75 hover:opacity-90'+ aria-hidden='true'+ src='/assets/firefox.svg'+ alt='Firefox'+ />),},{@@ -130,22 +157,40 @@ const SelfHostedFooter = () => {<div className='max-w-7xl mx-auto py-8 px-4 overflow-hidden sm:px-6 lg:px-8'><nav className='-mx-5 -my-2 flex flex-wrap justify-center' aria-label='Footer'><div className='px-5 py-2'>- <Link to={routesPath.contact} className='leading-6 text-slate-900 dark:text-gray-300 hover:text-slate-700 dark:hover:text-white'>+ <Link+ to={routesPath.contact}+ className='leading-6 text-slate-900 dark:text-gray-300 hover:text-slate-700 dark:hover:text-white'+ >{t('footer.contact')}</Link></div><div className='px-5 py-2'>- <a href={UTM_GENERATOR_URL} className='leading-6 text-slate-900 dark:text-gray-300 hover:text-slate-700 dark:hover:text-white' target='_blank' rel='noopener noreferrer' aria-label={`${t('footer.status')} (opens in a new tab)`}>+ <a+ href={UTM_GENERATOR_URL}+ className='leading-6 text-slate-900 dark:text-gray-300 hover:text-slate-700 dark:hover:text-white'+ target='_blank'+ rel='noopener noreferrer'+ aria-label={`${t('footer.status')} (opens in a new tab)`}+ >{t('footer.utm')}</a></div><div className='px-5 py-2'>- <a href={DONATE_URL} className='leading-6 text-slate-900 dark:text-gray-300 hover:text-slate-700 dark:hover:text-white' target='_blank' rel='noopener noreferrer' aria-label={`${t('footer.status')} (opens in a new tab)`}>+ <a+ href={DONATE_URL}+ className='leading-6 text-slate-900 dark:text-gray-300 hover:text-slate-700 dark:hover:text-white'+ target='_blank'+ rel='noopener noreferrer'+ aria-label={`${t('footer.status')} (opens in a new tab)`}+ >{t('footer.donate')}</a></div><div className='px-5 py-2'>- <Link to={routesPath.about} className='leading-6 text-slate-900 dark:text-gray-300 hover:text-slate-700 dark:hover:text-white'>+ <Link+ to={routesPath.about}+ className='leading-6 text-slate-900 dark:text-gray-300 hover:text-slate-700 dark:hover:text-white'+ >{t('footer.about')}</Link></div>@@ -155,11 +200,11 @@ const SelfHostedFooter = () => {)}-const Footer = ({ minimal, authenticated }: {- minimal?: boolean- authenticated?: boolean-}): JSX.Element => {- const { t, i18n: { language } } = useTranslation('common')+const Footer = ({ minimal, authenticated }: { minimal?: boolean; authenticated?: boolean }): JSX.Element => {+ const {+ t,+ i18n: { language },+ } = useTranslation('common')const year = new Date().getFullYear()const location = useLocation()@@ -173,27 +218,45 @@ const Footer = ({ minimal, authenticated }: {<div className='max-w-7xl mx-auto py-8 px-4 overflow-hidden sm:px-6 lg:px-8'><nav className='-mx-5 -my-2 flex flex-wrap justify-center relative' aria-label='Footer'><div className='px-5 py-2'>- <Link to={routesPath.contact} className='leading-6 text-slate-900 dark:text-gray-300 hover:text-slate-700 dark:hover:text-white'>+ <Link+ to={routesPath.contact}+ className='leading-6 text-slate-900 dark:text-gray-300 hover:text-slate-700 dark:hover:text-white'+ >{t('footer.contact')}</Link></div><div className='px-5 py-2'>- <Link to={routesPath.privacy} className='leading-6 text-slate-900 dark:text-gray-300 hover:text-slate-700 dark:hover:text-white'>+ <Link+ to={routesPath.privacy}+ className='leading-6 text-slate-900 dark:text-gray-300 hover:text-slate-700 dark:hover:text-white'+ >{t('footer.pp')}</Link></div><div className='px-5 py-2'>- <Link to={routesPath.terms} className='leading-6 text-slate-900 dark:text-gray-300 hover:text-slate-700 dark:hover:text-white'>+ <Link+ to={routesPath.terms}+ className='leading-6 text-slate-900 dark:text-gray-300 hover:text-slate-700 dark:hover:text-white'+ >{t('footer.tos')}</Link></div><div className='px-5 py-2'>- <Link to={routesPath.about} className='leading-6 text-slate-900 dark:text-gray-300 hover:text-slate-700 dark:hover:text-white'>+ <Link+ to={routesPath.about}+ className='leading-6 text-slate-900 dark:text-gray-300 hover:text-slate-700 dark:hover:text-white'+ >{t('footer.about')}</Link></div><div className='px-5 py-2'>- <a href={STATUSPAGE_URL} className='leading-6 text-slate-900 dark:text-gray-300 hover:text-slate-700 dark:hover:text-white' target='_blank' rel='noopener noreferrer' aria-label={`${t('footer.status')} (opens in a new tab)`}>+ <a+ href={STATUSPAGE_URL}+ className='leading-6 text-slate-900 dark:text-gray-300 hover:text-slate-700 dark:hover:text-white'+ target='_blank'+ rel='noopener noreferrer'+ aria-label={`${t('footer.status')} (opens in a new tab)`}+ >{t('footer.status')}</a></div>@@ -233,7 +296,13 @@ const Footer = ({ minimal, authenticated }: {<div><p className='flex text-gray-300 text-base'>{t('footer.madeIn')}- <a className='flex hover:underline hover:opacity-80 text-blue-400 ml-1' href={`https://${language}.wikipedia.org/wiki/Ukraine`} target='_blank' rel='noopener noreferrer' aria-label='Ukraine Wikipedia page (opens in a new tab)'>+ <a+ className='flex hover:underline hover:opacity-80 text-blue-400 ml-1'+ href={`https://${language}.wikipedia.org/wiki/Ukraine`}+ target='_blank'+ rel='noopener noreferrer'+ aria-label='Ukraine Wikipedia page (opens in a new tab)'+ ><Flag country='UA' size={18} alt='' aria-hidden='true' /> {t('footer.ukraine')}@@ -241,7 +310,13 @@ const Footer = ({ minimal, authenticated }: {</p><p className='flex text-gray-300 text-base'>{t('footer.hostedIn')}- <a className='flex hover:underline hover:opacity-80 text-blue-400 ml-1' href={`https://${language}.wikipedia.org/wiki/European_Union`} target='_blank' rel='noopener noreferrer' aria-label='European Union Wikipedia page (opens in a new tab)'>+ <a+ className='flex hover:underline hover:opacity-80 text-blue-400 ml-1'+ href={`https://${language}.wikipedia.org/wiki/European_Union`}+ target='_blank'+ rel='noopener noreferrer'+ aria-label='European Union Wikipedia page (opens in a new tab)'+ ><Flag country='EU' size={18} alt='' aria-hidden='true' /> {t('footer.eu')}@@ -250,31 +325,31 @@ const Footer = ({ minimal, authenticated }: {</div><div className='flex space-x-4'>{_map(navigation.social, (item) => (- <a key={item.name} href={item.href} title={item.name} target='_blank' rel='noopener noreferrer' className='text-gray-400 hover:text-gray-300' aria-label={`${item.name} (opens in a new tab)`}>+ <a+ key={item.name}+ href={item.href}+ title={item.name}+ target='_blank'+ rel='noopener noreferrer'+ className='text-gray-400 hover:text-gray-300'+ aria-label={`${item.name} (opens in a new tab)`}+ ><span className='sr-only'>{item.name}</span><item.icon className='h-6 w-6' aria-hidden='true' /></a>))}</div><p className='text-base pt-10 text-gray-300'>- ©- {' '}- {year}- {' '}- {t('footer.copy')}+ © {year} {t('footer.copy')}</p></div><div className='mt-12 xl:mt-0'><div className='grid grid-cols-2 md:grid-cols-3 gap-8'><div>- <h3 className='text-sm font-semibold text-white tracking-wider uppercase'>- {t('footer.features')}- </h3>+ <h3 className='text-sm font-semibold text-white tracking-wider uppercase'>{t('footer.features')}</h3><ul className='mt-4 space-y-4'>{_map(navigation.features, (data) => {- const {- value, key, href, internal,- } = data+ const { value, key, href, internal } = dataconst displayValue = value || t(`footer.${key}`)@@ -301,9 +376,7 @@ const Footer = ({ minimal, authenticated }: {</ul></div><div>- <h3 className='text-sm font-semibold text-white tracking-wider uppercase'>- {t('footer.company')}- </h3>+ <h3 className='text-sm font-semibold text-white tracking-wider uppercase'>{t('footer.company')}</h3><ul className='mt-4 space-y-4'>{_map(navigation.company, ({ key, href, internal }) => (<li key={key}>@@ -312,7 +385,13 @@ const Footer = ({ minimal, authenticated }: {{t(`footer.${key}`)}</Link>) : (- <a href={href} className='text-base text-gray-300 hover:text-white' target='_blank' rel='noopener noreferrer' aria-label={`${t(`footer.${key}`)} (opens in a new tab)`}>+ <a+ href={href}+ className='text-base text-gray-300 hover:text-white'+ target='_blank'+ rel='noopener noreferrer'+ aria-label={`${t(`footer.${key}`)} (opens in a new tab)`}+ >{t(`footer.${key}`)}</a>)}@@ -321,9 +400,7 @@ const Footer = ({ minimal, authenticated }: {</ul></div><div className='mt-12 md:mt-0'>- <h3 className='text-sm font-semibold text-white tracking-wider uppercase'>- {t('footer.legal')}- </h3>+ <h3 className='text-sm font-semibold text-white tracking-wider uppercase'>{t('footer.legal')}</h3><ul className='mt-4 space-y-4'>{_map(navigation.legal, (func) => {const { key, href, internal } = func(authenticated)@@ -335,7 +412,13 @@ const Footer = ({ minimal, authenticated }: {{t(`footer.${key}`)}</Link>) : (- <a href={href} className='text-base text-gray-300 hover:text-white' target='_blank' rel='noopener noreferrer' aria-label={`${t(`footer.${key}`)} (opens in a new tab)`}>+ <a+ href={href}+ className='text-base text-gray-300 hover:text-white'+ target='_blank'+ rel='noopener noreferrer'+ aria-label={`${t(`footer.${key}`)} (opens in a new tab)`}+ >{t(`footer.${key}`)}</a>)}diff --git a/app/components/GithubAuth.tsx b/app/components/GithubAuth.tsxindex 6f60b94ec..63a639f08 100644--- a/app/components/GithubAuth.tsx+++ b/app/components/GithubAuth.tsx@@ -10,17 +10,23 @@ import GithubLightSVG from 'ui/icons/GithubLight'import { SSO_PROVIDERS, isBrowser } from 'redux/constants'interface IGoogleAuth {- setIsLoading: (isLoading: boolean) => void,+ setIsLoading: (isLoading: boolean) => voidauthSSO: (provider: string, dontRemember: boolean, t: (key: string) => string, callback: (res: any) => void) => void- ssrTheme: string,- callback?: any,- dontRemember?: boolean,- isMiniButton?: boolean,+ ssrTheme: string+ callback?: any+ dontRemember?: boolean+ isMiniButton?: booleanclassName?: string}const GithubAuth: React.FC<IGoogleAuth> = ({- setIsLoading, authSSO, dontRemember, callback, isMiniButton, className, ssrTheme,+ setIsLoading,+ authSSO,+ dontRemember,+ callback,+ isMiniButton,+ className,+ ssrTheme,}) => {const { t } = useTranslation()const reduxTheme = useSelector((state: StateType) => state.ui.theme.theme)@@ -28,45 +34,38 @@ const GithubAuth: React.FC<IGoogleAuth> = ({const googleLogin = async () => {setIsLoading(true)- authSSO(- SSO_PROVIDERS.GITHUB,- dontRemember as boolean,- t,- callback,- )+ authSSO(SSO_PROVIDERS.GITHUB, dontRemember as boolean, t, callback)}if (isMiniButton) {return (<Buttontitle={t('auth.common.continueWithGithub')}- className={cx(className, 'ring-1 ring-slate-300 bg-transparent hover:bg-slate-100 dark:ring-slate-700 dark:hover:bg-slate-800/60')}+ className={cx(+ className,+ 'ring-1 ring-slate-300 bg-transparent hover:bg-slate-100 dark:ring-slate-700 dark:hover:bg-slate-800/60',+ )}onClick={googleLogin}secondaryregular>- {theme === 'dark' ? (- <GithubLightSVG className='w-5 h-5' />- ) : (- <GithubDarkSVG className='w-5 h-5' />- )}+ {theme === 'dark' ? <GithubLightSVG className='w-5 h-5' /> : <GithubDarkSVG className='w-5 h-5' />}</Button>)}return (<Button- className={cx(className, 'flex items-center justify-center border-indigo-100 dark:text-gray-50 dark:border-slate-700/50 dark:bg-slate-800 dark:hover:bg-slate-700')}+ className={cx(+ className,+ 'flex items-center justify-center border-indigo-100 dark:text-gray-50 dark:border-slate-700/50 dark:bg-slate-800 dark:hover:bg-slate-700',+ )}onClick={googleLogin}secondaryregular><>- {theme === 'dark' ? (- <GithubLightSVG className='w-5 h-5 mr-2' />- ) : (- <GithubDarkSVG className='w-5 h-5 mr-2' />- )}+ {theme === 'dark' ? <GithubLightSVG className='w-5 h-5 mr-2' /> : <GithubDarkSVG className='w-5 h-5 mr-2' />}{t('auth.common.github')}</></Button>@@ -76,7 +75,7 @@ const GithubAuth: React.FC<IGoogleAuth> = ({GithubAuth.defaultProps = {dontRemember: false,isMiniButton: false,- callback: () => { },+ callback: () => {},className: '',}diff --git a/app/components/GoogleAuth.tsx b/app/components/GoogleAuth.tsxindex 232fc12b6..5b97e8232 100644--- a/app/components/GoogleAuth.tsx+++ b/app/components/GoogleAuth.tsx@@ -7,34 +7,37 @@ import GoogleGSVG from 'ui/icons/GoogleG'import { SSO_PROVIDERS } from 'redux/constants'interface IGoogleAuth {- setIsLoading: (isLoading: boolean) => void,+ setIsLoading: (isLoading: boolean) => voidauthSSO: (provider: string, dontRemember: boolean, t: (key: string) => string, callback: (res: any) => void) => void- callback?: any,- dontRemember?: boolean,- isMiniButton?: boolean,+ callback?: any+ dontRemember?: boolean+ isMiniButton?: booleanclassName?: string}const GoogleAuth: React.FC<IGoogleAuth> = ({- setIsLoading, authSSO, dontRemember, callback, isMiniButton, className,+ setIsLoading,+ authSSO,+ dontRemember,+ callback,+ isMiniButton,+ className,}) => {const { t } = useTranslation()const googleLogin = async () => {setIsLoading(true)- authSSO(- SSO_PROVIDERS.GOOGLE,- dontRemember as boolean,- t,- callback,- )+ authSSO(SSO_PROVIDERS.GOOGLE, dontRemember as boolean, t, callback)}if (isMiniButton) {return (<Buttontitle={t('auth.common.continueWithGoogle')}- className={cx(className, 'ring-1 ring-slate-300 bg-transparent hover:bg-slate-100 dark:ring-slate-700 dark:hover:bg-slate-800/60')}+ className={cx(+ className,+ 'ring-1 ring-slate-300 bg-transparent hover:bg-slate-100 dark:ring-slate-700 dark:hover:bg-slate-800/60',+ )}onClick={googleLogin}secondaryregular@@ -46,7 +49,10 @@ const GoogleAuth: React.FC<IGoogleAuth> = ({return (<Button- className={cx(className, 'flex items-center justify-center border-indigo-100 dark:text-gray-50 dark:border-slate-700/50 dark:bg-slate-800 dark:hover:bg-slate-700')}+ className={cx(+ className,+ 'flex items-center justify-center border-indigo-100 dark:text-gray-50 dark:border-slate-700/50 dark:bg-slate-800 dark:hover:bg-slate-700',+ )}onClick={googleLogin}secondaryregular@@ -62,7 +68,7 @@ const GoogleAuth: React.FC<IGoogleAuth> = ({GoogleAuth.defaultProps = {dontRemember: false,isMiniButton: false,- callback: () => { },+ callback: () => {},className: '',}diff --git a/app/components/Header/index.tsx b/app/components/Header/index.tsxindex e715a8349..82f91bd8e 100644--- a/app/components/Header/index.tsx+++ b/app/components/Header/index.tsx@@ -1,19 +1,13 @@/* eslint-disable jsx-a11y/anchor-is-valid, react/no-unstable-nested-components */-import React, {- memo, Fragment, useRef, useMemo, MutableRefObject,-} from 'react'+import React, { memo, Fragment, useRef, useMemo, MutableRefObject } from 'react'import { Link } from '@remix-run/react'import { useDispatch, useSelector } from 'react-redux'import { useTranslation } from 'react-i18next'import Flag from 'react-flagkit'import i18next from 'i18next'-import {- Popover, Transition, Menu,-} from '@headlessui/react'-import {- Bars3Icon, XMarkIcon, ChevronDownIcon, ArrowSmallRightIcon,-} from '@heroicons/react/24/outline'+import { Popover, Transition, Menu } from '@headlessui/react'+import { Bars3Icon, XMarkIcon, ChevronDownIcon, ArrowSmallRightIcon } from '@heroicons/react/24/outline'import { MoonIcon, SunIcon } from '@heroicons/react/24/solid'import dayjs from 'dayjs'import utc from 'dayjs/plugin/utc'@@ -27,7 +21,13 @@ import { authActions } from 'redux/reducers/auth'import sagaActions from 'redux/sagas/actions'import UIActions from 'redux/reducers/ui'import {- whitelist, languages, languageFlag, isSelfhosted, DOCS_URL, SUPPORTED_THEMES, isBrowser,+ whitelist,+ languages,+ languageFlag,+ isSelfhosted,+ DOCS_URL,+ SUPPORTED_THEMES,+ isBrowser,} from 'redux/constants'import Dropdown from 'ui/Dropdown'import { IUser } from 'redux/models/IUser'@@ -44,20 +44,23 @@ const TRIAL_STATUS_MAPPING = {}const ThemeMenu = ({- theme, t, switchTheme,+ theme,+ t,+ switchTheme,}: {- theme: string,- t: (key: string, options?: {- [key: string]: string | number | null,- }) => string,- switchTheme: (i: string) => void,+ theme: string+ t: (+ key: string,+ options?: {+ [key: string]: string | number | null+ },+ ) => string+ switchTheme: (i: string) => void}) => (<Menu as='div' className='relative ml-3'><div><Menu.Button className='flex justify-center items-center font-semibold leading-6 text-base text-slate-800 hover:text-slate-700 dark:text-slate-200 dark:hover:text-white'>- <span className='sr-only'>- {t('header.switchTheme')}- </span>+ <span className='sr-only'>{t('header.switchTheme')}</span>{theme === 'dark' ? (<SunIcon className='h-6 w-6 text-gray-200 hover:text-gray-300 cursor-pointer' aria-hidden='true' />) : (@@ -78,9 +81,12 @@ const ThemeMenu = ({<Menu.Item>{({ active }) => (<div- className={cx('flex w-full font-semibold cursor-pointer px-4 py-2 text-sm text-indigo-600 dark:text-gray-50 hover:bg-gray-100 hover:dark:bg-slate-800', {- 'bg-gray-100 dark:bg-slate-800': active,- })}+ className={cx(+ 'flex w-full font-semibold cursor-pointer px-4 py-2 text-sm text-indigo-600 dark:text-gray-50 hover:bg-gray-100 hover:dark:bg-slate-800',+ {+ 'bg-gray-100 dark:bg-slate-800': active,+ },+ )}onClick={() => switchTheme('light')}><SunIcon className='h-5 w-5 mr-2 text-indigo-600 dark:text-gray-200' aria-hidden='true' />@@ -91,9 +97,12 @@ const ThemeMenu = ({<Menu.Item>{({ active }) => (<div- className={cx('flex w-full font-semibold cursor-pointer px-4 py-2 text-sm text-gray-700 dark:text-indigo-400 hover:bg-gray-100 hover:dark:bg-slate-800', {- 'bg-gray-100 dark:bg-slate-800': active,- })}+ className={cx(+ 'flex w-full font-semibold cursor-pointer px-4 py-2 text-sm text-gray-700 dark:text-indigo-400 hover:bg-gray-100 hover:dark:bg-slate-800',+ {+ 'bg-gray-100 dark:bg-slate-800': active,+ },+ )}onClick={() => switchTheme('dark')}><MoonIcon className='h-5 w-5 mr-2 text-gray-200 dark:text-indigo-400' aria-hidden='true' />@@ -107,22 +116,27 @@ const ThemeMenu = ({)const ProfileMenu = ({- user, logoutHandler, t, onLanguageChange, language,+ user,+ logoutHandler,+ t,+ onLanguageChange,+ language,}: {- user: IUser,- logoutHandler: () => void,- t: (key: string, options?: {- [key: string]: string | number | null,- }) => string,- onLanguageChange: (l: string) => void,- language: string,+ user: IUser+ logoutHandler: () => void+ t: (+ key: string,+ options?: {+ [key: string]: string | number | null+ },+ ) => string+ onLanguageChange: (l: string) => void+ language: string}) => (<Menu as='div' className='relative ml-3'><div><Menu.Button className='flex justify-center items-center font-semibold leading-6 text-base text-slate-800 hover:text-slate-700 dark:text-slate-200 dark:hover:text-white'>- <span>- {t('common.account')}- </span>+ <span>{t('common.account')}</span><ChevronDownIcon className='h-4 w-4 ml-1 stroke-2' aria-hidden='true' /></Menu.Button></div>@@ -139,16 +153,10 @@ const ProfileMenu = ({<div className='border-gray-200 dark:border-slate-700/50 border-b-[1px]'><Menu.Item><p className='truncate py-2 px-4' role='none'>- <span- className='block text-xs text-gray-500 dark:text-gray-300'- role='none'- >+ <span className='block text-xs text-gray-500 dark:text-gray-300' role='none'>{t('header.signedInAs')}</span>- <span- className='mt-0.5 text-sm font-semibold text-gray-700 dark:text-gray-50'- role='none'- >+ <span className='mt-0.5 text-sm font-semibold text-gray-700 dark:text-gray-50' role='none'>{user?.email}</span></p>@@ -161,11 +169,15 @@ const ProfileMenu = ({{({ open }) => (<><div>- <Menu.Button- className='flex justify-between w-full px-4 py-2 text-sm text-gray-700 dark:text-gray-50 hover:bg-gray-100 hover:dark:bg-slate-800'- >+ <Menu.Button className='flex justify-between w-full px-4 py-2 text-sm text-gray-700 dark:text-gray-50 hover:bg-gray-100 hover:dark:bg-slate-800'><div className='flex'>- <Flag className='rounded-sm mr-1.5' country={languageFlag[language]} size={20} alt='' aria-hidden='true' />+ <Flag+ className='rounded-sm mr-1.5'+ country={languageFlag[language]}+ size={20}+ alt=''+ aria-hidden='true'+ />{languages[language]}</div><ChevronDownIcon className='-mr-1 ml-2 h-5 w-5 stroke-2' aria-hidden='true' />@@ -186,7 +198,7 @@ const ProfileMenu = ({className='z-50 py-1 origin-top-right absolute right-0 mt-1 w-full min-w-max rounded-md shadow-lg bg-white dark:bg-slate-800 ring-1 ring-slate-200 dark:ring-slate-800 focus:outline-none'static>- {_map(whitelist, lng => (+ {_map(whitelist, (lng) => (<Menu.Item key={lng}><spanclassName='text-gray-700 dark:text-gray-50 dark:bg-slate-800 block px-4 py-2 text-sm cursor-pointer hover:bg-gray-200 dark:hover:bg-gray-600'@@ -196,7 +208,12 @@ const ProfileMenu = ({><div className='flex'><div className='pt-1'>- <Flag className='rounded-sm mr-1.5' country={languageFlag[lng]} size={20} alt={languageFlag[lng]} />+ <Flag+ className='rounded-sm mr-1.5'+ country={languageFlag[lng]}+ size={20}+ alt={languageFlag[lng]}+ /></div>{languages[lng]}</div>@@ -279,7 +296,16 @@ const ProfileMenu = ({)const AuthedHeader = ({- user, switchTheme, theme, onLanguageChange, rawStatus, status, t, language, logoutHandler, colourBackground,+ user,+ switchTheme,+ theme,+ onLanguageChange,+ rawStatus,+ status,+ t,+ language,+ logoutHandler,+ colourBackground,}: {user: IUserswitchTheme: (thm?: string) => void@@ -287,9 +313,12 @@ const AuthedHeader = ({onLanguageChange: (lng: string) => voidrawStatus: string | numberstatus: string- t: (key: string, options?: {- [key: string]: string | number | null- }) => string+ t: (+ key: string,+ options?: {+ [key: string]: string | number | null+ },+ ) => stringlanguage: stringlogoutHandler: () => voidcolourBackground: boolean@@ -320,7 +349,10 @@ const AuthedHeader = ({to={routesPath.billing}className={cx('font-semibold leading-6 text-base', {'text-amber-600 hover:text-amber-500': rawStatus === TRIAL_STATUS_MAPPING.ENDS_IN_X_DAYS,- 'text-rose-600 hover:text-rose-500': rawStatus === TRIAL_STATUS_MAPPING.ENDS_TODAY || rawStatus === TRIAL_STATUS_MAPPING.ENDS_TOMORROW || rawStatus === TRIAL_STATUS_MAPPING.ENDED,+ 'text-rose-600 hover:text-rose-500':+ rawStatus === TRIAL_STATUS_MAPPING.ENDS_TODAY ||+ rawStatus === TRIAL_STATUS_MAPPING.ENDS_TOMORROW ||+ rawStatus === TRIAL_STATUS_MAPPING.ENDED,})}key='TrialNotification'>@@ -359,11 +391,7 @@ const AuthedHeader = ({</div></div><div className='hidden md:flex justify-center items-center flex-wrap ml-1 md:ml-10 space-y-1 sm:space-y-0 space-x-2 md:space-x-4'>- <ThemeMenu- theme={theme}- switchTheme={switchTheme}- t={t}- />+ <ThemeMenu theme={theme} switchTheme={switchTheme} t={t} /><ProfileMenuuser={user}logoutHandler={logoutHandler}@@ -376,17 +404,21 @@ const AuthedHeader = ({{/* Theme switch */}{theme === 'dark' ? (<div className='transition-all duration-1000 ease-in-out rotate-180'>- <SunIcon onClick={() => switchTheme()} className='h-10 w-10 text-gray-200 hover:text-gray-300 cursor-pointer' />+ <SunIcon+ onClick={() => switchTheme()}+ className='h-10 w-10 text-gray-200 hover:text-gray-300 cursor-pointer'+ /></div>) : (<div className='transition-all duration-1000 ease-in-out'>- <MoonIcon onClick={() => switchTheme()} className='h-10 w-10 text-slate-700 hover:text-slate-600 cursor-pointer' />+ <MoonIcon+ onClick={() => switchTheme()}+ className='h-10 w-10 text-slate-700 hover:text-slate-600 cursor-pointer'+ /></div>)}<Popover.Button className='bg-white dark:bg-slate-800 dark:hover:bg-slate-700 dark:text-gray-200 rounded-md p-2 ml-3 inline-flex items-center justify-center text-gray-400 hover:text-gray-500 hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-indigo-500'>- <span className='sr-only'>- {t('common.openMenu')}- </span>+ <span className='sr-only'>{t('common.openMenu')}</span><Bars3Icon className='h-6 w-6' aria-hidden='true' /></Popover.Button></div>@@ -418,15 +450,21 @@ const AuthedHeader = ({)const NotAuthedHeader = ({- switchTheme, theme, onLanguageChange, t, language, colourBackground, refPage,+ switchTheme,+ theme,+ onLanguageChange,+ t,+ language,+ colourBackground,+ refPage,}: {- switchTheme: (a?: string) => void,- theme: string,- onLanguageChange: (lang: string) => void,- t: (key: string) => string,- language: string,- colourBackground: boolean,- refPage?: boolean,+ switchTheme: (a?: string) => void+ theme: string+ onLanguageChange: (lang: string) => void+ t: (key: string) => string+ language: string+ colourBackground: boolean+ refPage?: boolean}) => (<headerclassName={cx('relative overflow-x-clip', {@@ -463,7 +501,6 @@ const NotAuthedHeader = ({{!refPage && (<div className='hidden ml-10 space-x-1 lg:flex gap-4 items-center'>-<Linkto={routesPath.blog}className='font-semibold leading-6 text-base text-slate-800 hover:text-slate-700 dark:text-slate-200 dark:hover:text-white'@@ -479,7 +516,12 @@ const NotAuthedHeader = ({{t('common.pricing')}</Link>)}- <a href={DOCS_URL} className='font-semibold leading-6 text-base text-slate-800 hover:text-slate-700 dark:text-slate-200 dark:hover:text-white' target='_blank' rel='noreferrer noopener'>+ <a+ href={DOCS_URL}+ className='font-semibold leading-6 text-base text-slate-800 hover:text-slate-700 dark:text-slate-200 dark:hover:text-white'+ target='_blank'+ rel='noreferrer noopener'+ >{/* <DocumentTextIcon className='w-5 h-5 mr-1' /> */}{t('common.docs')}</a>@@ -492,12 +534,18 @@ const NotAuthedHeader = ({items={whitelist}buttonClassName='!py-0 inline-flex items-center [&>svg]:w-4 [&>svg]:h-4 [&>svg]:mr-0 [&>svg]:ml-1 text-sm font-semibold leading-6 text-base text-slate-800 hover:text-slate-700 dark:text-slate-200 dark:hover:text-white'selectItemClassName='text-gray-700 block px-4 py-2 text-base cursor-pointer hover:bg-gray-200 dark:text-gray-50 dark:bg-slate-800 dark:hover:bg-slate-700'- title={(+ title={<>- <Flag className='rounded-sm mr-1.5' country={languageFlag[language]} size={18} alt='' aria-hidden='true' />+ <Flag+ className='rounded-sm mr-1.5'+ country={languageFlag[language]}+ size={18}+ alt=''+ aria-hidden='true'+ />{languages[language]}</>- )}+ }labelExtractor={(lng: string) => (<div className='flex'><div className='pt-1'>@@ -509,17 +557,14 @@ const NotAuthedHeader = ({onSelect={onLanguageChange}headless/>- <ThemeMenu- theme={theme}- switchTheme={switchTheme}- t={t}- />+ <ThemeMenu theme={theme} switchTheme={switchTheme} t={t} />{!refPage && (<>- <span className='text-slate-700'>- |- </span>- <Link to={routesPath.signin} className='flex items-center font-semibold leading-6 text-base text-slate-800 hover:text-slate-700 dark:text-slate-200 dark:hover:text-white'>+ <span className='text-slate-700'>|</span>+ <Link+ to={routesPath.signin}+ className='flex items-center font-semibold leading-6 text-base text-slate-800 hover:text-slate-700 dark:text-slate-200 dark:hover:text-white'+ >{t('auth.common.signin')}<ArrowSmallRightIcon className='ml-1 stroke-2 h-4 w-4 mt-[1px]' /></Link>@@ -530,17 +575,21 @@ const NotAuthedHeader = ({{/* Theme switch */}{theme === 'dark' ? (<div className='transition-all duration-1000 ease-in-out rotate-180'>- <SunIcon onClick={() => switchTheme()} className='h-10 w-10 text-gray-200 hover:text-gray-300 cursor-pointer' />+ <SunIcon+ onClick={() => switchTheme()}+ className='h-10 w-10 text-gray-200 hover:text-gray-300 cursor-pointer'+ /></div>) : (<div className='transition-all duration-1000 ease-in-out'>- <MoonIcon onClick={() => switchTheme()} className='h-10 w-10 text-slate-700 hover:text-slate-600 cursor-pointer' />+ <MoonIcon+ onClick={() => switchTheme()}+ className='h-10 w-10 text-slate-700 hover:text-slate-600 cursor-pointer'+ /></div>)}<Popover.Button className='bg-white dark:bg-slate-800 dark:hover:bg-slate-700 dark:text-gray-200 rounded-md p-2 ml-3 inline-flex items-center justify-center text-gray-400 hover:text-gray-500 hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-indigo-500'>- <span className='sr-only'>- {t('common.openMenu')}- </span>+ <span className='sr-only'>{t('common.openMenu')}</span><Bars3Icon className='h-6 w-6' aria-hidden='true' /></Popover.Button></div>@@ -582,11 +631,17 @@ interface IHeader {}const Header: React.FC<IHeader> = ({ ssrTheme, authenticated, refPage, transparent }): JSX.Element => {- const { t, i18n: { language } }: {- t: (key: string, options?: {- [key: string]: string | number | null- }) => string,- i18n: { language: string },+ const {+ t,+ i18n: { language },+ }: {+ t: (+ key: string,+ options?: {+ [key: string]: string | number | null+ },+ ) => string+ i18n: { language: string }} = useTranslation('common')const dispatch = useAppDispatch()const _dispatch = useDispatch()@@ -597,7 +652,7 @@ const Header: React.FC<IHeader> = ({ ssrTheme, authenticated, refPage, transpareconst theme = isBrowser ? reduxTheme : ssrThemeconst [rawStatus, status] = useMemo(() => {- const { trialEndDate } = (user || {})+ const { trialEndDate } = user || {}if (!trialEndDate) {return [null, null]@@ -682,7 +737,10 @@ const Header: React.FC<IHeader> = ({ ssrTheme, authenticated, refPage, transpareleaveFrom='opacity-100 scale-100'leaveTo='opacity-0 scale-95'>- <Popover.Panel focus className='absolute top-0 z-50 inset-x-0 p-2 transition transform origin-top-right md:hidden'>+ <Popover.Panel+ focus+ className='absolute top-0 z-50 inset-x-0 p-2 transition transform origin-top-right md:hidden'+ ><div className='rounded-lg shadow-lg ring-1 ring-slate-200 dark:ring-slate-800 bg-white dark:bg-gray-750 divide-y-2 divide-gray-50 dark:divide-gray-800'><div className='pt-5 pb-6 px-5'><div className='flex items-center justify-between'>@@ -695,10 +753,11 @@ const Header: React.FC<IHeader> = ({ ssrTheme, authenticated, refPage, transparealt=''/></Link>- <Popover.Button ref={buttonRef} className='bg-white dark:bg-slate-800 dark:hover:bg-slate-700 dark:text-gray-200 rounded-md p-2 inline-flex items-center justify-center text-gray-400 hover:text-gray-500 hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-indigo-500'>- <span className='sr-only'>- {t('common.closeMenu')}- </span>+ <Popover.Button+ ref={buttonRef}+ className='bg-white dark:bg-slate-800 dark:hover:bg-slate-700 dark:text-gray-200 rounded-md p-2 inline-flex items-center justify-center text-gray-400 hover:text-gray-500 hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-indigo-500'+ >+ <span className='sr-only'>{t('common.closeMenu')}</span><XMarkIcon className='h-6 w-6' aria-hidden='true' /></Popover.Button></div>@@ -710,16 +769,27 @@ const Header: React.FC<IHeader> = ({ ssrTheme, authenticated, refPage, transpareitems={whitelist}buttonClassName='flex items-center w-full rounded-md border border-gray-300 shadow-sm px-3 md:px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-gray-100 focus:ring-indigo-500 dark:text-gray-50 dark:border-gray-800 dark:bg-slate-800 dark:hover:bg-slate-700'selectItemClassName='text-gray-700 block px-4 py-2 text-base cursor-pointer hover:bg-gray-200 dark:text-gray-50 dark:bg-slate-800 dark:hover:bg-slate-700'- title={(+ title={<>- <Flag className='rounded-sm mr-1.5' country={languageFlag[language]} size={21} alt='' aria-hidden='true' />+ <Flag+ className='rounded-sm mr-1.5'+ country={languageFlag[language]}+ size={21}+ alt=''+ aria-hidden='true'+ />{languages[language]}</>- )}+ }labelExtractor={(lng: string) => (<div className='flex'><div className='pt-1'>- <Flag className='rounded-sm mr-1.5' country={languageFlag[lng]} size={21} alt={languageFlag[lng]} />+ <Flag+ className='rounded-sm mr-1.5'+ country={languageFlag[lng]}+ size={21}+ alt={languageFlag[lng]}+ /></div>{languages[lng]}</div>@@ -733,7 +803,10 @@ const Header: React.FC<IHeader> = ({ ssrTheme, authenticated, refPage, transpareto={routesPath.billing}className={cx('font-semibold leading-6 text-base text-center', {'text-amber-600 hover:text-amber-500': rawStatus === TRIAL_STATUS_MAPPING.ENDS_IN_X_DAYS,- 'text-rose-600 hover:text-rose-500': rawStatus === TRIAL_STATUS_MAPPING.ENDS_TODAY || rawStatus === TRIAL_STATUS_MAPPING.ENDS_TOMORROW || rawStatus === TRIAL_STATUS_MAPPING.ENDED,+ 'text-rose-600 hover:text-rose-500':+ rawStatus === TRIAL_STATUS_MAPPING.ENDS_TODAY ||+ rawStatus === TRIAL_STATUS_MAPPING.ENDS_TOMORROW ||+ rawStatus === TRIAL_STATUS_MAPPING.ENDED,})}key='TrialNotification'>@@ -760,12 +833,19 @@ const Header: React.FC<IHeader> = ({ ssrTheme, authenticated, refPage, transpare</Link>)}<div onClick={() => buttonRef.current?.click()}>- <Link to={routesPath.user_settings} className='w-full flex items-center justify-center px-4 py-2 border border-transparent rounded-md shadow-sm text-base font-medium text-white bg-indigo-600 hover:bg-indigo-700 dark:text-gray-50 dark:bg-slate-800 dark:hover:bg-slate-700'>+ <Link+ to={routesPath.user_settings}+ className='w-full flex items-center justify-center px-4 py-2 border border-transparent rounded-md shadow-sm text-base font-medium text-white bg-indigo-600 hover:bg-indigo-700 dark:text-gray-50 dark:bg-slate-800 dark:hover:bg-slate-700'+ >{t('common.accountSettings')}</Link></div><div onClick={() => buttonRef.current?.click()}>- <Link to='#' className='w-full flex items-center justify-center px-4 py-2 border border-transparent rounded-md shadow-sm text-base font-medium text-indigo-600 bg-gray-50 hover:bg-indigo-50 dark:text-gray-50 dark:bg-slate-800 dark:hover:bg-slate-700' onClick={logoutHandler}>+ <Link+ to='#'+ className='w-full flex items-center justify-center px-4 py-2 border border-transparent rounded-md shadow-sm text-base font-medium text-indigo-600 bg-gray-50 hover:bg-indigo-50 dark:text-gray-50 dark:bg-slate-800 dark:hover:bg-slate-700'+ onClick={logoutHandler}+ >{t('common.logout')}</Link></div>@@ -773,12 +853,19 @@ const Header: React.FC<IHeader> = ({ ssrTheme, authenticated, refPage, transpare) : (<><div onClick={() => buttonRef.current?.click()}>- <Link to={routesPath.signin} className='w-full flex items-center justify-center px-4 py-2 border border-transparent rounded-md shadow-sm text-base font-medium text-indigo-600 bg-gray-50 hover:bg-indigo-50'>+ <Link+ to={routesPath.signin}+ className='w-full flex items-center justify-center px-4 py-2 border border-transparent rounded-md shadow-sm text-base font-medium text-indigo-600 bg-gray-50 hover:bg-indigo-50'+ >{t('auth.common.signin')}</Link></div><div onClick={() => buttonRef.current?.click()}>- <Link to={routesPath.signup} className='w-full flex items-center justify-center px-4 py-2 border border-transparent rounded-md shadow-sm text-base font-medium text-white bg-indigo-600 hover:bg-indigo-700' aria-label={t('titles.signup')}>+ <Link+ to={routesPath.signup}+ className='w-full flex items-center justify-center px-4 py-2 border border-transparent rounded-md shadow-sm text-base font-medium text-white bg-indigo-600 hover:bg-indigo-700'+ aria-label={t('titles.signup')}+ >{t('common.getStarted')}</Link></div>diff --git a/app/components/SEO.tsx b/app/components/SEO.tsxindex 51612811f..72f722f12 100644--- a/app/components/SEO.tsx+++ b/app/components/SEO.tsx@@ -7,7 +7,10 @@ import { getPageMeta } from 'utils/server'import { getOgImageUrl } from 'redux/constants'export const SEO = () => {- const { t, i18n: { language } } = useTranslation('common')+ const {+ t,+ i18n: { language },+ } = useTranslation('common')const { pathname } = useLocation()const { title, prefixLessTitle } = getPageMeta(t, undefined, pathname)@@ -22,9 +25,18 @@ export const SEO = () => {<title>{title}</title><meta property='og:title' content='Swetrix' /><meta name='twitter:title' content='Swetrix | Ultimate open-source web analytics to satisfy all your needs' />- <meta name='description' content='Swetrix is a cookieless, privacy-first and GDPR-compliant Google Analytics alternative' />- <meta name='twitter:description' content='Swetrix is a cookieless, privacy-first and GDPR-compliant Google Analytics alternative' />- <meta property='og:description' content='Swetrix is a cookieless, privacy-first and GDPR-compliant Google Analytics alternative' />+ <meta+ name='description'+ content='Swetrix is a cookieless, privacy-first and GDPR-compliant Google Analytics alternative'+ />+ <meta+ name='twitter:description'+ content='Swetrix is a cookieless, privacy-first and GDPR-compliant Google Analytics alternative'+ />+ <meta+ property='og:description'+ content='Swetrix is a cookieless, privacy-first and GDPR-compliant Google Analytics alternative'+ />{isMainPage ? (<><meta name='twitter:image' content='https://swetrix.com/assets/og_image.png' />diff --git a/app/css/mdfile.css b/app/css/mdfile.cssindex 3a5b0a3e8..b4c66bb76 100644--- a/app/css/mdfile.css+++ b/app/css/mdfile.css@@ -1,194 +1,193 @@.single_post {- font-size: 16px;- line-height: 1.5;- word-wrap: break-word;- }-- .single_post::before {- display: table;- content: "";- }-- .single_post> :first-child {- margin-top: 0 !important;- }-- .single_post p,- .single_post blockquote,- .single_post ul,- .single_post ol,- .single_post dl,- .single_post table,- .single_post pre,- .single_post details {- margin-top: 0;- margin-bottom: 16px;- }-- .single_post b,- strong {- font-weight: var(--base-text-weight-semibold, 600);- }-- .light .single_post a {- cursor: pointer;- --tw-text-opacity: 1;- color: rgb(79 70 229 / var(--tw-text-opacity));- }-- .dark .single_post a {- cursor: pointer;- --tw-text-opacity: 1;- color: rgb(129 140 248 / var(--tw-text-opacity));- }-- .single_post blockquote {- padding: 0 1em;- color: rgb(101, 109, 118);- border-left: .25em solid #d0d7de;- }-- .single_post h1,- .single_post h2,- .single_post h3,- .single_post h4,- .single_post h5,- .single_post h6 {- margin-top: 24px;- margin-bottom: 16px;- font-weight: var(--base-text-weight-semibold, 600);- line-height: 1.25;- }-- .single_post h1 {- padding-bottom: .3em;- font-size: 2em;- border-bottom: 1px solid #d8dee4;- }-- .dark .single_post h1 {- border-bottom: 1px solid #21262d- }-- .single_post h2 {- padding-bottom: .3em;- font-size: 1.5em;- border-bottom: 1px solid #d8dee4;- }-- .dark .single_post h2 {- border-bottom: 1px solid #21262d- }-- .single_post h3 {- font-size: 1.25em;- }-- .single_post h4 {- font-size: 1em;- }-- .single_post h5 {- font-size: .875em;- }--- .single_post .highlight pre,- .single_post pre {- padding: 16px;- overflow: auto;- font-size: 85%;- line-height: 1.45;- color: #33363b;- background-color: #f6f8fa;- border-radius: 6px;- }-- .dark .single_post .highlight pre,- .dark .single_post pre {- color: #d0d7de;- background-color: #21262d;- }-- .single_post pre {- word-wrap: normal;- }-- .single_post ul,- .single_post ol {- padding-left: 2em;- }-- .single_post ul {- list-style-type: disc;- }-- .single_post ol {- list-style-type: decimal;- }-- .single_post table {- display: block;- width: 100%;- width: max-content;- max-width: 100%;- overflow: auto;- }-- .single_post table tr {- background-color: #fff;- border-top: 1px solid #d8dee4;- }-- .dark .single_post table tr {- background-color: #21262d;- border-top: 1px solid #21262d;- }-- .single_post table tr:nth-child(2n) {- background-color: #f6f8fa;- }-- .dark .single_post table tr:nth-child(2n) {- background-color: #21262d;- }-- .single_post table th,- .single_post table td {- padding: 6px 13px;- border: 1px solid #d0d7de;- }-- .dark .single_post table th,- .dark .single_post table td {- border: 1px solid #21262d;- }-- .single_post table th {- font-weight: var(--base-text-weight-semibold, 600);- }-- td,- th {- padding: 0;- }-- .single_post hr {- height: .25em;- padding: 0;- margin: 24px 0;- background-color: #d0d7de;- border: 0;- }-- .dark .single_post hr {- background-color: #21262d;- }-- .single_post dl dt {- padding: 0;- margin-top: 16px;- font-size: 1em;- font-style: italic;- font-weight: var(--base-text-weight-semibold, 600);- }\ No newline at end of file+ font-size: 16px;+ line-height: 1.5;+ word-wrap: break-word;+}++.single_post::before {+ display: table;+ content: '';+}++.single_post > :first-child {+ margin-top: 0 !important;+}++.single_post p,+.single_post blockquote,+.single_post ul,+.single_post ol,+.single_post dl,+.single_post table,+.single_post pre,+.single_post details {+ margin-top: 0;+ margin-bottom: 16px;+}++.single_post b,+strong {+ font-weight: var(--base-text-weight-semibold, 600);+}++.light .single_post a {+ cursor: pointer;+ --tw-text-opacity: 1;+ color: rgb(79 70 229 / var(--tw-text-opacity));+}++.dark .single_post a {+ cursor: pointer;+ --tw-text-opacity: 1;+ color: rgb(129 140 248 / var(--tw-text-opacity));+}++.single_post blockquote {+ padding: 0 1em;+ color: rgb(101, 109, 118);+ border-left: 0.25em solid #d0d7de;+}++.single_post h1,+.single_post h2,+.single_post h3,+.single_post h4,+.single_post h5,+.single_post h6 {+ margin-top: 24px;+ margin-bottom: 16px;+ font-weight: var(--base-text-weight-semibold, 600);+ line-height: 1.25;+}++.single_post h1 {+ padding-bottom: 0.3em;+ font-size: 2em;+ border-bottom: 1px solid #d8dee4;+}++.dark .single_post h1 {+ border-bottom: 1px solid #21262d;+}++.single_post h2 {+ padding-bottom: 0.3em;+ font-size: 1.5em;+ border-bottom: 1px solid #d8dee4;+}++.dark .single_post h2 {+ border-bottom: 1px solid #21262d;+}++.single_post h3 {+ font-size: 1.25em;+}++.single_post h4 {+ font-size: 1em;+}++.single_post h5 {+ font-size: 0.875em;+}++.single_post .highlight pre,+.single_post pre {+ padding: 16px;+ overflow: auto;+ font-size: 85%;+ line-height: 1.45;+ color: #33363b;+ background-color: #f6f8fa;+ border-radius: 6px;+}++.dark .single_post .highlight pre,+.dark .single_post pre {+ color: #d0d7de;+ background-color: #21262d;+}++.single_post pre {+ word-wrap: normal;+}++.single_post ul,+.single_post ol {+ padding-left: 2em;+}++.single_post ul {+ list-style-type: disc;+}++.single_post ol {+ list-style-type: decimal;+}++.single_post table {+ display: block;+ width: 100%;+ width: max-content;+ max-width: 100%;+ overflow: auto;+}++.single_post table tr {+ background-color: #fff;+ border-top: 1px solid #d8dee4;+}++.dark .single_post table tr {+ background-color: #21262d;+ border-top: 1px solid #21262d;+}++.single_post table tr:nth-child(2n) {+ background-color: #f6f8fa;+}++.dark .single_post table tr:nth-child(2n) {+ background-color: #21262d;+}++.single_post table th,+.single_post table td {+ padding: 6px 13px;+ border: 1px solid #d0d7de;+}++.dark .single_post table th,+.dark .single_post table td {+ border: 1px solid #21262d;+}++.single_post table th {+ font-weight: var(--base-text-weight-semibold, 600);+}++td,+th {+ padding: 0;+}++.single_post hr {+ height: 0.25em;+ padding: 0;+ margin: 24px 0;+ background-color: #d0d7de;+ border: 0;+}++.dark .single_post hr {+ background-color: #21262d;+}++.single_post dl dt {+ padding: 0;+ margin-top: 16px;+ font-size: 1em;+ font-style: italic;+ font-weight: var(--base-text-weight-semibold, 600);+}diff --git a/app/entry.server.tsx b/app/entry.server.tsxindex 55db3ab86..8fe92c2b7 100644--- a/app/entry.server.tsx+++ b/app/entry.server.tsx@@ -49,20 +49,14 @@ export default async function handleRequest(},})- const callbackName = isbot(request.headers.get('user-agent'))- ? 'onAllReady'- : 'onShellReady'+ const callbackName = isbot(request.headers.get('user-agent')) ? 'onAllReady' : 'onShellReady'return new Promise((resolve, reject) => {let didError = falseconst { pipe, abort } = renderToPipeableStream(<I18nextProvider i18n={instance}>- <RemixServer- context={remixContext}- url={request.url}- abortDelay={ABORT_DELAY}- />+ <RemixServer context={remixContext} url={request.url} abortDelay={ABORT_DELAY} /></I18nextProvider>,{[callbackName]: () => {diff --git a/app/hoc/protected.tsx b/app/hoc/protected.tsxindex b7621a3de..25de6ce97 100644--- a/app/hoc/protected.tsx+++ b/app/hoc/protected.tsx@@ -30,13 +30,8 @@ export const withAuthentication = <P extends PropsType>(WrappedComponent: any, aconst accessToken = getAccessToken()const WithAuthentication = (props: P) => {- const {- shouldBeAuthenticated, redirectPath,- } = authParam- const {- authenticated: reduxAuthenticated,- loading,- } = useSelector((state: StateType) => state.auth)+ const { shouldBeAuthenticated, redirectPath } = authParam+ const { authenticated: reduxAuthenticated, loading } = useSelector((state: StateType) => state.auth)const navigate = useNavigate()const authenticated = loading ? !!accessToken : reduxAuthenticated@@ -44,8 +39,8 @@ export const withAuthentication = <P extends PropsType>(WrappedComponent: any, aif (shouldBeAuthenticated !== authenticated) {navigate(redirectPath)}- // TODO: Investigate this later. https://github.com/remix-run/react-router/discussions/8465- // eslint-disable-next-line react-hooks/exhaustive-deps+ // TODO: Investigate this later. https://github.com/remix-run/react-router/discussions/8465+ // eslint-disable-next-line react-hooks/exhaustive-deps}, [authenticated, shouldBeAuthenticated])// if (!selector) {diff --git a/app/hooks/usePagination.tsx b/app/hooks/usePagination.tsxindex 5e32a07a0..7230ef1f3 100644--- a/app/hooks/usePagination.tsx+++ b/app/hooks/usePagination.tsx@@ -29,10 +29,7 @@ export const usePagination = (}const leftSiblingIndex = Math.max(currentPage - siblingCount, 1)- const rightSiblingIndex = Math.min(- currentPage + siblingCount,- totalPageCount,- )+ const rightSiblingIndex = Math.min(currentPage + siblingCount, totalPageCount)/*We do not want to show dots if there is only one position left@@ -54,10 +51,7 @@ export const usePagination = (if (shouldShowLeftDots && !shouldShowRightDots) {const rightItemCount = 3 + 2 * siblingCount- const rightRange = range(- totalPageCount - rightItemCount + 1,- totalPageCount,- )+ const rightRange = range(totalPageCount - rightItemCount + 1, totalPageCount)return [firstPageIndex, DOTS, ...rightRange]}diff --git a/app/hooks/useSize.ts b/app/hooks/useSize.tsindex 98f201115..9645f777b 100644--- a/app/hooks/useSize.ts+++ b/app/hooks/useSize.ts@@ -4,7 +4,8 @@ import _get from 'lodash/get'export default () => {const [size, setSize] = useState({- width: 0, height: 0,+ width: 0,+ height: 0,})const ref = useRef(null)diff --git a/app/modals/Forecast.tsx b/app/modals/Forecast.tsxindex 5b3d7ab7c..7a1cb1f27 100644--- a/app/modals/Forecast.tsx+++ b/app/modals/Forecast.tsx@@ -11,16 +11,22 @@ import _toString from 'lodash/toString'const DEFAULT_PERIOD = '3'const Forecast = ({- onClose, onSubmit, isOpened, activeTB, tb,+ onClose,+ onSubmit,+ isOpened,+ activeTB,+ tb,}: {- onClose: () => void,- onSubmit: (period: string) => void,- isOpened: boolean,- activeTB: string,- tb: string,+ onClose: () => void+ onSubmit: (period: string) => void+ isOpened: boolean+ activeTB: string+ tb: string}): JSX.Element => {- const { t }: {- t: (key: string, options?: { [key: string]: string | number }) => string,+ const {+ t,+ }: {+ t: (key: string, options?: { [key: string]: string | number }) => string} = useTranslation('common')const [period, setPeriod] = useState<string>(DEFAULT_PERIOD)const [error, setError] = useState<string | null>(null)@@ -46,9 +52,11 @@ const Forecast = ({}if (processedPeriod > FORECAST_MAX_MAPPING[tb]) {- setError(t('apiNotifications.forecastNumberCantBeBigger', {- max: FORECAST_MAX_MAPPING[tb],- }))+ setError(+ t('apiNotifications.forecastNumberCantBeBigger', {+ max: FORECAST_MAX_MAPPING[tb],+ }),+ )return}@@ -67,7 +75,7 @@ const Forecast = ({onSubmit={_onSubmit}submitText={t('common.continue')}closeText={t('common.cancel')}- message={(+ message={<div>{t('modals.forecast.desc')}@@ -85,7 +93,7 @@ const Forecast = ({error={error}/></div>- )}+ }title={t('modals.forecast.title')}isOpened={isOpened}/>diff --git a/app/modals/NewFunnel.tsx b/app/modals/NewFunnel.tsxindex f2c3b86b0..ae11526c3 100644--- a/app/modals/NewFunnel.tsx+++ b/app/modals/NewFunnel.tsx@@ -15,20 +15,27 @@ import { IFunnel } from 'redux/models/IProject'import { IProjectForShared } from 'redux/models/ISharedProject'interface INewFunnel {- project: IProjectForShared,- onClose: () => void,- onSubmit: (name: string, steps: string[]) => Promise<void>,- isOpened: boolean,- pid: string,- loading: boolean,- funnel?: IFunnel,- projectPassword?: string,+ project: IProjectForShared+ onClose: () => void+ onSubmit: (name: string, steps: string[]) => Promise<void>+ isOpened: boolean+ pid: string+ loading: boolean+ funnel?: IFunnel+ projectPassword?: string}const INITIAL_FUNNEL_STEPS = [null, null]const NewFunnel = ({- onClose, onSubmit, isOpened, pid, funnel, loading, project, projectPassword,+ onClose,+ onSubmit,+ isOpened,+ pid,+ funnel,+ loading,+ project,+ projectPassword,}: INewFunnel): JSX.Element => {const { t } = useTranslation('common')const [name, setName] = useState<string>(funnel?.name || '')@@ -100,7 +107,7 @@ const NewFunnel = ({onClose={_onClose}onSubmit={_onSubmit}submitText={t('common.continue')}- message={(+ message={<div><Inputname='funnel-name-input'@@ -109,9 +116,7 @@ const NewFunnel = ({value={name}onChange={(e) => setName(e.target.value)}/>- <p className='mt-5 text-sm font-medium text-gray-700 dark:text-gray-200'>- {t('modals.funnels.steps')}- </p>+ <p className='mt-5 text-sm font-medium text-gray-700 dark:text-gray-200'>{t('modals.funnels.steps')}</p>{_map(steps, (step, index) => (<div key={index} className='flex items-center space-x-2 mt-1'><Combobox@@ -155,7 +160,7 @@ const NewFunnel = ({</p>)}</div>- )}+ }title={funnel ? t('modals.funnels.editTitle') : t('modals.funnels.addTitle')}isOpened={isOpened}submitDisabled={!name || !allStepsFulfilled}diff --git a/app/modals/PaidFeature.tsx b/app/modals/PaidFeature.tsxindex f7505cc21..a69a671ea 100644--- a/app/modals/PaidFeature.tsx+++ b/app/modals/PaidFeature.tsx@@ -6,12 +6,11 @@ import PropTypes from 'prop-types'import Modal from 'ui/Modal'import routes from 'routesPath'-const PaidFeature = ({ onClose, isOpened }: {- onClose: () => void,- isOpened: boolean,-}): JSX.Element => {- const { t }: {- t: (key: string, options?: { [key: string]: string | number }) => string,+const PaidFeature = ({ onClose, isOpened }: { onClose: () => void; isOpened: boolean }): JSX.Element => {+ const {+ t,+ }: {+ t: (key: string, options?: { [key: string]: string | number }) => string} = useTranslation('common')const navigate = useNavigate()diff --git a/app/pages/About/index.tsx b/app/pages/About/index.tsxindex 7b02536cc..97d8168a4 100644--- a/app/pages/About/index.tsx+++ b/app/pages/About/index.tsx@@ -8,7 +8,12 @@ const socialIcons: {[key: string]: JSX.Element} = {LinkedIn: (- <img className='h-6 w-6 opacity-75 hover:opacity-90 bg-white rounded' aria-hidden='true' src='/assets/linkedin.svg' alt='LinkedIn' />+ <img+ className='h-6 w-6 opacity-75 hover:opacity-90 bg-white rounded'+ aria-hidden='true'+ src='/assets/linkedin.svg'+ alt='LinkedIn'+ />),Github: (<svg className='h-6 w-6' fill='currentColor' viewBox='0 0 24 24'>@@ -31,7 +36,11 @@ const socialIcons: {}const Teammate = ({- photo, name, role, socials, desc,+ photo,+ name,+ role,+ socials,+ desc,}: {photo: stringname: string@@ -44,23 +53,25 @@ const Teammate = ({<div className='flex flex-col lg:flex-row mt-6'><img alt={name} src={photo} className='rounded-xl shadow-lg w-80' /><div className='ml-0 lg:ml-2'>- <p className='text-3xl mt-2 lg:mt-0 font-bold text-gray-900 dark:text-gray-50 tracking-tight'>- {name}- </p>- <p className='text-xl text-gray-900 dark:text-gray-50 tracking-tight'>- {role}- </p>+ <p className='text-3xl mt-2 lg:mt-0 font-bold text-gray-900 dark:text-gray-50 tracking-tight'>{name}</p>+ <p className='text-xl text-gray-900 dark:text-gray-50 tracking-tight'>{role}</p><div className='flex space-x-4 mt-2'>{_map(socials, (value, key) => (- <a key={value} href={value} title={key} target='_blank' rel='noopener noreferrer' className='text-gray-400 hover:text-gray-300' aria-label={`${key} (opens in a new tab)`}>+ <a+ key={value}+ href={value}+ title={key}+ target='_blank'+ rel='noopener noreferrer'+ className='text-gray-400 hover:text-gray-300'+ aria-label={`${key} (opens in a new tab)`}+ ><span className='sr-only'>{key}</span>{socialIcons[key]}</a>))}</div>- <p className='mt-2 lg:mt-5 text-lg whitespace-pre-line text-gray-900 dark:text-gray-50 tracking-tight'>- {desc}- </p>+ <p className='mt-2 lg:mt-5 text-lg whitespace-pre-line text-gray-900 dark:text-gray-50 tracking-tight'>{desc}</p></div></div>)@@ -129,24 +140,28 @@ const About = (): JSX.Element => (<div><div className='min-h-min-footer bg-gray-50 dark:bg-slate-900'><div className='max-w-prose md:max-w-none md:w-8/12 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'>- About us- </h1>+ <h1 className='text-4xl font-bold text-gray-900 dark:text-gray-50 tracking-tight'>About us</h1><p className='mt-2 text-lg text-gray-900 dark:text-gray-50 tracking-tight'>- Swetrix was launched in August 2021 as a project that focuses on user privacy and transparency, while at the same time offering the same functionality as competitors like Google Analytics.+ Swetrix was launched in August 2021 as a project that focuses on user privacy and transparency, while at the+ same time offering the same functionality as competitors like Google Analytics.<br />Swetrix is completely - <a href={GITHUB_URL} className='text-indigo-600 hover:text-indigo-500 dark:text-indigo-400 dark:hover:text-indigo-500' target='_blank' rel='noopener noreferrer' aria-label='Source code (opens in a new tab)'>+ <a+ href={GITHUB_URL}+ className='text-indigo-600 hover:text-indigo-500 dark:text-indigo-400 dark:hover:text-indigo-500'+ target='_blank'+ rel='noopener noreferrer'+ aria-label='Source code (opens in a new tab)'+ >open source</a>, we don't use cookies to track users so you can forget about cookie banners using our service.<br />- We will not and will never sell, abuse, share or otherwise negatively manipulate your data. Our priority is simplicity and transparency.+ We will not and will never sell, abuse, share or otherwise negatively manipulate your data. Our priority is+ simplicity and transparency.</p>- <h2 className='text-3xl mt-4 font-bold text-gray-900 dark:text-gray-50 tracking-tight'>- Meet our team- </h2>+ <h2 className='text-3xl mt-4 font-bold text-gray-900 dark:text-gray-50 tracking-tight'>Meet our team</h2>{_map(team, (el) => (<Teammate key={el.name} {...el} />@@ -155,7 +170,10 @@ const About = (): JSX.Element => (<hr className='mt-10 border-gray-200 dark:border-gray-600' /><p className='mt-2 text-lg text-gray-900 dark:text-gray-50 tracking-tight'>If you have read this far, why not - <a href={`mailto:${CONTACT_EMAIL}`} className='text-indigo-600 hover:text-indigo-500 dark:text-indigo-400 dark:hover:text-indigo-500'>+ <a+ href={`mailto:${CONTACT_EMAIL}`}+ className='text-indigo-600 hover:text-indigo-500 dark:text-indigo-400 dark:hover:text-indigo-500'+ >reach out to us?</a> We would be happy to hear feedback, criticism or suggestions from you!diff --git a/app/pages/Auth/CreateNewPassword/CreateNewPassword.container.tsx b/app/pages/Auth/CreateNewPassword/CreateNewPassword.container.tsxindex 6bec5f3f2..f52ada633 100644--- a/app/pages/Auth/CreateNewPassword/CreateNewPassword.container.tsx+++ b/app/pages/Auth/CreateNewPassword/CreateNewPassword.container.tsx@@ -6,14 +6,18 @@ import CreateNewPassword from './CreateNewPassword'const mapDispatchToProps = (dispatch: AppDispatch) => ({createNewPasswordFailed: (e: string) => {- dispatch(errorsActions.createNewPasswordFailed({- message: e,- }))+ dispatch(+ errorsActions.createNewPasswordFailed({+ message: e,+ }),+ )},newPassword: (message: string) => {- dispatch(alertsActions.newPassword({- message,- }))+ dispatch(+ alertsActions.newPassword({+ message,+ }),+ )},})diff --git a/app/pages/Auth/CreateNewPassword/CreateNewPassword.tsx b/app/pages/Auth/CreateNewPassword/CreateNewPassword.tsxindex 9f2dcfd4f..bbb2945cf 100644--- a/app/pages/Auth/CreateNewPassword/CreateNewPassword.tsx+++ b/app/pages/Auth/CreateNewPassword/CreateNewPassword.tsx@@ -13,18 +13,21 @@ import Button from 'ui/Button'import { isValidPassword, MIN_PASSWORD_CHARS, MAX_PASSWORD_CHARS } from 'utils/validator'interface FormSubmitData {- password: string,- repeat: string,+ password: string+ repeat: string}const CreateNewPassword = ({- createNewPasswordFailed, newPassword,+ createNewPasswordFailed,+ newPassword,}: {- createNewPasswordFailed: (e: string) => void,- newPassword: (message: string) => void,+ createNewPasswordFailed: (e: string) => void+ newPassword: (message: string) => void}): JSX.Element => {- const { t }: {- t: (key: string, options?: { [key: string]: string | number }) => string,+ const {+ t,+ }: {+ t: (key: string, options?: { [key: string]: string | number }) => string} = useTranslation('common')const navigate = useNavigate()const { id } = useParams()@@ -34,16 +37,16 @@ const CreateNewPassword = ({})const [validated, setValidated] = useState<boolean>(false)const [errors, setErrors] = useState<{- password?: string,- repeat?: string,+ password?: string+ repeat?: string}>({})const [beenSubmitted, setBeenSubmitted] = useState<boolean>(false)const [isLoading, setIsLoading] = useState<boolean>(false)const validate = () => {const allErrors = {} as {- password?: string,- repeat?: string,+ password?: string+ repeat?: string}if (!isValidPassword(form.password)) {@@ -85,12 +88,10 @@ const CreateNewPassword = ({}}- const handleInput = ({ target }: {- target: HTMLInputElement,- }) => {+ const handleInput = ({ target }: { target: HTMLInputElement }) => {const value = target.type === 'checkbox' ? target.checked : target.value- setForm(oldForm => ({+ setForm((oldForm) => ({...oldForm,[target.name]: value,}))@@ -148,7 +149,13 @@ const CreateNewPassword = ({i18nKey='auth.signup.alreadyAMember'components={{// eslint-disable-next-line jsx-a11y/anchor-has-content- url: <Link to={routes.signin} className='font-semibold leading-6 text-indigo-600 hover:text-indigo-500 dark:text-indigo-400 dark:hover:text-indigo-500' aria-label={t('footer.tos')} />,+ url: (+ <Link+ to={routes.signin}+ className='font-semibold leading-6 text-indigo-600 hover:text-indigo-500 dark:text-indigo-400 dark:hover:text-indigo-500'+ aria-label={t('footer.tos')}+ />+ ),}}/></p>diff --git a/app/pages/Auth/ForgotPassword/ForgotPassword.container.tsx b/app/pages/Auth/ForgotPassword/ForgotPassword.container.tsxindex 3f81d9023..895a0b1df 100644--- a/app/pages/Auth/ForgotPassword/ForgotPassword.container.tsx+++ b/app/pages/Auth/ForgotPassword/ForgotPassword.container.tsx@@ -6,14 +6,18 @@ import ForgotPassword from './ForgotPassword'const mapDispatchToProps = (dispatch: AppDispatch) => ({createNewPasswordFailed: (e: string) => {- dispatch(errorsActions.createNewPasswordFailed({- message: e,- }))+ dispatch(+ errorsActions.createNewPasswordFailed({+ message: e,+ }),+ )},newPassword: (message: string) => {- dispatch(alertsActions.newPassword({- message,- }))+ dispatch(+ alertsActions.newPassword({+ message,+ }),+ )},})diff --git a/app/pages/Auth/ForgotPassword/ForgotPassword.tsx b/app/pages/Auth/ForgotPassword/ForgotPassword.tsxindex 2ee973d96..c296d8e51 100644--- a/app/pages/Auth/ForgotPassword/ForgotPassword.tsx+++ b/app/pages/Auth/ForgotPassword/ForgotPassword.tsx@@ -13,30 +13,33 @@ import { TRIAL_DAYS } from 'redux/constants'import { isValidEmail } from 'utils/validator'const ForgotPassword = ({- createNewPasswordFailed, newPassword,+ createNewPasswordFailed,+ newPassword,}: {- createNewPasswordFailed: (e: string) => void,- newPassword: (message: string) => void,+ createNewPasswordFailed: (e: string) => void+ newPassword: (message: string) => void}): JSX.Element => {- const { t }: {- t: (key: string) => string,+ const {+ t,+ }: {+ t: (key: string) => string} = useTranslation('common')const navigate = useNavigate()const [form, setForm] = useState<{- email: string,+ email: string}>({email: '',})const [validated, setValidated] = useState<boolean>(false)const [errors, setErrors] = useState<{- email?: string,+ email?: string}>({})const [beenSubmitted, setBeenSubmitted] = useState<boolean>(false)const [isLoading, setIsLoading] = useState<boolean>(false)const validate = () => {const allErrors = {} as {- email?: string,+ email?: string}if (!isValidEmail(form.email)) {@@ -53,9 +56,7 @@ const ForgotPassword = ({validate()}, [form]) // eslint-disable-line- const onSubmit = async (data: {- email: string,- }) => {+ const onSubmit = async (data: { email: string }) => {if (!isLoading) {setIsLoading(true)@@ -72,12 +73,10 @@ const ForgotPassword = ({}}- const handleInput = ({ target }: {- target: HTMLInputElement,- }) => {+ const handleInput = ({ target }: { target: HTMLInputElement }) => {const value = target.type === 'checkbox' ? target.checked : target.value- setForm(oldForm => ({+ setForm((oldForm) => ({...oldForm,[target.name]: value,}))@@ -125,7 +124,13 @@ const ForgotPassword = ({i18nKey='auth.signin.notAMember'components={{// eslint-disable-next-line jsx-a11y/anchor-has-content- url: <Link to={routes.signup} className='font-semibold leading-6 text-indigo-600 hover:text-indigo-500 dark:text-indigo-400 dark:hover:text-indigo-500' aria-label={t('footer.tos')} />,+ url: (+ <Link+ to={routes.signup}+ className='font-semibold leading-6 text-indigo-600 hover:text-indigo-500 dark:text-indigo-400 dark:hover:text-indigo-500'+ aria-label={t('footer.tos')}+ />+ ),}}values={{amount: TRIAL_DAYS,diff --git a/app/pages/Auth/Signin/Signin.container.tsx b/app/pages/Auth/Signin/Signin.container.tsxindex 16034accf..1fbb9c8b0 100644--- a/app/pages/Auth/Signin/Signin.container.tsx+++ b/app/pages/Auth/Signin/Signin.container.tsx@@ -8,11 +8,14 @@ import { IUser } from 'redux/models/IUser'import Signin from './Signin'const mapDispatchToProps = (dispatch: AppDispatch) => ({- login: (data: {- email: string,- password: string,- dontRemember: boolean- }, callback: () => void) => {+ login: (+ data: {+ email: string+ password: string+ dontRemember: boolean+ },+ callback: () => void,+ ) => {dispatch(sagaActions.loginAsync(data, callback))},loginSuccess: (user: IUser) => {@@ -21,9 +24,11 @@ const mapDispatchToProps = (dispatch: AppDispatch) => ({dispatch(sagaActions.loadSharedProjects())},loginFailed: (error: string) => {- dispatch(errorsActions.loginFailed({- message: error,- }))+ dispatch(+ errorsActions.loginFailed({+ message: error,+ }),+ )},authSSO: (provider: string, dontRemember: boolean, t: (key: string) => string, callback: (res: any) => void) => {dispatch(sagaActions.authSSO(provider, dontRemember, t, callback))diff --git a/app/pages/Auth/Signin/Signin.tsx b/app/pages/Auth/Signin/Signin.tsxindex 60f377d3a..b588882e1 100644--- a/app/pages/Auth/Signin/Signin.tsx+++ b/app/pages/Auth/Signin/Signin.tsx@@ -13,9 +13,7 @@ import routes from 'routesPath'import Input from 'ui/Input'import Button from 'ui/Button'import Checkbox from 'ui/Checkbox'-import {- isValidEmail, isValidPassword, MIN_PASSWORD_CHARS,-} from 'utils/validator'+import { isValidEmail, isValidPassword, MIN_PASSWORD_CHARS } from 'utils/validator'import { isSelfhosted, TRIAL_DAYS } from 'redux/constants'import { IUser } from 'redux/models/IUser'import { submit2FA } from 'api'@@ -23,31 +21,36 @@ import { setAccessToken, removeAccessToken } from 'utils/accessToken'import { setRefreshToken, removeRefreshToken } from 'utils/refreshToken'interface ISigninForm {- email: string,- password: string,- dontRemember: boolean,+ email: string+ password: string+ dontRemember: boolean}interface ISignin {- login: (data: {- email: string,- password: string,- dontRemember: boolean- },- callback: (result: boolean, twoFARequired: boolean) => void) => void,- loginSuccess: (user: IUser) => void,- loginFailed: (error: string) => void,+ login: (+ data: {+ email: string+ password: string+ dontRemember: boolean+ },+ callback: (result: boolean, twoFARequired: boolean) => void,+ ) => void+ loginSuccess: (user: IUser) => void+ loginFailed: (error: string) => voidauthSSO: (provider: string, dontRemember: boolean, t: (key: string) => string, callback: (res: any) => void) => void- ssrTheme: string,+ ssrTheme: string}-const Signin = ({- login, loginSuccess, loginFailed, authSSO, ssrTheme,-}: ISignin): JSX.Element => {- const { t }: {- t: (key: string, optinions?: {- [key: string]: string | number,- }) => string,+const Signin = ({ login, loginSuccess, loginFailed, authSSO, ssrTheme }: ISignin): JSX.Element => {+ const {+ t,+ }: {+ t: (+ key: string,+ optinions?: {+ [key: string]: string | number+ },+ ) => string} = useTranslation('common')const [form, setForm] = useState<ISigninForm>({email: '',@@ -56,8 +59,8 @@ const Signin = ({})const [validated, setValidated] = useState<boolean>(false)const [errors, setErrors] = useState<{- email?: string,- password?: string,+ email?: string+ password?: string}>({})const [beenSubmitted, setBeenSubmitted] = useState<boolean>(false)const [isLoading, setIsLoading] = useState<boolean>(false)@@ -67,8 +70,8 @@ const Signin = ({const validate = () => {const allErrors = {} as {- email?: string,- password?: string,+ email?: string+ password?: string}if (!isValidEmail(form.email)) {@@ -90,7 +93,9 @@ const Signin = ({}, [form]) // eslint-disable-lineconst handle2FAInput = (event: React.ChangeEvent<HTMLInputElement>) => {- const { target: { value } } = event+ const {+ target: { value },+ } = eventsetTwoFACode(value)setTwoFACodeError(null)}@@ -136,12 +141,10 @@ const Signin = ({}}- const handleInput = ({ target }: {- target: HTMLInputElement,- }) => {+ const handleInput = ({ target }: { target: HTMLInputElement }) => {const value = target.type === 'checkbox' ? target.checked : target.value- setForm(oldForm => ({+ setForm((oldForm) => ({...oldForm,[target.name]: value,}))@@ -161,9 +164,7 @@ const Signin = ({return (<div className='min-h-page bg-gray-50 dark:bg-slate-900 flex flex-col py-6 px-4 sm:px-6 lg:px-8'><form className='max-w-prose mx-auto' onSubmit={_submit2FA}>- <h2 className='mt-2 text-3xl font-bold text-gray-900 dark:text-gray-50'>- {t('auth.signin.2fa')}- </h2>+ <h2 className='mt-2 text-3xl font-bold text-gray-900 dark:text-gray-50'>{t('auth.signin.2fa')}</h2><p className='mt-4 text-base whitespace-pre-line text-gray-900 dark:text-gray-50'>{t('auth.signin.2faDesc')}</p>@@ -186,7 +187,9 @@ const Signin = ({i18nKey='auth.signin.2faUnavailable'components={{// eslint-disable-next-line jsx-a11y/anchor-has-content- ctl: <Link to={routes.contact} className='underline hover:text-gray-900 dark:hover:text-gray-200' />,+ ctl: (+ <Link to={routes.contact} className='underline hover:text-gray-900 dark:hover:text-gray-200' />+ ),}}/>)}@@ -240,7 +243,10 @@ const Signin = ({label={t('auth.common.noRemember')}/><div className='text-sm leading-6'>- <Link to={routes.reset_password} className='font-semibold text-indigo-600 hover:text-indigo-500 dark:text-indigo-400 dark:hover:text-indigo-500'>+ <Link+ to={routes.reset_password}+ className='font-semibold text-indigo-600 hover:text-indigo-500 dark:text-indigo-400 dark:hover:text-indigo-500'+ >{t('auth.signin.forgot')}</Link></div>@@ -289,7 +295,13 @@ const Signin = ({i18nKey='auth.signin.notAMember'components={{// eslint-disable-next-line jsx-a11y/anchor-has-content- url: <Link to={routes.signup} className='font-semibold leading-6 text-indigo-600 hover:text-indigo-500 dark:text-indigo-400 dark:hover:text-indigo-500' aria-label={t('titles.signup')} />,+ url: (+ <Link+ to={routes.signup}+ className='font-semibold leading-6 text-indigo-600 hover:text-indigo-500 dark:text-indigo-400 dark:hover:text-indigo-500'+ aria-label={t('titles.signup')}+ />+ ),}}values={{amount: TRIAL_DAYS,diff --git a/app/pages/Auth/Signup/BasicSignup.tsx b/app/pages/Auth/Signup/BasicSignup.tsxindex 0ddf646d0..e81336265 100644--- a/app/pages/Auth/Signup/BasicSignup.tsx+++ b/app/pages/Auth/Signup/BasicSignup.tsx@@ -11,9 +11,7 @@ import Input from 'ui/Input'import Button from 'ui/Button'import Checkbox from 'ui/Checkbox'import Tooltip from 'ui/Tooltip'-import {- isValidEmail, isValidPassword, MIN_PASSWORD_CHARS, MAX_PASSWORD_CHARS,-} from 'utils/validator'+import { isValidEmail, isValidPassword, MIN_PASSWORD_CHARS, MAX_PASSWORD_CHARS } from 'utils/validator'import { HAVE_I_BEEN_PWNED_URL } from 'redux/constants'import { trackCustom } from 'utils/analytics'import { useAppDispatch } from 'redux/store'@@ -22,23 +20,28 @@ import GithubAuth from 'components/GithubAuth'import routes from 'routesPath'interface ISignUpForm {- email: string,- password: string,- repeat: string,- tos: boolean,- dontRemember: boolean,- checkIfLeaked: boolean,+ email: string+ password: string+ repeat: string+ tos: boolean+ dontRemember: boolean+ checkIfLeaked: boolean}interface IBasicSignup {- ssrTheme: string,+ ssrTheme: string}const BasicSignup: React.FC<IBasicSignup> = ({ ssrTheme }): JSX.Element => {- const { t }: {- t: (key: string, optinions?: {- [key: string]: string | number,- }) => string,+ const {+ t,+ }: {+ t: (+ key: string,+ optinions?: {+ [key: string]: string | number+ },+ ) => string} = useTranslation('common')const navigate = useNavigate()const dispatch = useAppDispatch()@@ -52,10 +55,10 @@ const BasicSignup: React.FC<IBasicSignup> = ({ ssrTheme }): JSX.Element => {})const [validated, setValidated] = useState<boolean>(false)const [errors, setErrors] = useState<{- email?: string,- password?: string,- repeat?: string,- tos?: string,+ email?: string+ password?: string+ repeat?: string+ tos?: string}>({})const [beenSubmitted, setBeenSubmitted] = useState<boolean>(false)const [isLoading, setIsLoading] = useState<boolean>(false)@@ -82,9 +85,9 @@ const BasicSignup: React.FC<IBasicSignup> = ({ ssrTheme }): JSX.Element => {const validate = () => {const allErrors = {} as {- email?: string,- password?: string,- repeat?: string,+ email?: string+ password?: string+ repeat?: string}if (!isValidEmail(form.email)) {@@ -117,7 +120,7 @@ const BasicSignup: React.FC<IBasicSignup> = ({ ssrTheme }): JSX.Element => {const { target } = eventconst value = target.type === 'checkbox' ? target.checked : target.value- setForm(oldForm => ({+ setForm((oldForm) => ({...oldForm,[target.name]: value,}))@@ -174,20 +177,27 @@ const BasicSignup: React.FC<IBasicSignup> = ({ ssrTheme }): JSX.Element => {/><TooltipclassName='ml-2'- text={(+ text={<Trans// @ts-ignoret={t}i18nKey='auth.common.checkLeakedPasswordDesc'components={{// eslint-disable-next-line jsx-a11y/anchor-has-content- db: <a href={HAVE_I_BEEN_PWNED_URL} className='font-medium text-indigo-400 hover:underline hover:text-indigo-500 dark:text-indigo-400 dark:hover:text-indigo-500' target='_blank' rel='noreferrer noopener' />,+ db: (+ <a+ href={HAVE_I_BEEN_PWNED_URL}+ className='font-medium text-indigo-400 hover:underline hover:text-indigo-500 dark:text-indigo-400 dark:hover:text-indigo-500'+ target='_blank'+ rel='noreferrer noopener'+ />+ ),}}values={{database: 'haveibeenpwned.com',}}/>- )}+ }/></div><Button className='w-full flex justify-center' type='submit' loading={isLoading} primary giant>diff --git a/app/pages/Auth/Signup/Signup.container.tsx b/app/pages/Auth/Signup/Signup.container.tsxindex 6eebdce45..eefb4286f 100644--- a/app/pages/Auth/Signup/Signup.container.tsx+++ b/app/pages/Auth/Signup/Signup.container.tsx@@ -4,15 +4,22 @@ import sagaActions from 'redux/sagas/actions'import Signup from './Signup'const mapDispatchToProps = (dispatch: AppDispatch) => ({- signup: (data: {- email: string,- password: string,- repeat: string,- dontRemember: boolean,- checkIfLeaked: boolean,- }, t: (key: string, optinions?: {- [key: string]: string | number,- }) => string, callback: (res: any) => void) => {+ signup: (+ data: {+ email: string+ password: string+ repeat: string+ dontRemember: boolean+ checkIfLeaked: boolean+ },+ t: (+ key: string,+ optinions?: {+ [key: string]: string | number+ },+ ) => string,+ callback: (res: any) => void,+ ) => {dispatch(sagaActions.signupAsync(data, t, callback))},authSSO: (provider: string, dontRemember: boolean, t: (key: string) => string, callback: (res: any) => void) => {diff --git a/app/pages/Auth/Signup/Signup.tsx b/app/pages/Auth/Signup/Signup.tsxindex e767d549c..5f494ae4e 100644--- a/app/pages/Auth/Signup/Signup.tsx+++ b/app/pages/Auth/Signup/Signup.tsx@@ -15,41 +15,50 @@ import Input from 'ui/Input'import Checkbox from 'ui/Checkbox'import Tooltip from 'ui/Tooltip'import Button from 'ui/Button'-import {- isValidEmail, isValidPassword, MIN_PASSWORD_CHARS, MAX_PASSWORD_CHARS,-} from 'utils/validator'+import { isValidEmail, isValidPassword, MIN_PASSWORD_CHARS, MAX_PASSWORD_CHARS } from 'utils/validator'import { HAVE_I_BEEN_PWNED_URL, TRIAL_DAYS } from 'redux/constants'import { trackCustom } from 'utils/analytics'interface ISignupForm {- email: string,- password: string,- repeat: string,- tos: boolean,- dontRemember: boolean,- checkIfLeaked: boolean,+ email: string+ password: string+ repeat: string+ tos: boolean+ dontRemember: boolean+ checkIfLeaked: boolean}interface ISignup {- signup: (data: {- email: string,- password: string,- repeat: string,- dontRemember: boolean,- checkIfLeaked: boolean,- },- t: (key: string, options?: {- [key: string]: string | number,- }) => string, callback: (res: any) => void) => void,+ signup: (+ data: {+ email: string+ password: string+ repeat: string+ dontRemember: boolean+ checkIfLeaked: boolean+ },+ t: (+ key: string,+ options?: {+ [key: string]: string | number+ },+ ) => string,+ callback: (res: any) => void,+ ) => voidauthSSO: (provider: string, dontRemember: boolean, t: (key: string) => string, callback: (res: any) => void) => void- ssrTheme: string,+ ssrTheme: string}const Signup = ({ signup, authSSO, ssrTheme }: ISignup): JSX.Element => {- const { t }: {- t: (key: string, options?: {- [key: string]: string | number,- }) => string,+ const {+ t,+ }: {+ t: (+ key: string,+ options?: {+ [key: string]: string | number+ },+ ) => string} = useTranslation('common')const [form, setForm] = useState<ISignupForm>({email: '',@@ -61,20 +70,20 @@ const Signup = ({ signup, authSSO, ssrTheme }: ISignup): JSX.Element => {})const [validated, setValidated] = useState<boolean>(false)const [errors, setErrors] = useState<{- email?: string,- password?: string,- repeat?: string,- tos?: string,+ email?: string+ password?: string+ repeat?: string+ tos?: string}>({})const [beenSubmitted, setBeenSubmitted] = useState<boolean>(false)const [isLoading, setIsLoading] = useState<boolean>(false)const validate = () => {const allErrors = {} as {- email?: string,- password?: string,- repeat?: string,- tos?: string,+ email?: string+ password?: string+ repeat?: string+ tos?: string}if (!isValidEmail(form.email)) {@@ -126,7 +135,7 @@ const Signup = ({ signup, authSSO, ssrTheme }: ISignup): JSX.Element => {const { target } = eventconst value = target.type === 'checkbox' ? target.checked : target.value- setForm(oldForm => ({+ setForm((oldForm) => ({...oldForm,[target.name]: value,}))@@ -152,9 +161,7 @@ const Signup = ({ signup, authSSO, ssrTheme }: ISignup): JSX.Element => {amount: TRIAL_DAYS,})}</h2>- <p className='text-center text-base text-gray-900 dark:text-gray-50'>- {t('auth.signup.noCC')}- </p>+ <p className='text-center text-base text-gray-900 dark:text-gray-50'>{t('auth.signup.noCC')}</p></div><div className='mt-10 sm:mx-auto sm:w-full sm:max-w-[480px]'><div className='bg-white dark:bg-slate-800/20 dark:ring-1 dark:ring-slate-800 px-6 py-12 shadow sm:rounded-lg sm:px-12'>@@ -192,7 +199,7 @@ const Signup = ({ signup, authSSO, ssrTheme }: ISignup): JSX.Element => {onChange={handleInput}name='tos'id='tos'- label={(+ label={<span><Trans// @ts-ignore@@ -200,13 +207,25 @@ const Signup = ({ signup, authSSO, ssrTheme }: ISignup): JSX.Element => {i18nKey='auth.signup.tos'components={{// eslint-disable-next-line jsx-a11y/anchor-has-content- tos: <Link to={routes.terms} className='font-medium text-gray-900 dark:text-gray-300 underline decoration-dashed hover:decoration-solid' aria-label={t('footer.tos')} />,+ tos: (+ <Link+ to={routes.terms}+ className='font-medium text-gray-900 dark:text-gray-300 underline decoration-dashed hover:decoration-solid'+ aria-label={t('footer.tos')}+ />+ ),// eslint-disable-next-line jsx-a11y/anchor-has-content- pp: <Link to={routes.privacy} className='font-medium text-gray-900 dark:text-gray-300 underline decoration-dashed hover:decoration-solid' aria-label={t('footer.pp')} />,+ pp: (+ <Link+ to={routes.privacy}+ className='font-medium text-gray-900 dark:text-gray-300 underline decoration-dashed hover:decoration-solid'+ aria-label={t('footer.pp')}+ />+ ),}}/></span>- )}+ }hintClassName='!text-red-600 dark:!text-red-500'hint={beenSubmitted ? errors.tos : ''}/>@@ -220,20 +239,27 @@ const Signup = ({ signup, authSSO, ssrTheme }: ISignup): JSX.Element => {/><TooltipclassName='ml-2'- text={(+ text={<Trans// @ts-ignoret={t}i18nKey='auth.common.checkLeakedPasswordDesc'components={{// eslint-disable-next-line jsx-a11y/anchor-has-content- db: <a href={HAVE_I_BEEN_PWNED_URL} className='font-medium text-indigo-400 hover:underline hover:text-indigo-500 dark:text-indigo-400 dark:hover:text-indigo-500' target='_blank' rel='noreferrer noopener' />,+ db: (+ <a+ href={HAVE_I_BEEN_PWNED_URL}+ className='font-medium text-indigo-400 hover:underline hover:text-indigo-500 dark:text-indigo-400 dark:hover:text-indigo-500'+ target='_blank'+ rel='noreferrer noopener'+ />+ ),}}values={{database: 'haveibeenpwned.com',}}/>- )}+ }/></div><Button className='w-full justify-center' type='submit' loading={isLoading} primary giant>@@ -277,7 +303,13 @@ const Signup = ({ signup, authSSO, ssrTheme }: ISignup): JSX.Element => {i18nKey='auth.signup.alreadyAMember'components={{// eslint-disable-next-line jsx-a11y/anchor-has-content- url: <Link to={routes.signin} className='font-semibold leading-6 text-indigo-600 hover:text-indigo-500 dark:text-indigo-400 dark:hover:text-indigo-500' aria-label={t('titles.signin')} />,+ url: (+ <Link+ to={routes.signin}+ className='font-semibold leading-6 text-indigo-600 hover:text-indigo-500 dark:text-indigo-400 dark:hover:text-indigo-500'+ aria-label={t('titles.signin')}+ />+ ),}}/></p>diff --git a/app/pages/Auth/Socialised/index.tsx b/app/pages/Auth/Socialised/index.tsxindex c173b125a..bd510cc25 100644--- a/app/pages/Auth/Socialised/index.tsx+++ b/app/pages/Auth/Socialised/index.tsx@@ -1,6 +1,4 @@-import React, {- useEffect, useState, memo,-} from 'react'+import React, { useEffect, useState, memo } from 'react'import { Link } from '@remix-run/react'import { useTranslation } from 'react-i18next'import { CheckCircleIcon, XCircleIcon } from '@heroicons/react/24/solid'@@ -13,10 +11,15 @@ import Loader from 'ui/Loader'import routes from 'routesPath'const Socialised = (): JSX.Element => {- const { t }: {- t: (key: string, optinions?: {- [key: string]: string | number,- }) => string,+ const {+ t,+ }: {+ t: (+ key: string,+ optinions?: {+ [key: string]: string | number+ },+ ) => string} = useTranslation('common')const [loading, setLoading] = useState<boolean>(true)const [isError, setIsError] = useState<boolean>(false)diff --git a/app/pages/Auth/VerifyEmail/index.tsx b/app/pages/Auth/VerifyEmail/index.tsxindex c88323172..036847279 100644--- a/app/pages/Auth/VerifyEmail/index.tsx+++ b/app/pages/Auth/VerifyEmail/index.tsx@@ -10,10 +10,15 @@ import Loader from 'ui/Loader'import routes from 'routesPath'const VerifyEmail = (): JSX.Element => {- const { t }: {- t: (key: string, optinions?: {- [key: string]: string | number,- }) => string,+ const {+ t,+ }: {+ t: (+ key: string,+ optinions?: {+ [key: string]: string | number+ },+ ) => string} = useTranslation('common')const dispatch = useDispatch()const { id } = useParams()diff --git a/app/pages/Billing/index.tsx b/app/pages/Billing/index.tsxindex 665cf7c1d..382cfccaa 100644--- a/app/pages/Billing/index.tsx+++ b/app/pages/Billing/index.tsx@@ -1,7 +1,5 @@/* eslint-disable jsx-a11y/anchor-has-content, lodash/prefer-lodash-method */-import React, {- memo, useMemo, useState, useEffect,-} from 'react'+import React, { memo, useMemo, useState, useEffect } from 'react'import { useTranslation, Trans } from 'react-i18next'import { useSelector, useDispatch } from 'react-redux'import dayjs from 'dayjs'@@ -11,7 +9,12 @@ import { ExclamationTriangleIcon, InformationCircleIcon } from '@heroicons/reactimport _round from 'lodash/round'import {- isSelfhosted, PADDLE_JS_URL, PADDLE_VENDOR_ID, CONTACT_EMAIL, paddleLanguageMapping, isBrowser,+ isSelfhosted,+ PADDLE_JS_URL,+ PADDLE_VENDOR_ID,+ CONTACT_EMAIL,+ paddleLanguageMapping,+ isBrowser,} from 'redux/constants'import { loadScript } from 'utils/generic'import Loader from 'ui/Loader'@@ -30,15 +33,19 @@ dayjs.extend(utc)dayjs.extend(duration)interface IBilling {- ssrAuthenticated: boolean,- ssrTheme: 'dark' | 'light',+ ssrAuthenticated: boolean+ ssrTheme: 'dark' | 'light'}const Billing: React.FC<IBilling> = ({ ssrAuthenticated, ssrTheme }): JSX.Element => {const [isCancelSubModalOpened, setIsCancelSubModalOpened] = useState<boolean>(false)const { metainfo, usageinfo } = useSelector((state: StateType) => state.ui.misc)- const { user, loading }: {- user: IUser, loading: boolean,+ const {+ user,+ loading,+ }: {+ user: IUser+ loading: boolean} = useSelector((state: StateType) => state.auth)const { theme: reduxTheme } = useSelector((state: StateType) => state.ui.theme)const theme = isBrowser ? reduxTheme : ssrTheme@@ -46,17 +53,30 @@ const Billing: React.FC<IBilling> = ({ ssrAuthenticated, ssrTheme }): JSX.Elemenconst reduxAuthenticated = useSelector((state: StateType) => state.auth.authenticated)const dispatch = useDispatch()const _dispatch = useAppDispatch()- const { t, i18n: { language } }: {- t: (key: string, optinions?: {- [key: string]: string | number,- }) => string,+ const {+ t,+ i18n: { language },+ }: {+ t: (+ key: string,+ optinions?: {+ [key: string]: string | number+ },+ ) => stringi18n: {- language: string,- },+ language: string+ }} = useTranslation('common')const authenticated = isBrowser ? reduxAuthenticated : ssrAuthenticatedconst {- nextBillDate, planCode, subUpdateURL, trialEndDate, timeFormat, cancellationEffectiveDate, subCancelURL, maxEventsCount,+ nextBillDate,+ planCode,+ subUpdateURL,+ trialEndDate,+ timeFormat,+ cancellationEffectiveDate,+ subCancelURL,+ maxEventsCount,} = userconst isSubscriber = user.planCode !== 'none' && user.planCode !== 'trial' && user.planCode !== 'free'@@ -78,6 +98,7 @@ const Billing: React.FC<IBilling> = ({ ssrAuthenticated, ssrTheme }): JSX.Elemen// eslint-disable-next-line no-use-before-defineconst interval = setInterval(paddleSetup, 200)+ // prettier-ignorefunction paddleSetup() {if (isSelfhosted) {clearInterval(interval)@@ -148,7 +169,8 @@ const Billing: React.FC<IBilling> = ({ ssrAuthenticated, ssrTheme }): JSX.Elemenmethod: 'inline',frameTarget: 'checkout-container',frameInitialHeight: 416,- frameStyle: 'width:100%; min-width:312px; background-color: #f9fafb; border: none; border-radius: 10px; margin-top: 10px;',+ frameStyle:+ 'width:100%; min-width:312px; background-color: #f9fafb; border: none; border-radius: 10px; margin-top: 10px;',locale: paddleLanguageMapping[language] || language,displayModeTheme: theme,country: metainfo.country,@@ -172,7 +194,8 @@ const Billing: React.FC<IBilling> = ({ ssrAuthenticated, ssrTheme }): JSX.Elemenmethod: 'inline',frameTarget: 'checkout-container',frameInitialHeight: 416,- frameStyle: 'width:100%; min-width:312px; background-color: #f9fafb; border: none; border-radius: 10px; margin-top: 10px;',+ frameStyle:+ 'width:100%; min-width:312px; background-color: #f9fafb; border: none; border-radius: 10px; margin-top: 10px;',locale: paddleLanguageMapping[language] || language,displayModeTheme: theme,country: metainfo.country,@@ -196,19 +219,16 @@ const Billing: React.FC<IBilling> = ({ ssrAuthenticated, ssrTheme }): JSX.Elemen{t('billing.subscription')}</h2><p className='mt-1 text-base text-gray-900 dark:text-gray-50 tracking-tight'>- {isSubscriber- ? t('billing.selectPlan')- : t('billing.changePlan')}- </p>- <p className='text-base text-gray-900 dark:text-gray-50 tracking-tight'>- {t('billing.membersNotification')}+ {isSubscriber ? t('billing.selectPlan') : t('billing.changePlan')}</p>+ <p className='text-base text-gray-900 dark:text-gray-50 tracking-tight'>{t('billing.membersNotification')}</p>{isSubscriber && nextBillDate && (<p className='mt-1 text-base text-gray-900 dark:text-gray-50 tracking-tight'>{t('billing.nextBillDateIs', {- date: language === 'en'- ? dayjs(nextBillDate).locale(language).format('MMMM D, YYYY')- : dayjs(nextBillDate).locale(language).format('D MMMM, YYYY'),+ date:+ language === 'en'+ ? dayjs(nextBillDate).locale(language).format('MMMM D, YYYY')+ : dayjs(nextBillDate).locale(language).format('D MMMM, YYYY'),})}</p>)}@@ -217,26 +237,23 @@ const Billing: React.FC<IBilling> = ({ ssrAuthenticated, ssrTheme }): JSX.Elemen<InformationCircleIcon className='h-10 w-10 mr-2 text-blue-600' aria-hidden='true' /><span className='font-medium max-w-prose'>{t('billing.cancelledSubMessage', {- date: language === 'en'- ? dayjs(cancellationEffectiveDate).locale(language).format('MMMM D, YYYY')- : dayjs(cancellationEffectiveDate).locale(language).format('D MMMM, YYYY'),+ date:+ language === 'en'+ ? dayjs(cancellationEffectiveDate).locale(language).format('MMMM D, YYYY')+ : dayjs(cancellationEffectiveDate).locale(language).format('D MMMM, YYYY'),})}</span></div>)}{isTrial && trialMessage && (<div className='text-lg text-gray-900 dark:text-gray-50 tracking-tight mt-3'>- <span className='font-medium'>- {trialMessage}- </span>+ <span className='font-medium'>{trialMessage}</span></div>)}{isNoSub && (<div className='flex items-center text-lg text-gray-900 dark:text-gray-50 tracking-tight mt-3'><ExclamationTriangleIcon className='h-10 w-10 mr-2 text-red-600' aria-hidden='true' />- <span className='font-medium max-w-prose'>- {t('billing.noSubWarning')}- </span>+ <span className='font-medium max-w-prose'>{t('billing.noSubWarning')}</span></div>)}{loading ? (@@ -273,7 +290,7 @@ const Billing: React.FC<IBilling> = ({ ssrAuthenticated, ssrTheme }): JSX.Elemen</p><Tooltip- text={(+ text={<div><p>{t('billing.usageOverview', {@@ -303,8 +320,8 @@ const Billing: React.FC<IBilling> = ({ ssrAuthenticated, ssrTheme }): JSX.Elemen</li></ul></div>- )}- tooltipNode={(+ }+ tooltipNode={<MultiProgresstheme={theme}className='max-w-[25rem] w-[85vw]'@@ -320,18 +337,16 @@ const Billing: React.FC<IBilling> = ({ ssrAuthenticated, ssrTheme }): JSX.ElemendarkColour: '#a21caf',},{- value: usageinfo.captcha === 0 ? 0 : (usageinfo.captcha/ maxEventsCount) * 100,+ value: usageinfo.captcha === 0 ? 0 : (usageinfo.captcha / maxEventsCount) * 100,lightColour: '#65a30d',darkColour: '#4d7c0f',},]}/>- )}+ }className='max-w-max !w-max !h-auto'/>- <p className='mt-1 text-base text-gray-900 dark:text-gray-50 tracking-tight'>- {t('billing.resetDate')}- </p>+ <p className='mt-1 text-base text-gray-900 dark:text-gray-50 tracking-tight'>{t('billing.resetDate')}</p></div></>)}@@ -349,7 +364,7 @@ const Billing: React.FC<IBilling> = ({ ssrAuthenticated, ssrTheme }): JSX.Elementitle={t('pricing.cancelTitle')}submitType='danger'type='error'- message={(+ message={<Trans// @ts-ignoret={t}@@ -358,7 +373,7 @@ const Billing: React.FC<IBilling> = ({ ssrAuthenticated, ssrTheme }): JSX.Elemenemail: CONTACT_EMAIL,}}/>- )}+ }isOpened={isCancelSubModalOpened}/></div>diff --git a/app/pages/Blog/Post.tsx b/app/pages/Blog/Post.tsxindex 0a035c285..ed244f14b 100644--- a/app/pages/Blog/Post.tsx+++ b/app/pages/Blog/Post.tsx@@ -6,9 +6,7 @@ export default function PostSlug() {const post = useLoaderData()if (!post) {- return (- <NotFound />- )+ return <NotFound />}return (@@ -57,11 +55,7 @@ export default function PostSlug() {<ul className='flex flex-wrap text-sm leading-6 -mt-6 -mx-5'><li className='flex items-center font-medium whitespace-nowrap px-5 mt-6'><div className='text-sm leading-4'>- {post?.author && (- <div className='text-slate-900 dark:text-slate-200'>- {post.author}- </div>- )}+ {post?.author && <div className='text-slate-900 dark:text-slate-200'>{post.author}</div>}{post?.nickname && (<div className='mt-1'><adiff --git a/app/pages/Captcha/Settings/CaptchaSettings.container.tsx b/app/pages/Captcha/Settings/CaptchaSettings.container.tsxindex 59e52deea..b31ed34e7 100644--- a/app/pages/Captcha/Settings/CaptchaSettings.container.tsx+++ b/app/pages/Captcha/Settings/CaptchaSettings.container.tsx@@ -16,31 +16,41 @@ const mapStateToProps = (state: StateType) => ({const mapDispatchToProps = (dispatch: AppDispatch) => ({updateProjectFailed: (message: string) => {- dispatch(errorsActions.updateProjectFailed({- message,- }))+ dispatch(+ errorsActions.updateProjectFailed({+ message,+ }),+ )},createNewProjectFailed: (message: string) => {- dispatch(errorsActions.createNewProjectFailed({- message,- }))+ dispatch(+ errorsActions.createNewProjectFailed({+ message,+ }),+ )},newProject: (message: string) => {- dispatch(alertsActions.generateAlerts({- message,- type: 'success',- }))+ dispatch(+ alertsActions.generateAlerts({+ message,+ type: 'success',+ }),+ )},projectDeleted: (message: string) => {- dispatch(alertsActions.generateAlerts({- message,- type: 'success',- }))+ dispatch(+ alertsActions.generateAlerts({+ message,+ type: 'success',+ }),+ )},deleteProjectFailed: (message: string) => {- dispatch(errorsActions.deleteProjectFailed({- message,- }))+ dispatch(+ errorsActions.deleteProjectFailed({+ message,+ }),+ )},loadProjects: () => {sagaActions.loadProjectsCaptcha()@@ -49,14 +59,18 @@ const mapDispatchToProps = (dispatch: AppDispatch) => ({dispatch(UIActions.removeCaptchaProject(pid))},deleteProjectCache: (pid: string, filters: any) => {- dispatch(UIActions.deleteCaptchaProjectCache({- pid,- }))+ dispatch(+ UIActions.deleteCaptchaProjectCache({+ pid,+ }),+ )},showError: (message: string) => {- dispatch(errorsActions.genericError({- message,- }))+ dispatch(+ errorsActions.genericError({+ message,+ }),+ )},})diff --git a/app/pages/Captcha/Settings/CaptchaSettings.tsx b/app/pages/Captcha/Settings/CaptchaSettings.tsxindex 6999ea9fa..61e9ec70d 100644--- a/app/pages/Captcha/Settings/CaptchaSettings.tsx+++ b/app/pages/Captcha/Settings/CaptchaSettings.tsx@@ -1,7 +1,5 @@/* eslint-disable react/forbid-prop-types */-import React, {- useState, useEffect, useMemo, memo, useRef,-} from 'react'+import React, { useState, useEffect, useMemo, memo, useRef } from 'react'import { useNavigate, useParams } from '@remix-run/react'import { useTranslation } from 'react-i18next'import cx from 'clsx'@@ -22,7 +20,13 @@ import { ExclamationTriangleIcon, TrashIcon, ClipboardDocumentIcon } from '@heroimport { withAuthentication, auth } from 'hoc/protected'import { isSelfhosted, TITLE_SUFFIX } from 'redux/constants'import {- createProject, updateProject, deleteCaptchaProject, resetCaptchaProject, reGenerateCaptchaSecretKey, getProjectsNames, createCaptchaInherited,+ createProject,+ updateProject,+ deleteCaptchaProject,+ resetCaptchaProject,+ reGenerateCaptchaSecretKey,+ getProjectsNames,+ createCaptchaInherited,} from 'api'import Input from 'ui/Input'import Loader from 'ui/Loader'@@ -39,13 +43,16 @@ const MAX_NAME_LENGTH = 50const MAX_ORIGINS_LENGTH = 300const MAX_IPBLACKLIST_LENGTH = 300-const tabForCreateCaptcha = [{- name: 'new',- label: 'project.captcha.settings.general',-}, {- name: 'inheritance',- label: 'project.captcha.settings.inheritance',-}]+const tabForCreateCaptcha = [+ {+ name: 'new',+ label: 'project.captcha.settings.general',+ },+ {+ name: 'inheritance',+ label: 'project.captcha.settings.inheritance',+ },+]const tabForNew = 'new'const tabForInheritance = 'inheritance'@@ -60,38 +67,60 @@ interface IForm extends Partial<ICaptchaProject> {}interface ICaptchaSettings {- updateProjectFailed: (error: string) => void,- createNewProjectFailed: (error: string) => void,- newProject: (message: string) => void,- projectDeleted: (message: string) => void,- deleteProjectFailed: (error: string) => void,- loadProjects: () => void,- isLoading: boolean,- projects: ICaptchaProject[],- showError: (error: string) => void,- removeProject: (pid: string) => void,- user: IUser,- deleteProjectCache: (pid: string) => void,- analyticsProjects: IProject[],- loading: boolean,- isSettings: boolean,+ updateProjectFailed: (error: string) => void+ createNewProjectFailed: (error: string) => void+ newProject: (message: string) => void+ projectDeleted: (message: string) => void+ deleteProjectFailed: (error: string) => void+ loadProjects: () => void+ isLoading: boolean+ projects: ICaptchaProject[]+ showError: (error: string) => void+ removeProject: (pid: string) => void+ user: IUser+ deleteProjectCache: (pid: string) => void+ analyticsProjects: IProject[]+ loading: boolean+ isSettings: boolean}const CaptchaSettings = ({- updateProjectFailed, createNewProjectFailed, newProject, projectDeleted, deleteProjectFailed,- loadProjects, isLoading, projects, showError, removeProject, user,- deleteProjectCache, analyticsProjects, loading, isSettings,+ updateProjectFailed,+ createNewProjectFailed,+ newProject,+ projectDeleted,+ deleteProjectFailed,+ loadProjects,+ isLoading,+ projects,+ showError,+ removeProject,+ user,+ deleteProjectCache,+ analyticsProjects,+ loading,+ isSettings,}: ICaptchaSettings): JSX.Element => {- const { t }: {- t: (key: string, options?: {- [key: string]: string | number | boolean | undefined- }) => string,+ const {+ t,+ }: {+ t: (+ key: string,+ options?: {+ [key: string]: string | number | boolean | undefined+ },+ ) => string} = useTranslation('common')// @ts-ignore- const { id }: {- id: string,+ const {+ id,+ }: {+ id: string} = useParams()- const project: ICaptchaProject | IProject = useMemo(() => _find([...projects, ...analyticsProjects], p => p.id === id) || {} as IProject | ICaptchaProject, [projects, analyticsProjects, id])+ const project: ICaptchaProject | IProject = useMemo(+ () => _find([...projects, ...analyticsProjects], (p) => p.id === id) || ({} as IProject | ICaptchaProject),+ [projects, analyticsProjects, id],+ )const navigate = useNavigate()const [form, setForm] = useState<IForm>({name: '',@@ -101,9 +130,9 @@ const CaptchaSettings = ({})const [validated, setValidated] = useState<boolean>(false)const [errors, setErrors] = useState<{- name?: string,- id?: string,- origins?: string,+ name?: string+ id?: string+ origins?: stringipBlacklist?: string}>({})const [beenSubmitted, setBeenSubmitted] = useState<boolean>(false)@@ -150,16 +179,18 @@ const CaptchaSettings = ({try {const formalisedData: IForm = {...data,- origins: _isEmpty(data.origins) ? null : _map(_split(data.origins as string, ','), (origin) => {- try {- if (_includes(origin, 'localhost')) {- return origin- }- return new URL(origin).host- } catch (e) {- return origin- }- }),+ origins: _isEmpty(data.origins)+ ? null+ : _map(_split(data.origins as string, ','), (origin) => {+ try {+ if (_includes(origin, 'localhost')) {+ return origin+ }+ return new URL(origin).host+ } catch (e) {+ return origin+ }+ }),ipBlacklist: _isEmpty(data.ipBlacklist) ? null : _split(data.ipBlacklist as string, ','),}if (isSettings) {@@ -232,8 +263,8 @@ const CaptchaSettings = ({const validate = () => {const allErrors = {} as {- name?: string,- origins?: string,+ name?: string+ origins?: stringipBlacklist?: string}@@ -266,7 +297,7 @@ const CaptchaSettings = ({const { target } = eventconst value = target.type === 'checkbox' ? target.checked : target.value- setForm(oldForm => ({+ setForm((oldForm) => ({...oldForm,[target.name]: value,}))@@ -278,13 +309,16 @@ const CaptchaSettings = ({setBeenSubmitted(true)if (tab === tabForInheritance) {- const data = _find(allProjectsNames || analyticsProjects, (item) => `${item.name} | ${item.id}` === reuseProjectId)+ const data = _find(+ allProjectsNames || analyticsProjects,+ (item) => `${item.name} | ${item.id}` === reuseProjectId,+ )if (_isEmpty(data)) {showError('Select project or select corect project')}- onSubmit({ ...data as IForm, isCaptcha: true })+ onSubmit({ ...(data as IForm), isCaptcha: true })return}@@ -330,7 +364,8 @@ const CaptchaSettings = ({await getProjectsNames().then((res) => {setAllProjectsNames(res)- }).catch((e) => {+ })+ .catch((e) => {console.log(e)})}@@ -357,30 +392,28 @@ const CaptchaSettings = ({})}><form className='max-w-7xl w-full mx-auto' onSubmit={handleSubmit}>- <h2 className='mt-2 text-3xl font-bold text-gray-900 dark:text-gray-50'>- {title}- </h2>- <h3 className='mt-2 text-lg font-bold text-gray-900 dark:text-gray-50'>- {t('profileSettings.general')}- </h3>+ <h2 className='mt-2 text-3xl font-bold text-gray-900 dark:text-gray-50'>{title}</h2>+ <h3 className='mt-2 text-lg font-bold text-gray-900 dark:text-gray-50'>{t('profileSettings.general')}</h3><div className='mt-6'>- {(!isSettings && _filter(allProjectsNames || analyticsProjects, (item) => !item?.isCaptchaProject).length > 0) && (- <nav className='-mb-px flex space-x-8'>- {_map(tabForCreateCaptcha, (tabCaptcha) => (- <button- key={tabCaptcha.name}- type='button'- onClick={() => setTab(tabCaptcha.name)}- className={cx('whitespace-nowrap pb-4 px-1 border-b-2 font-medium text-md', {- 'border-indigo-500 text-indigo-600 dark:text-indigo-500': tab === tabCaptcha.name,- 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300 dark:text-gray-400 dark:hover:text-gray-300 dark:hover:border-gray-300': tab !== tabCaptcha.name,- })}- >- {t(tabCaptcha.label)}- </button>- ))}- </nav>- )}+ {!isSettings &&+ _filter(allProjectsNames || analyticsProjects, (item) => !item?.isCaptchaProject).length > 0 && (+ <nav className='-mb-px flex space-x-8'>+ {_map(tabForCreateCaptcha, (tabCaptcha) => (+ <button+ key={tabCaptcha.name}+ type='button'+ onClick={() => setTab(tabCaptcha.name)}+ className={cx('whitespace-nowrap pb-4 px-1 border-b-2 font-medium text-md', {+ 'border-indigo-500 text-indigo-600 dark:text-indigo-500': tab === tabCaptcha.name,+ 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300 dark:text-gray-400 dark:hover:text-gray-300 dark:hover:border-gray-300':+ tab !== tabCaptcha.name,+ })}+ >+ {t(tabCaptcha.label)}+ </button>+ ))}+ </nav>+ )}</div>{tab === tabForNew && (<Input@@ -426,7 +459,7 @@ const CaptchaSettings = ({type='text'label={t('project.settings.origins')}hint={t('project.settings.originsHint')}- value={form.origins as string || ''}+ value={(form.origins as string) || ''}className='mt-4'onChange={handleInput}error={beenSubmitted ? errors.origins : null}@@ -437,7 +470,7 @@ const CaptchaSettings = ({type='text'label={t('project.settings.ipBlacklist')}hint={t('project.settings.ipBlacklistHint')}- value={form.ipBlacklist as string || ''}+ value={(form.ipBlacklist as string) || ''}className='mt-4'onChange={handleInput}error={beenSubmitted ? errors.ipBlacklist : null}@@ -489,9 +522,7 @@ const CaptchaSettings = ({</div></>) : (- <p className='max-w-prose text-base text-gray-900 dark:text-gray-50'>- {t('profileSettings.noApiKey')}- </p>+ <p className='max-w-prose text-base text-gray-900 dark:text-gray-50'>{t('profileSettings.noApiKey')}</p>)}{captchaSecretKey ? (<Button className='mt-4' onClick={() => setShowRegenerateSecret(true)} danger large>@@ -523,7 +554,12 @@ const CaptchaSettings = ({/><div className='flex flex-wrap justify-center gap-2 sm:justify-between mt-8'><div className='flex flex-wrap items-center justify-center gap-2'>- <Button className='border-indigo-100 dark:text-gray-50 dark:border-slate-700/50 dark:bg-slate-800 dark:hover:bg-slate-700' onClick={onCancel} secondary regular>+ <Button+ className='border-indigo-100 dark:text-gray-50 dark:border-slate-700/50 dark:bg-slate-800 dark:hover:bg-slate-700'+ onClick={onCancel}+ secondary+ regular+ >{t('common.cancel')}</Button><Button type='submit' loading={projectSaving} primary regular>@@ -531,13 +567,23 @@ const CaptchaSettings = ({</Button></div><div className='flex flex-wrap items-center justify-center gap-2'>- <Button onClick={() => !projectResetting && setShowReset(true)} loading={projectDeleting} semiDanger semiSmall>+ <Button+ onClick={() => !projectResetting && setShowReset(true)}+ loading={projectDeleting}+ semiDanger+ semiSmall+ ><><TrashIcon className='w-5 h-5 mr-1' />{t('project.settings.reset')}</></Button>- <Button onClick={() => !projectDeleting && setShowDelete(true)} loading={projectDeleting} danger semiSmall>+ <Button+ onClick={() => !projectDeleting && setShowDelete(true)}+ loading={projectDeleting}+ danger+ semiSmall+ ><><ExclamationTriangleIcon className='w-5 h-5 mr-1' />{t('project.settings.delete')}@@ -555,7 +601,12 @@ const CaptchaSettings = ({{!isSettings && (<div>- <Button className='mr-2 border-indigo-100 dark:text-gray-50 dark:border-slate-700/50 dark:bg-slate-800 dark:hover:bg-slate-700' onClick={onCancel} secondary regular>+ <Button+ className='mr-2 border-indigo-100 dark:text-gray-50 dark:border-slate-700/50 dark:bg-slate-800 dark:hover:bg-slate-700'+ onClick={onCancel}+ secondary+ regular+ >{t('common.cancel')}</Button><Button type='submit' loading={projectSaving} primary regular>diff --git a/app/pages/Captcha/View/Panels.tsx b/app/pages/Captcha/View/Panels.tsxindex 1e4bf3eaa..e41b19f2a 100644--- a/app/pages/Captcha/View/Panels.tsx+++ b/app/pages/Captcha/View/Panels.tsx@@ -1,9 +1,13 @@-import React, {- memo, useState, useEffect, useMemo, Fragment,-} from 'react'+import React, { memo, useState, useEffect, useMemo, Fragment } from 'react'import { ArrowSmallUpIcon, ArrowSmallDownIcon } from '@heroicons/react/24/solid'import {- FunnelIcon, MapIcon, Bars4Icon, ArrowsPointingOutIcon, ChartPieIcon, ArrowLongRightIcon, ArrowLongLeftIcon,+ FunnelIcon,+ MapIcon,+ Bars4Icon,+ ArrowsPointingOutIcon,+ ChartPieIcon,+ ArrowLongRightIcon,+ ArrowLongLeftIcon,} from '@heroicons/react/24/outline'import cx from 'clsx'import PropTypes from 'prop-types'@@ -44,22 +48,32 @@ const checkIfBarsNeeded = (panelID: string) => {// noSwitch - 'previous' and 'next' buttonsconst PanelContainer = ({- name, children, noSwitch, icon, type, openModal, activeFragment, setActiveFragment,+ name,+ children,+ noSwitch,+ icon,+ type,+ openModal,+ activeFragment,+ setActiveFragment,}: {- name: string,- children?: React.ReactNode,- noSwitch?: boolean,- icon?: React.ReactNode,- type: string,- openModal?: () => void,- activeFragment: number | string,- setActiveFragment: (arg: number) => void,+ name: string+ children?: React.ReactNode+ noSwitch?: boolean+ icon?: React.ReactNode+ type: string+ openModal?: () => void+ activeFragment: number | string+ setActiveFragment: (arg: number) => void}): JSX.Element => (<div- className={cx('relative bg-white dark:bg-slate-800/25 pt-5 px-4 min-h-72 sm:pt-6 sm:px-6 shadow rounded-lg overflow-hidden', {- 'pb-12': !noSwitch,- 'pb-5': noSwitch,- })}+ className={cx(+ 'relative bg-white dark:bg-slate-800/25 pt-5 px-4 min-h-72 sm:pt-6 sm:px-6 shadow rounded-lg overflow-hidden',+ {+ 'pb-12': !noSwitch,+ 'pb-5': noSwitch,+ },+ )}><div className='flex items-center justify-between mb-2'><h3 className='flex items-center text-lg leading-6 font-semibold text-gray-900 dark:text-gray-50'>@@ -72,7 +86,7 @@ const PanelContainer = ({{name}</h3><div className='flex'>- {(checkIfBarsNeeded(type)) && (+ {checkIfBarsNeeded(type) && (<Bars4IconclassName={cx(iconClassName, 'cursor-pointer', {'text-blue-500': activeFragment === 0,@@ -113,9 +127,7 @@ const PanelContainer = ({</div></div>{/* for other tabs */}- <div className='flex flex-col h-full scroll-auto overflow-auto'>- {children}- </div>+ <div className='flex flex-col h-full scroll-auto overflow-auto'>{children}</div></div>)@@ -133,13 +145,19 @@ PanelContainer.defaultProps = {icon: null,noSwitch: false,activeFragment: 0,- setActiveFragment: () => { },- openModal: () => { },+ setActiveFragment: () => {},+ openModal: () => {},}// First tab with statsconst Overview = ({- overall, chartData, activePeriod, t, live, sessionDurationAVG, projectId,+ overall,+ chartData,+ activePeriod,+ t,+ live,+ sessionDurationAVG,+ projectId,}: {overall: anychartData: any@@ -164,8 +182,7 @@ const Overview = ({<div className='flex text-lg justify-between'><div className='flex items-center dark:text-gray-50'><PulsatingCircle className='mr-1.5' type='big' />- {t('dashboard.liveVisitors')}- :+ {t('dashboard.liveVisitors')}:</div><LiveVisitorsDropdown projectId={projectId} live={live} /></div>@@ -180,59 +197,31 @@ const Overview = ({</p><div className='flex justify-between'>- <p className='text-lg dark:text-gray-50'>- {t('dashboard.pageviews')}- :- </p>- <p className='h-5 mr-2 text-gray-900 dark:text-gray-50 text-xl'>- {pageviews}- </p>+ <p className='text-lg dark:text-gray-50'>{t('dashboard.pageviews')}:</p>+ <p className='h-5 mr-2 text-gray-900 dark:text-gray-50 text-xl'>{pageviews}</p></div><div className='flex justify-between'>- <p className='text-lg dark:text-gray-50'>- {t('dashboard.unique')}- :- </p>- <p className='h-5 mr-2 text-gray-900 dark:text-gray-50 text-xl'>- {uniques}- </p>+ <p className='text-lg dark:text-gray-50'>{t('dashboard.unique')}:</p>+ <p className='h-5 mr-2 text-gray-900 dark:text-gray-50 text-xl'>{uniques}</p></div><div className='flex justify-between'>- <p className='text-lg dark:text-gray-50'>- {t('dashboard.bounceRate')}- :- </p>- <p className='h-5 mr-2 text-gray-900 dark:text-gray-50 text-xl'>- {bounceRate}- %- </p>+ <p className='text-lg dark:text-gray-50'>{t('dashboard.bounceRate')}:</p>+ <p className='h-5 mr-2 text-gray-900 dark:text-gray-50 text-xl'>{bounceRate}%</p></div><div className='flex justify-between'>- <p className='text-lg dark:text-gray-50'>- {t('dashboard.sessionDuration')}- :- </p>- <p className='h-5 mr-2 text-gray-900 dark:text-gray-50 text-xl'>- {sessionDurationAVG}- </p>+ <p className='text-lg dark:text-gray-50'>{t('dashboard.sessionDuration')}:</p>+ <p className='h-5 mr-2 text-gray-900 dark:text-gray-50 text-xl'>{sessionDurationAVG}</p></div><hr className='my-2 border-gray-200 dark:border-gray-600' /></>)}- <p className='text-lg font-semibold dark:text-gray-50'>- {t('project.weeklyStats')}- </p>+ <p className='text-lg font-semibold dark:text-gray-50'>{t('project.weeklyStats')}</p><div className='flex justify-between'>- <p className='text-lg dark:text-gray-50'>- {t('dashboard.pageviews')}- :- </p>+ <p className='text-lg dark:text-gray-50'>{t('dashboard.pageviews')}:</p><dd className='flex items-baseline'>- <p className='h-5 mr-2 text-gray-900 dark:text-gray-50 text-lg'>- {overall.thisWeek}- </p>+ <p className='h-5 mr-2 text-gray-900 dark:text-gray-50 text-lg'>{overall.thisWeek}</p><pclassName={cx('flex text-sm -ml-1 items-baseline', {'text-green-600': pageviewsDidGrowUp,@@ -242,32 +231,22 @@ const Overview = ({{pageviewsDidGrowUp ? (<><ArrowSmallUpIcon className='self-center flex-shrink-0 h-4 w-4 text-green-500' />- <span className='sr-only'>- {t('dashboard.inc')}- </span>+ <span className='sr-only'>{t('dashboard.inc')}</span></>) : (<><ArrowSmallDownIcon className='self-center flex-shrink-0 h-4 w-4 text-red-500' />- <span className='sr-only'>- {t('dashboard.dec')}- </span>+ <span className='sr-only'>{t('dashboard.dec')}</span></>)}- {overall.percChange}- %+ {overall.percChange}%</p></dd></div><div className='flex justify-between'>- <p className='text-lg dark:text-gray-50'>- {t('dashboard.unique')}- :- </p>+ <p className='text-lg dark:text-gray-50'>{t('dashboard.unique')}:</p><dd className='flex items-baseline'>- <p className='h-5 mr-2 text-gray-900 dark:text-gray-50 text-lg'>- {overall.thisWeekUnique}- </p>+ <p className='h-5 mr-2 text-gray-900 dark:text-gray-50 text-lg'>{overall.thisWeekUnique}</p><pclassName={cx('flex text-sm -ml-1 items-baseline', {'text-green-600': uniqueDidGrowUp,@@ -277,20 +256,15 @@ const Overview = ({{uniqueDidGrowUp ? (<><ArrowSmallUpIcon className='self-center flex-shrink-0 h-4 w-4 text-green-500' />- <span className='sr-only'>- {t('dashboard.inc')}- </span>+ <span className='sr-only'>{t('dashboard.inc')}</span></>) : (<><ArrowSmallDownIcon className='self-center flex-shrink-0 h-4 w-4 text-red-500' />- <span className='sr-only'>- {t('dashboard.dec')}- </span>+ <span className='sr-only'>{t('dashboard.dec')}</span></>)}- {overall.percChangeUnique}- %+ {overall.percChangeUnique}%</p></dd></div>@@ -342,7 +316,10 @@ const getPieOptions = (customs: any, uniques: number, t: any) => {// Tabs with custom events like submit form, press button, go to the link rate etc.const CustomEvents = ({- customs, chartData, onFilter, t,+ customs,+ chartData,+ onFilter,+ t,}: {customs: anychartData: any@@ -377,21 +354,21 @@ const CustomEvents = ({activeFragment={activeFragment}>{_isEmpty(chartData) ? (- <p className='mt-1 text-base text-gray-700 dark:text-gray-300'>- {t('project.noParamData')}- </p>+ <p className='mt-1 text-base text-gray-700 dark:text-gray-300'>{t('project.noParamData')}</p>) : (- <Chart- options={chartOptions}- current='panels-ce'- />+ <Chart options={chartOptions} current='panels-ce' />)}</PanelContainer>)}return (- <PanelContainer name={t('project.customEv')} type='ce' setActiveFragment={setActiveFragment} activeFragment={activeFragment}>+ <PanelContainer+ name={t('project.customEv')}+ type='ce'+ setActiveFragment={setActiveFragment}+ activeFragment={activeFragment}+ ><table className='table-fixed'><thead><tr className='text-gray-900 dark:text-gray-50'>@@ -418,10 +395,7 @@ const CustomEvents = ({{customs[ev]} </td>- <td className='text-right'>- {_round((customs[ev] / uniques) * 100, 2)}- %- </td>+ <td className='text-right'>{_round((customs[ev] / uniques) * 100, 2)}%</td></tr>))}</tbody>@@ -439,7 +413,16 @@ CustomEvents.propTypes = {}const Panel = ({- name, data, rowMapper, capitalize, linkContent, t, icon, id, hideFilters, onFilter,+ name,+ data,+ rowMapper,+ capitalize,+ linkContent,+ t,+ icon,+ id,+ hideFilters,+ onFilter,}: {name: stringdata: IEntry[]@@ -463,7 +446,7 @@ const Panel = ({const canGoPrev = () => page > 0const canGoNext = () => page < _floor((_size(entries) - 1) / ENTRIES_PER_PANEL)- const _onFilter = hideFilters ? () => { } : onFilter+ const _onFilter = hideFilters ? () => {} : onFilteruseEffect(() => {const sizeKeys = _size(entries)@@ -499,22 +482,12 @@ const Panel = ({setActiveFragment={setActiveFragment}openModal={() => setModal(true)}>- <InteractiveMap- data={data}- total={total}- onClickCountry={(key) => _onFilter(id, key)}- />+ <InteractiveMap data={data} total={total} onClickCountry={(key) => _onFilter(id, key)} /><ModalonClose={() => setModal(false)}closeText={t('common.close')}isOpened={modal}- message={(- <InteractiveMap- data={data}- total={total}- onClickCountry={(key) => _onFilter(id, key)}- />- )}+ message={<InteractiveMap data={data} total={total} onClickCountry={(key) => _onFilter(id, key)} />}size='large'/></PanelContainer>@@ -569,104 +542,97 @@ const Panel = ({activeFragment={activeFragment}>{_isEmpty(data) ? (- <p className='mt-1 text-base text-gray-700 dark:text-gray-300'>- {t('project.noParamData')}- </p>+ <p className='mt-1 text-base text-gray-700 dark:text-gray-300'>{t('project.noParamData')}</p>) : (- <Chart- options={options}- current={`Panels-${id}`}- />+ <Chart options={options} current={`Panels-${id}`} />)}</PanelContainer>)}return (- <PanelContainer name={name} icon={icon} type={id} activeFragment={activeFragment} setActiveFragment={setActiveFragment}>+ <PanelContainer+ name={name}+ icon={icon}+ type={id}+ activeFragment={activeFragment}+ setActiveFragment={setActiveFragment}+ >{_isEmpty(data) ? (- <p className='mt-1 text-base text-gray-700 dark:text-gray-300'>- {t('project.noParamData')}- </p>- ) : _map(entriesToDisplay, entry => {- const {- count, name: entryName,- } = entry- const perc = _round((count / total) * 100, 2)- const rowData = rowMapper(entry)- const valueData = count-- return (- <Fragment key={entryName}>- <div- className={cx('flex justify-between mt-[0.32rem] first:mt-0 dark:text-gray-50 rounded', {- 'group hover:bg-gray-100 hover:dark:bg-slate-800 cursor-pointer': !hideFilters,- })}- onClick={() => _onFilter(id, entryName)}- >- {linkContent ? (- <a- className={cx('flex items-center label hover:underline text-blue-600 dark:text-blue-500', { capitalize })}- href={rowData}- target='_blank'- rel='noopener noreferrer nofollow'- aria-label={`${rowData} (opens in a new tab)`}- >- {rowData}- {!hideFilters && (- <FunnelIcon className='ml-2 w-4 h-4 text-gray-500 hidden group-hover:block dark:text-gray-300' />- )}- </a>- ) : (- <span className={cx('flex items-center label', { capitalize })}>- {rowData}- {!hideFilters && (- <FunnelIcon className='ml-2 w-4 h-4 text-gray-500 hidden group-hover:block dark:text-gray-300' />- )}- </span>- )}- <span className='ml-3 dark:text-gray-50'>- {valueData}- - <span className='text-gray-500 dark:text-gray-200 font-light'>- (- {perc}- %)+ <p className='mt-1 text-base text-gray-700 dark:text-gray-300'>{t('project.noParamData')}</p>+ ) : (+ _map(entriesToDisplay, (entry) => {+ const { count, name: entryName } = entry+ const perc = _round((count / total) * 100, 2)+ const rowData = rowMapper(entry)+ const valueData = count++ return (+ <Fragment key={entryName}>+ <div+ className={cx('flex justify-between mt-[0.32rem] first:mt-0 dark:text-gray-50 rounded', {+ 'group hover:bg-gray-100 hover:dark:bg-slate-800 cursor-pointer': !hideFilters,+ })}+ onClick={() => _onFilter(id, entryName)}+ >+ {linkContent ? (+ <a+ className={cx('flex items-center label hover:underline text-blue-600 dark:text-blue-500', {+ capitalize,+ })}+ href={rowData}+ target='_blank'+ rel='noopener noreferrer nofollow'+ aria-label={`${rowData} (opens in a new tab)`}+ >+ {rowData}+ {!hideFilters && (+ <FunnelIcon className='ml-2 w-4 h-4 text-gray-500 hidden group-hover:block dark:text-gray-300' />+ )}+ </a>+ ) : (+ <span className={cx('flex items-center label', { capitalize })}>+ {rowData}+ {!hideFilters && (+ <FunnelIcon className='ml-2 w-4 h-4 text-gray-500 hidden group-hover:block dark:text-gray-300' />+ )}+ </span>+ )}+ <span className='ml-3 dark:text-gray-50'>+ {valueData}+ + <span className='text-gray-500 dark:text-gray-200 font-light'>+ ({perc}+ %)+ </span></span>- </span>- </div>- <Progress now={perc} />- </Fragment>- )- })}+ </div>+ <Progress now={perc} />+ </Fragment>+ )+ })+ )}{/* for pagination in tabs */}{_size(entries) > ENTRIES_PER_PANEL && (<div className='absolute bottom-0 w-card-toggle-sm sm:!w-card-toggle'><div className='flex justify-between select-none mb-2'><div><span className='text-gray-500 dark:text-gray-200 font-light lowercase text-xs'>- {_size(entries)}- {' '}- {t('project.results')}+ {_size(entries)} {t('project.results')}</span><span className='text-gray-500 dark:text-gray-200 font-light text-xs'>- .- {' '}- {t('project.page')}- {' '}- {page + 1}- {' '}- /- {' '}- {totalPages}+ . {t('project.page')} {page + 1} / {totalPages}</span></div><div className='flex justify-between w-[4.5rem]'><Button- className={cx('text-gray-500 dark:text-gray-200 font-light shadow bg-gray-100 dark:bg-slate-800 border-none px-1.5 py-0.5', {- 'opacity-50 cursor-not-allowed': !canGoPrev(),- 'hover:bg-gray-200 hover:dark:bg-slate-700': canGoPrev(),- })}+ className={cx(+ 'text-gray-500 dark:text-gray-200 font-light shadow bg-gray-100 dark:bg-slate-800 border-none px-1.5 py-0.5',+ {+ 'opacity-50 cursor-not-allowed': !canGoPrev(),+ 'hover:bg-gray-200 hover:dark:bg-slate-700': canGoPrev(),+ },+ )}type='button'onClick={onPrevious}disabled={!canGoPrev()}@@ -675,10 +641,13 @@ const Panel = ({<ArrowLongLeftIcon className='w-5 h-5' /></Button><Button- className={cx('text-gray-500 dark:text-gray-200 font-light shadow bg-gray-100 dark:bg-slate-800 border-none px-1.5 py-0.5', {- 'opacity-50 cursor-not-allowed': !canGoNext(),- 'hover:bg-gray-200 hover:dark:bg-slate-700': canGoNext(),- })}+ className={cx(+ 'text-gray-500 dark:text-gray-200 font-light shadow bg-gray-100 dark:bg-slate-800 border-none px-1.5 py-0.5',+ {+ 'opacity-50 cursor-not-allowed': !canGoNext(),+ 'hover:bg-gray-200 hover:dark:bg-slate-700': canGoNext(),+ },+ )}onClick={onNext}disabled={!canGoNext()}type='button'@@ -711,7 +680,7 @@ Panel.defaultProps = {rowMapper: (row: IEntry): string => row.name,capitalize: false,linkContent: false,- onFilter: () => { },+ onFilter: () => {},hideFilters: false,icon: null,}@@ -720,8 +689,4 @@ const PanelMemo = memo(Panel)const OverviewMemo = memo(Overview)const CustomEventsMemo = memo(CustomEvents)-export {- PanelMemo as Panel,- OverviewMemo as Overview,- CustomEventsMemo as CustomEvents,-}+export { PanelMemo as Panel, OverviewMemo as Overview, CustomEventsMemo as CustomEvents }diff --git a/app/pages/Captcha/View/ViewCaptcha.container.tsx b/app/pages/Captcha/View/ViewCaptcha.container.tsxindex 390c2bd59..8ef7dfb02 100644--- a/app/pages/Captcha/View/ViewCaptcha.container.tsx+++ b/app/pages/Captcha/View/ViewCaptcha.container.tsx@@ -19,27 +19,33 @@ const mapStateToProps = (state: StateType) => ({const mapDispatchToProps = (dispatch: AppDispatch) => ({showError: (message: string) => {- dispatch(errorsActions.genericError({- message,- }))+ dispatch(+ errorsActions.genericError({+ message,+ }),+ )},setProjectCache: (pid: string, data: any, key: string) => {- dispatch(UIActions.setCaptchaProjectCache({- pid,- data,- key,- }))+ dispatch(+ UIActions.setCaptchaProjectCache({+ pid,+ data,+ key,+ }),+ )},setProjects: (project: ICaptchaProject[]) => {dispatch(UIActions.setCaptchaProjects(project))},setProjectViewPrefs: (pid: string, period: string, timeBucket: string, rangeDate?: Date[] | null) => {- dispatch(UIActions.setCaptchaProjectViewPrefs({- pid,- period,- timeBucket,- rangeDate,- }))+ dispatch(+ UIActions.setCaptchaProjectViewPrefs({+ pid,+ period,+ timeBucket,+ rangeDate,+ }),+ )},})diff --git a/app/pages/Captcha/View/ViewCaptcha.helpers.tsx b/app/pages/Captcha/View/ViewCaptcha.helpers.tsxindex b95ceef24..6fc4f04b5 100644--- a/app/pages/Captcha/View/ViewCaptcha.helpers.tsx+++ b/app/pages/Captcha/View/ViewCaptcha.helpers.tsx@@ -2,13 +2,16 @@ import React from 'react'// @ts-ignoreimport { saveAs } from 'file-saver'import {- GlobeEuropeAfricaIcon, LanguageIcon, DocumentTextIcon, DeviceTabletIcon,- ArrowRightCircleIcon, MagnifyingGlassIcon, ServerIcon,+ GlobeEuropeAfricaIcon,+ LanguageIcon,+ DocumentTextIcon,+ DeviceTabletIcon,+ ArrowRightCircleIcon,+ MagnifyingGlassIcon,+ ServerIcon,} from '@heroicons/react/24/outline'import dayjs from 'dayjs'-import {- area, bar,-} from 'billboard.js'+import { area, bar } from 'billboard.js'import _forEach from 'lodash/forEach'import _map from 'lodash/map'import _split from 'lodash/split'@@ -20,7 +23,12 @@ import _round from 'lodash/round'import JSZip from 'jszip'import {- TimeFormat, chartTypes, tbsFormatMapper, tbsFormatMapper24h, tbsFormatMapperTooltip, tbsFormatMapperTooltip24h,+ TimeFormat,+ chartTypes,+ tbsFormatMapper,+ tbsFormatMapper24h,+ tbsFormatMapperTooltip,+ tbsFormatMapperTooltip24h,} from 'redux/constants'import countries from 'utils/isoCountries'// @ts-ignore@@ -50,12 +58,17 @@ const convertToCSV = (array: any[]) => {return str}-const onCSVExportClick = (data: {- data: any,- types: any,-}, pid: string, tnMapping: {- [key: string]: string,-}, language: string) => {+const onCSVExportClick = (+ data: {+ data: any+ types: any+ },+ pid: string,+ tnMapping: {+ [key: string]: string+ },+ language: string,+) => {const { data: rowData, types } = dataconst zip = new JSZip()@@ -72,7 +85,7 @@ const onCSVExportClick = (data: {})const csvData = _map(rowKeys, (e) => {- const perc = _round(((rowData[item][e] / total) * 100) || 0, 2)+ const perc = _round((rowData[item][e] / total) * 100 || 0, 2)if (item === 'cc') {const name = countries.getName(e, language)@@ -95,19 +108,18 @@ const CHART_METRICS_MAPPING = {}// function to filter the data for the chart-const getColumns = (chart: {- x: string[],- results: string[],-}, activeChartMetrics: {- [key: string]: boolean,-}) => {- const {- results,- } = activeChartMetrics-- const columns = [- ['x', ..._map(chart.x, el => dayjs(el).toDate())],- ]+const getColumns = (+ chart: {+ x: string[]+ results: string[]+ },+ activeChartMetrics: {+ [key: string]: boolean+ },+) => {+ const { results } = activeChartMetrics++ const columns = [['x', ..._map(chart.x, (el) => dayjs(el).toDate())]]if (results) {columns.push(['results', ...chart.results])@@ -120,9 +132,17 @@ const getColumns = (chart: {const noRegionPeriods = ['custom', 'yesterday']// function to get the settings and data for the chart(main diagram)-const getSettings = (chart: any, timeBucket: string, activeChartMetrics: {- [key: string]: boolean,-}, applyRegions: boolean, timeFormat: string, rotateXAxias: boolean, chartType: string) => {+const getSettings = (+ chart: any,+ timeBucket: string,+ activeChartMetrics: {+ [key: string]: boolean+ },+ applyRegions: boolean,+ timeFormat: string,+ rotateXAxias: boolean,+ chartType: string,+) => {const xAxisSize = _size(chart.x)let regions@@ -150,9 +170,12 @@ const getSettings = (chart: any, timeBucket: string, activeChartMetrics: {return {data: {x: 'x',- columns: getColumns({- ...chart,- }, activeChartMetrics),+ columns: getColumns(+ {+ ...chart,+ },+ activeChartMetrics,+ ),types: {results: chartType === chartTypes.line ? area() : bar(),},@@ -174,7 +197,10 @@ const getSettings = (chart: any, timeBucket: string, activeChartMetrics: {tick: {fit: true,rotate: rotateXAxias ? 45 : 0,- format: timeFormat === TimeFormat['24-hour'] ? (x: string) => d3.timeFormat(tbsFormatMapper24h[timeBucket])(x) : (x: string) => d3.timeFormat(tbsFormatMapper[timeBucket])(x),+ format:+ timeFormat === TimeFormat['24-hour']+ ? (x: string) => d3.timeFormat(tbsFormatMapper24h[timeBucket])(x)+ : (x: string) => d3.timeFormat(tbsFormatMapper[timeBucket])(x),},localtime: timeFormat === TimeFormat['24-hour'],type: 'timeseries',@@ -190,17 +216,14 @@ const getSettings = (chart: any, timeBucket: string, activeChartMetrics: {tooltip: {contents: (item: any, _: any, __: any, color: any) => {return `<ul class='bg-gray-100 dark:text-gray-50 dark:bg-slate-800 rounded-md shadow-md px-3 py-1'>- <li class='font-semibold'>${timeFormat === TimeFormat['24-hour'] ? d3.timeFormat(tbsFormatMapperTooltip24h[timeBucket])(item[0].x) : d3.timeFormat(tbsFormatMapperTooltip[timeBucket])(item[0].x)}</li>+ <li class='font-semibold'>${+ timeFormat === TimeFormat['24-hour']+ ? d3.timeFormat(tbsFormatMapperTooltip24h[timeBucket])(item[0].x)+ : d3.timeFormat(tbsFormatMapperTooltip[timeBucket])(item[0].x)+ }</li><hr class='border-gray-200 dark:border-gray-600' />- ${_map(item, (el: {- id: string,- index: number,- name: string,- value: string,- x: Date,- }) => {-- return `+ ${_map(item, (el: { id: string; index: number; name: string; value: string; x: Date }) => {+ return `<li class='flex justify-between'><div class='flex justify-items-start'><div class='w-3 h-3 rounded-sm mt-1.5 mr-2' style=background-color:${color(el.id)}></div>@@ -209,16 +232,14 @@ const getSettings = (chart: any, timeBucket: string, activeChartMetrics: {<span class='pl-4'>${el.value}</span></li>`- }).join('')}`+ }).join('')}`},},point: {focus: {only: xAxisSize > 1,},- pattern: [- 'circle',- ],+ pattern: ['circle'],r: 3,},legend: {@@ -280,7 +301,17 @@ const getFormatDate = (date: Date) => {}export {- iconClassName, getFormatDate, panelIconMapping, typeNameMapping, validFilters,- validPeriods, validTimeBacket, noRegionPeriods, getSettings,- getExportFilename, getColumns, onCSVExportClick, CHART_METRICS_MAPPING,+ iconClassName,+ getFormatDate,+ panelIconMapping,+ typeNameMapping,+ validFilters,+ validPeriods,+ validTimeBacket,+ noRegionPeriods,+ getSettings,+ getExportFilename,+ getColumns,+ onCSVExportClick,+ CHART_METRICS_MAPPING,}diff --git a/app/pages/Captcha/View/ViewCaptcha.tsx b/app/pages/Captcha/View/ViewCaptcha.tsxindex 91b1aad0a..1e8bb4c93 100644--- a/app/pages/Captcha/View/ViewCaptcha.tsx+++ b/app/pages/Captcha/View/ViewCaptcha.tsx@@ -1,7 +1,5 @@/* eslint-disable react/forbid-prop-types, react/no-unstable-nested-components, react/display-name */-import React, {- useState, useEffect, useMemo, memo, useRef,-} from 'react'+import React, { useState, useEffect, useMemo, memo, useRef } from 'react'import useSize from 'hooks/useSize'import { useNavigate, useParams } from '@remix-run/react'// @ts-ignore@@ -9,9 +7,7 @@ import domToImage from 'dom-to-image'// @ts-ignoreimport { saveAs } from 'file-saver'import bb from 'billboard.js'-import {- ArrowDownTrayIcon, Cog8ToothIcon, ArrowPathIcon,-} from '@heroicons/react/24/outline'+import { ArrowDownTrayIcon, Cog8ToothIcon, ArrowPathIcon } from '@heroicons/react/24/outline'import cx from 'clsx'import dayjs from 'dayjs'import { useTranslation } from 'react-i18next'@@ -33,8 +29,16 @@ import BarChart from 'ui/icons/BarChart'import { getItem, setItem } from 'utils/localstorage'import EventsRunningOutBanner from 'components/EventsRunningOutBanner'import {- captchaTbPeriodPairs, getProjectCaptchaCacheKey, timeBucketToDays, getProjectCacheCustomKey, roleAdmin,- MAX_MONTHS_IN_PAST, TimeFormat, chartTypes, TITLE_SUFFIX, KEY_FOR_ALL_TIME,+ captchaTbPeriodPairs,+ getProjectCaptchaCacheKey,+ timeBucketToDays,+ getProjectCacheCustomKey,+ roleAdmin,+ MAX_MONTHS_IN_PAST,+ TimeFormat,+ chartTypes,+ TITLE_SUFFIX,+ KEY_FOR_ALL_TIME,} from 'redux/constants'import { ICaptchaProject, IProject, ILiveStats } from 'redux/models/IProject'import { IUser } from 'redux/models/IUser'@@ -43,15 +47,20 @@ import Dropdown from 'ui/Dropdown'import Checkbox from 'ui/Checkbox'import FlatPicker from 'ui/Flatpicker'import routes from 'routesPath'+import { getProject, getCaptchaData } from 'api'+import { Panel, CustomEvents } from './Panels'import {- getProject, getCaptchaData,-} from 'api'-import {- Panel, CustomEvents,-} from './Panels'-import {- onCSVExportClick, getFormatDate, panelIconMapping, typeNameMapping, validFilters, validPeriods,- validTimeBacket, noRegionPeriods, getSettings, CHART_METRICS_MAPPING, getColumns,+ onCSVExportClick,+ getFormatDate,+ panelIconMapping,+ typeNameMapping,+ validFilters,+ validPeriods,+ validTimeBacket,+ noRegionPeriods,+ getSettings,+ CHART_METRICS_MAPPING,+ getColumns,} from './ViewCaptcha.helpers'import TBPeriodSelector from 'pages/Project/View/components/TBPeriodSelector'import CCRow from '../../Project/View/components/CCRow'@@ -60,56 +69,85 @@ import NoEvents from './components/NoEvents'import Filters from './components/Filters'const ViewProject = ({- projects, isLoading: _isLoading, showError, cache, setProjectCache, projectViewPrefs, setProjectViewPrefs, authenticated, user, setProjects, liveStats,+ projects,+ isLoading: _isLoading,+ showError,+ cache,+ setProjectCache,+ projectViewPrefs,+ setProjectViewPrefs,+ authenticated,+ user,+ setProjects,+ liveStats,}: {- projects: ICaptchaProject[],- isLoading: boolean,- showError: (message: string) => void,- cache: any,- setProjectCache: (pid: string, data: any, key: string) => void,- projectViewPrefs: any,- setProjectViewPrefs: (pid: string, period: string, timeBucket: string, rangeDate?: Date[] | null) => void,- authenticated: boolean,- user: IUser,+ projects: ICaptchaProject[]+ isLoading: boolean+ showError: (message: string) => void+ cache: any+ setProjectCache: (pid: string, data: any, key: string) => void+ projectViewPrefs: any+ setProjectViewPrefs: (pid: string, period: string, timeBucket: string, rangeDate?: Date[] | null) => void+ authenticated: boolean+ user: IUser// eslint-disable-next-line no-unused-vars, no-shadow- setProjects: (projects: ICaptchaProject[]) => void,- liveStats: ILiveStats,+ setProjects: (projects: ICaptchaProject[]) => void+ liveStats: ILiveStats}): JSX.Element => {- const { t, i18n: { language } }: {- t: (key: string, options?: {- [key: string]: string | number | boolean | undefined | null,- }) => string,- i18n: { language: string },+ const {+ t,+ i18n: { language },+ }: {+ t: (+ key: string,+ options?: {+ [key: string]: string | number | boolean | undefined | null+ },+ ) => string+ i18n: { language: string }} = useTranslation('common')const [periodPairs, setPeriodPairs] = useState(captchaTbPeriodPairs(t, undefined, undefined, language))const dashboardRef = useRef(null)// @ts-ignore- const { id }: {- id: string,+ const {+ id,+ }: {+ id: string} = useParams()const navigate = useNavigate()- const project: ICaptchaProject = useMemo(() => _find(projects, p => p.id === id) || {} as ICaptchaProject, [projects, id])+ const project: ICaptchaProject = useMemo(+ () => _find(projects, (p) => p.id === id) || ({} as ICaptchaProject),+ [projects, id],+ )const [areFiltersParsed, setAreFiltersParsed] = useState<boolean>(false)const [areTimeBucketParsed, setAreTimeBucketParsed] = useState<boolean>(false)const [arePeriodParsed, setArePeriodParsed] = useState<boolean>(false)const [panelsData, setPanelsData] = useState<any>({})const [isPanelsDataEmpty, setIsPanelsDataEmpty] = useState<boolean>(false)const [analyticsLoading, setAnalyticsLoading] = useState<boolean>(true)- const [period, setPeriod] = useState<string>(projectViewPrefs ? projectViewPrefs[id]?.period || periodPairs[3].period : periodPairs[3].period)- const [timeBucket, setTimebucket] = useState<string>(projectViewPrefs ? projectViewPrefs[id]?.timeBucket || periodPairs[3].tbs[1] : periodPairs[3].tbs[1])+ const [period, setPeriod] = useState<string>(+ projectViewPrefs ? projectViewPrefs[id]?.period || periodPairs[3].period : periodPairs[3].period,+ )+ const [timeBucket, setTimebucket] = useState<string>(+ projectViewPrefs ? projectViewPrefs[id]?.timeBucket || periodPairs[3].tbs[1] : periodPairs[3].tbs[1],+ )const activePeriod: {- period: string,- label: string,- tbs: string[],- } = useMemo(() => _find(periodPairs, p => p.period === period) || {- period: periodPairs[3].period,- tbs: periodPairs[3].tbs,- label: periodPairs[3].label,- }, [period, periodPairs])+ period: string+ label: string+ tbs: string[]+ } = useMemo(+ () =>+ _find(periodPairs, (p) => p.period === period) || {+ period: periodPairs[3].period,+ tbs: periodPairs[3].tbs,+ label: periodPairs[3].label,+ },+ [period, periodPairs],+ )const [chartData, setChartData] = useState<any>({})const [dataLoading, setDataLoading] = useState<boolean>(false)const [activeChartMetrics, setActiveChartMetrics] = useState<{- [key: string]: boolean,+ [key: string]: boolean}>({[CHART_METRICS_MAPPING.results]: true,})@@ -122,12 +160,14 @@ const ViewProject = ({const tnMapping = typeNameMapping(t)const refCalendar = useRef(null)const localStorageDateRange = projectViewPrefs ? projectViewPrefs[id]?.rangeDate : null- const [dateRange, setDateRange] = useState<Date[] | null>(localStorageDateRange ? [new Date(localStorageDateRange[0]), new Date(localStorageDateRange[1])] : null)+ const [dateRange, setDateRange] = useState<Date[] | null>(+ localStorageDateRange ? [new Date(localStorageDateRange[0]), new Date(localStorageDateRange[1])] : null,+ )const timeFormat = useMemo(() => user.timeFormat || TimeFormat['12-hour'], [user])const [ref, size] = useSize() as any- const rotateXAxias = useMemo(() => (size.width > 0 && size.width < 500), [size])- const [chartType, setChartType] = useState<string>(getItem('chartType') as string || chartTypes.line)+ const rotateXAxias = useMemo(() => size.width > 0 && size.width < 500, [size])+ const [chartType, setChartType] = useState<string>((getItem('chartType') as string) || chartTypes.line)const [mainChart, setMainChart] = useState<any>(null)const { name } = project as IProject@@ -145,7 +185,7 @@ const ViewProject = ({}, [name, t])// @ts-ignore- const sharedRoles = useMemo(() => _find(user.sharedProjects, p => p.project.id === id)?.role || {}, [user, id])+ const sharedRoles = useMemo(() => _find(user.sharedProjects, (p) => p.project.id === id)?.role || {}, [user, id])const chartMetrics = useMemo(() => {return [@@ -165,7 +205,7 @@ const ViewProject = ({// eslint-disable-next-line react-hooks/exhaustive-depsconst switchActiveChartMetric = _debounce((pairID) => {- setActiveChartMetrics(prev => ({ ...prev, [pairID]: !prev[pairID] }))+ setActiveChartMetrics((prev) => ({ ...prev, [pairID]: !prev[pairID] }))})const onErrorLoading = () => {@@ -213,9 +253,7 @@ const ViewProject = ({return}- const {- chart, params, customs, appliedFilters, timeBucket: timeBucketFromResponse,- } = data+ const { chart, params, customs, appliedFilters, timeBucket: timeBucketFromResponse } = datalet newTimebucket = timeBucket@@ -232,7 +270,10 @@ const ViewProject = ({if (item.period === KEY_FOR_ALL_TIME) {return {...item,- tbs: timeBucketFromResponse.length > 2 ? [timeBucketFromResponse[0], timeBucketFromResponse[1]] : timeBucketFromResponse,+ tbs:+ timeBucketFromResponse.length > 2+ ? [timeBucketFromResponse[0], timeBucketFromResponse[1]]+ : timeBucketFromResponse,}}return item@@ -246,7 +287,15 @@ const ViewProject = ({setIsPanelsDataEmpty(true)} else {const applyRegions = !_includes(noRegionPeriods, activePeriod.period)- const bbSettings: any = getSettings(chart, newTimebucket, activeChartMetrics, applyRegions, timeFormat, rotateXAxias, chartType)+ const bbSettings: any = getSettings(+ chart,+ newTimebucket,+ activeChartMetrics,+ applyRegions,+ timeFormat,+ rotateXAxias,+ chartType,+ )setChartData(chart)setPanelsData({@@ -302,10 +351,7 @@ const ViewProject = ({} else {// selected filter is not present in the filters array -> applying it// sroting filter in the state- newFilters = [- ...filters,- { column, filter, isExclusive },- ]+ newFilters = [...filters, { column, filter, isExclusive }]setFilters(newFilters)// storing filter in the page URL@@ -475,17 +521,20 @@ const ViewProject = ({useEffect(() => {if (!isLoading && _isEmpty(project)) {getProject(id, true)- .then(projectRes => {+ .then((projectRes) => {if (!_isEmpty(projectRes)) {- setProjects([...(projects as any[]), {- ...projectRes,- live: 'N/A',- }])+ setProjects([+ ...(projects as any[]),+ {+ ...projectRes,+ live: 'N/A',+ },+ ])} else {onErrorLoading()}})- .catch(e => {+ .catch((e) => {console.error(e)onErrorLoading()})@@ -553,7 +602,9 @@ const ViewProject = ({// @ts-ignoreconst url = new URL(window.location)const { searchParams } = url- const intialPeriod = projectViewPrefs ? searchParams.get('period') || projectViewPrefs[id]?.period : searchParams.get('period') || '7d'+ const intialPeriod = projectViewPrefs+ ? searchParams.get('period') || projectViewPrefs[id]?.period+ : searchParams.get('period') || '7d'if (!_includes(validPeriods, intialPeriod)) {return}@@ -623,34 +674,30 @@ const ViewProject = ({<><EventsRunningOutBanner /><div ref={ref} className='bg-gray-50 dark:bg-slate-900'>- <div- className='max-w-[1584px] w-full mx-auto py-6 px-2 sm:px-4 lg:px-8 min-h-min-footer'- ref={dashboardRef}- >+ <div className='max-w-[1584px] w-full mx-auto py-6 px-2 sm:px-4 lg:px-8 min-h-min-footer' ref={dashboardRef}><div className='flex flex-col lg:flex-row items-center lg:items-start justify-between mt-2'>- <h2 className='text-xl font-bold text-gray-900 dark:text-gray-50 break-words break-all'>- {name}- </h2>+ <h2 className='text-xl font-bold text-gray-900 dark:text-gray-50 break-words break-all'>{name}</h2><div className='flex mt-3 lg:mt-0 max-w-[420px] flex-wrap items-center sm:max-w-none justify-between w-full sm:w-auto mx-auto sm:mx-0'><buttontype='button'title={t('project.refreshStats')}onClick={refreshStats}- className={cx('mr-3 relative rounded-md p-2 bg-gray-50 text-sm font-medium hover:bg-white hover:shadow-sm dark:bg-slate-900 dark:hover:bg-slate-800 focus:z-10 focus:outline-none focus:ring-1 focus:ring-indigo-500 focus:border-indigo-500 focus:dark:ring-gray-200 focus:dark:border-gray-200', {- 'cursor-not-allowed opacity-50': isLoading || dataLoading,- })}+ className={cx(+ 'mr-3 relative rounded-md p-2 bg-gray-50 text-sm font-medium hover:bg-white hover:shadow-sm dark:bg-slate-900 dark:hover:bg-slate-800 focus:z-10 focus:outline-none focus:ring-1 focus:ring-indigo-500 focus:border-indigo-500 focus:dark:ring-gray-200 focus:dark:border-gray-200',+ {+ 'cursor-not-allowed opacity-50': isLoading || dataLoading,+ },+ )}><ArrowPathIcon className='w-5 h-5 text-gray-700 dark:text-gray-50' /></button><Dropdownheader={t('project.exportData')}items={exportTypes}- title={[- <ArrowDownTrayIcon key='download-icon' className='w-5 h-5' />,- ]}- labelExtractor={item => item.label}- keyExtractor={item => item.label}- onSelect={item => item.onClick(panelsData, t)}+ title={[<ArrowDownTrayIcon key='download-icon' className='w-5 h-5' />]}+ labelExtractor={(item) => item.label}+ keyExtractor={(item) => item.label}+ onSelect={(item) => item.onClick(panelsData, t)}className={cx('mr-3', { hidden: isPanelsDataEmpty || analyticsLoading })}chevron='mini'buttonClassName='!p-2 rounded-md hover:bg-white hover:shadow-sm dark:hover:bg-slate-800 focus:z-10 focus:outline-none focus:ring-1 focus:ring-indigo-500 focus:border-indigo-500 focus:dark:ring-gray-200 focus:dark:border-gray-200'@@ -665,10 +712,15 @@ const ViewProject = ({type='button'title={t('project.barChart')}onClick={() => setChartTypeOnClick(chartTypes.bar)}- className={cx('relative fill-gray-700 dark:fill-gray-50 rounded-md p-2 text-sm font-medium focus:z-10 focus:outline-none focus:ring-1 focus:ring-indigo-500 focus:border-indigo-500 focus:dark:ring-gray-200 focus:dark:border-gray-200', {- 'bg-white dark:bg-slate-800 stroke-white dark:stroke-slate-800 shadow-sm': chartType === chartTypes.bar,- 'bg-gray-50 stroke-gray-50 dark:bg-slate-900 dark:stroke-slate-900 [&_svg]:hover:fill-gray-500 [&_svg]:hover:dark:fill-gray-200': chartType !== chartTypes.bar,- })}+ className={cx(+ 'relative fill-gray-700 dark:fill-gray-50 rounded-md p-2 text-sm font-medium focus:z-10 focus:outline-none focus:ring-1 focus:ring-indigo-500 focus:border-indigo-500 focus:dark:ring-gray-200 focus:dark:border-gray-200',+ {+ 'bg-white dark:bg-slate-800 stroke-white dark:stroke-slate-800 shadow-sm':+ chartType === chartTypes.bar,+ 'bg-gray-50 stroke-gray-50 dark:bg-slate-900 dark:stroke-slate-900 [&_svg]:hover:fill-gray-500 [&_svg]:hover:dark:fill-gray-200':+ chartType !== chartTypes.bar,+ },+ )}><BarChart className='w-5 h-5 [&_path]:stroke-[3.5%]' /></button>@@ -676,10 +728,15 @@ const ViewProject = ({type='button'title={t('project.lineChart')}onClick={() => setChartTypeOnClick(chartTypes.line)}- className={cx('relative fill-gray-700 dark:fill-gray-50 rounded-md p-2 text-sm font-medium focus:z-10 focus:outline-none focus:ring-1 focus:ring-indigo-500 focus:border-indigo-500 focus:dark:ring-gray-200 focus:dark:border-gray-200', {- 'bg-white dark:bg-slate-800 stroke-white dark:stroke-slate-800 shadow-sm': chartType === chartTypes.line,- 'bg-gray-50 stroke-gray-50 dark:bg-slate-900 dark:stroke-slate-900 [&_svg]:hover:fill-gray-500 [&_svg]:hover:dark:fill-gray-200': chartType !== chartTypes.line,- })}+ className={cx(+ 'relative fill-gray-700 dark:fill-gray-50 rounded-md p-2 text-sm font-medium focus:z-10 focus:outline-none focus:ring-1 focus:ring-indigo-500 focus:border-indigo-500 focus:dark:ring-gray-200 focus:dark:border-gray-200',+ {+ 'bg-white dark:bg-slate-800 stroke-white dark:stroke-slate-800 shadow-sm':+ chartType === chartTypes.line,+ 'bg-gray-50 stroke-gray-50 dark:bg-slate-900 dark:stroke-slate-900 [&_svg]:hover:fill-gray-500 [&_svg]:hover:dark:fill-gray-200':+ chartType !== chartTypes.line,+ },+ )}><LineChart className='w-5 h-5 [&_path]:stroke-[3.5%]' /></button>@@ -690,9 +747,7 @@ const ViewProject = ({title={t('project.metricVis')}className={cx({ hidden: isPanelsDataEmpty || analyticsLoading })}labelExtractor={(pair) => {- const {- label, id: pairID, active,- } = pair+ const { label, id: pairID, active } = pairreturn (<Checkbox@@ -700,7 +755,7 @@ const ViewProject = ({label={label}id={pairID}checked={active}- onChange={() => { }}+ onChange={() => {}}/>)}}@@ -753,12 +808,8 @@ const ViewProject = ({/></div></div>- {(analyticsLoading) && (- <Loader />- )}- {(isPanelsDataEmpty) && (- <NoEvents filters={filters} resetFilters={resetFilters} />- )}+ {analyticsLoading && <Loader />}+ {isPanelsDataEmpty && <NoEvents filters={filters} resetFilters={resetFilters} />}<div className={cx('pt-4', { hidden: isPanelsDataEmpty || analyticsLoading })}><divclassName={cx('h-80', {@@ -792,14 +843,10 @@ const ViewProject = ({const { name: entryName, cc } = entryif (cc) {- return (- <CCRow cc={cc} name={entryName} language={language} />- )+ return <CCRow cc={cc} name={entryName} language={language} />}- return (- <CCRow cc={entryName} language={language} />- )+ return <CCRow cc={entryName} language={language} />}return (@@ -842,9 +889,7 @@ const ViewProject = ({name={panelName}data={panelsData.data[type]}// @ts-ignore- rowMapper={({ name: entryName }) => (- <RefRow rowName={entryName} showIcons={showIcons} />- )}+ rowMapper={({ name: entryName }) => <RefRow rowName={entryName} showIcons={showIcons} />}/>)}@@ -862,12 +907,7 @@ const ViewProject = ({)})}{!_isEmpty(panelsData.customs) && (- <CustomEvents- t={t}- customs={panelsData.customs}- onFilter={filterHandler}- chartData={chartData}- />+ <CustomEvents t={t} customs={panelsData.customs} onFilter={filterHandler} chartData={chartData} />)}</div></div>diff --git a/app/pages/Captcha/View/components/Filters.tsx b/app/pages/Captcha/View/components/Filters.tsxindex 246efb158..8ee027ef5 100644--- a/app/pages/Captcha/View/components/Filters.tsx+++ b/app/pages/Captcha/View/components/Filters.tsx@@ -11,7 +11,14 @@ import countries from 'utils/isoCountries'* @returns {JSX.Element}*/const Filter = ({- column, filter, isExclusive, onRemoveFilter, onChangeExclusive, tnMapping, language, t,+ column,+ filter,+ isExclusive,+ onRemoveFilter,+ onChangeExclusive,+ tnMapping,+ language,+ t,}: {column: stringfilter: string@@ -41,11 +48,13 @@ const Filter = ({<span className='inline-flex rounded-md items-center py-0.5 pl-2.5 pr-1 mr-2 mt-2 text-sm font-medium bg-gray-200 text-gray-800 dark:text-gray-50 dark:bg-slate-800'>{displayColumn} - <span className='text-blue-400 border-blue-400 border-b-2 border-dotted cursor-pointer' onClick={() => onChangeExclusive(column, filter, !isExclusive)}>+ <span+ className='text-blue-400 border-blue-400 border-b-2 border-dotted cursor-pointer'+ onClick={() => onChangeExclusive(column, filter, !isExclusive)}+ >{t(`common.${isExclusive ? 'isNot' : 'is'}`)}</span>- - "+ "{displayFilter}"<button@@ -72,7 +81,10 @@ const Filter = ({* @returns {JSX.Element}*/const Filters = ({- filters, onRemoveFilter, onChangeExclusive, tnMapping,+ filters,+ onRemoveFilter,+ onChangeExclusive,+ tnMapping,}: {filters: {column: string@@ -85,7 +97,10 @@ const Filters = ({onChangeExclusive: (column: string, filter: string, isExclusive: boolean) => voidtnMapping: Record<string, string>}) => {- const { t, i18n: { language } } = useTranslation('common')+ const {+ t,+ i18n: { language },+ } = useTranslation('common')return (<div className='flex justify-center md:justify-start flex-wrap -mt-2'>@@ -94,7 +109,15 @@ const Filters = ({const key = `${column}${filter}`return (- <Filter key={key} onRemoveFilter={onRemoveFilter} onChangeExclusive={onChangeExclusive} language={language} t={t} tnMapping={tnMapping} {...props} />+ <Filter+ key={key}+ onRemoveFilter={onRemoveFilter}+ onChangeExclusive={onChangeExclusive}+ language={language}+ t={t}+ tnMapping={tnMapping}+ {...props}+ />)})}</div>@@ -102,11 +125,13 @@ const Filters = ({}Filters.propTypes = {- filters: PropTypes.arrayOf(PropTypes.shape({- column: PropTypes.string,- filter: PropTypes.string,- isExclusive: PropTypes.bool,- })),+ filters: PropTypes.arrayOf(+ PropTypes.shape({+ column: PropTypes.string,+ filter: PropTypes.string,+ isExclusive: PropTypes.bool,+ }),+ ),onRemoveFilter: PropTypes.func.isRequired,onChangeExclusive: PropTypes.func.isRequired,tnMapping: PropTypes.objectOf(PropTypes.string).isRequired,diff --git a/app/pages/Captcha/View/components/InteractiveMap.tsx b/app/pages/Captcha/View/components/InteractiveMap.tsxindex 150791589..10aeef40b 100644--- a/app/pages/Captcha/View/components/InteractiveMap.tsx+++ b/app/pages/Captcha/View/components/InteractiveMap.tsx@@ -11,7 +11,7 @@ import { IEntry } from 'redux/models/IEntry'import countriesList from 'utils/countries'interface IInteractiveMap {- data: IEntry[],+ data: IEntry[]onClickCountry: (country: string) => voidtotal: number}@@ -31,11 +31,17 @@ interface ICountryMap {}const InteractiveMap = ({ data, onClickCountry, total }: IInteractiveMap) => {- const { t, i18n: { language } } = useTranslation('common')+ const {+ t,+ i18n: { language },+ } = useTranslation('common')const [hoverShow, setHoverShow] = useState<boolean>(false)const [dataHover, setDataHover] = useState<IDataHover>({} as IDataHover)const [cursorPosition, setCursorPosition] = useState<ICursorPosition>({} as ICursorPosition)- const countryMap: ICountryMap = useMemo(() => _reduce(data, (prev, curr) => ({ ...prev, [curr.cc || curr.name]: curr.count }), {}), [data])+ const countryMap: ICountryMap = useMemo(+ () => _reduce(data, (prev, curr) => ({ ...prev, [curr.cc || curr.name]: curr.count }), {}),+ [data],+ )const onMouseMove = (e: React.MouseEvent<SVGSVGElement, MouseEvent>) => {const rect = e.currentTarget.getBoundingClientRect()@@ -50,21 +56,21 @@ const InteractiveMap = ({ data, onClickCountry, total }: IInteractiveMap) => {<g>{_map(countriesList, (key, value) => {const ccData = countryMap[value] || 0- const perc = ((ccData / total) * 100) || 0+ const perc = (ccData / total) * 100 || 0return (<pathkey={value}id={value}className={cx({- 'hover:opacity-90': perc > 0,- 'fill-[#cfd1d4] dark:fill-[#465d7e46]': perc === 0,- 'fill-[#92b2e7] dark:fill-[#292d77]': perc > 0 && perc < 3,- 'fill-[#6f9be3] dark:fill-[#363391]': perc >= 3 && perc < 10,- 'fill-[#5689db] dark:fill-[#4842be]': perc >= 10 && perc < 20,- 'fill-[#3b82f6] dark:fill-[#6357ff]': perc >= 20,- 'cursor-pointer': Boolean(ccData),- })}+ 'hover:opacity-90': perc > 0,+ 'fill-[#cfd1d4] dark:fill-[#465d7e46]': perc === 0,+ 'fill-[#92b2e7] dark:fill-[#292d77]': perc > 0 && perc < 3,+ 'fill-[#6f9be3] dark:fill-[#363391]': perc >= 3 && perc < 10,+ 'fill-[#5689db] dark:fill-[#4842be]': perc >= 10 && perc < 20,+ 'fill-[#3b82f6] dark:fill-[#6357ff]': perc >= 20,+ 'cursor-pointer': Boolean(ccData),+ })}d={key.d}onClick={() => perc !== 0 && onClickCountry(value)}onMouseEnter={() => {@@ -95,9 +101,7 @@ const InteractiveMap = ({ data, onClickCountry, total }: IInteractiveMap) => {><strong>{dataHover.countries}</strong><br />- {t('project.unique')}- :- + {t('project.unique')}: <strongclassName={cx({'dark:text-indigo-400': dataHover.data < 5,@@ -114,15 +118,17 @@ const InteractiveMap = ({ data, onClickCountry, total }: IInteractiveMap) => {InteractiveMap.propTypes = {onClickCountry: PropTypes.func,- data: PropTypes.arrayOf(PropTypes.shape({- name: PropTypes.string,- count: PropTypes.number,- })),+ data: PropTypes.arrayOf(+ PropTypes.shape({+ name: PropTypes.string,+ count: PropTypes.number,+ }),+ ),total: PropTypes.number,}InteractiveMap.defaultProps = {- onClickCountry: () => { },+ onClickCountry: () => {},data: [],total: 0,}diff --git a/app/pages/Captcha/View/components/LiveVisitorsDropdown.tsx b/app/pages/Captcha/View/components/LiveVisitorsDropdown.tsxindex e48dabacb..45149f6e2 100644--- a/app/pages/Captcha/View/components/LiveVisitorsDropdown.tsx+++ b/app/pages/Captcha/View/components/LiveVisitorsDropdown.tsx@@ -3,17 +3,12 @@ import _map from 'lodash/map'import { useTranslation } from 'react-i18next'// @ts-ignoreimport OutsideClickHandler from 'react-outside-click-handler'-import {- ChevronDownIcon, ChevronUpIcon, XMarkIcon,-} from '@heroicons/react/24/outline'+import { ChevronDownIcon, ChevronUpIcon, XMarkIcon } from '@heroicons/react/24/outline'import Flag from 'react-flagkit'import { getLiveVisitorsInfo, IGetLiveVisitorsInfo } from 'api'-const LiveVisitorsDropdown = ({ live, projectId }: {- live: number | string- projectId: string-}): JSX.Element => {+const LiveVisitorsDropdown = ({ live, projectId }: { live: number | string; projectId: string }): JSX.Element => {const { t } = useTranslation()const [show, setShow] = useState<boolean>(false)const [liveInfo, setLiveInfo] = useState<IGetLiveVisitorsInfo[]>([])@@ -39,49 +34,37 @@ const LiveVisitorsDropdown = ({ live, projectId }: {}, [show]) // eslint-disable-line react-hooks/exhaustive-depsreturn (- <OutsideClickHandler- onOutsideClick={() => setShow(false)}- >+ <OutsideClickHandler onOutsideClick={() => setShow(false)}><p className='h-5 mr-2 text-gray-900 dark:text-gray-50 text-xl cursor-pointer' onClick={() => setShow(!show)}>- {live}- {' '}- {show ? <ChevronUpIcon className='inline w-5 h-5' /> : <ChevronDownIcon className='inline w-5 h-5' />}+ {live} {show ? <ChevronUpIcon className='inline w-5 h-5' /> : <ChevronDownIcon className='inline w-5 h-5' />}</p>{show && (<div className='absolute z-10 mt-2 right-0 top-20 text-gray-900 bg-white border border-gray-200 rounded-md shadow-lg dark:bg-slate-900 dark:border-slate-700/50 min-w-[250px] max-h-[200px] overflow-auto'><div className='flex flex-col w-full p-2'>- <p className='text-sm font-semibold text-gray-900 dark:text-gray-50'>- {t('dashboard.liveVisitors')}- </p>+ <p className='text-sm font-semibold text-gray-900 dark:text-gray-50'>{t('dashboard.liveVisitors')}</p>{loading ? (- <p className='text-sm text-gray-900 dark:text-gray-50'>- {t('common.loading')}- </p>+ <p className='text-sm text-gray-900 dark:text-gray-50'>{t('common.loading')}</p>) : (- _map(liveInfo, ({- dv, br, os, cc,- }, index) => (- <div key={`${dv}${br}${os}${cc}${index}`} className='flex flex-row items-center justify-between w-full p-2 mt-2 text-sm text-gray-900 bg-gray-100 rounded-md dark:text-gray-50 dark:bg-slate-800'>+ _map(liveInfo, ({ dv, br, os, cc }, index) => (+ <div+ key={`${dv}${br}${os}${cc}${index}`}+ className='flex flex-row items-center justify-between w-full p-2 mt-2 text-sm text-gray-900 bg-gray-100 rounded-md dark:text-gray-50 dark:bg-slate-800'+ ><div className='flex flex-row items-center'>- <Flag- className='rounded-sm mr-2'- country={cc}- size={21}- alt=''- aria-hidden='true'- />+ <Flag className='rounded-sm mr-2' country={cc} size={21} alt='' aria-hidden='true' /><p className='mr-2'>{os}</p><p className='mr-2'>{br}</p><p className='mr-2 capitalize'>{dv}</p></div>- <p className='text-xs font-semibold text-green-500'>- {t('dashboard.live')}- </p>+ <p className='text-xs font-semibold text-green-500'>{t('dashboard.live')}</p></div>)))}</div>- <XMarkIcon className='absolute rounded-md top-2 right-2 w-5 h-5 text-gray-900 cursor-pointer dark:text-gray-50 hover:bg-gray-200 hover:dark:bg-slate-800 ' onClick={() => setShow(!show)} />+ <XMarkIcon+ className='absolute rounded-md top-2 right-2 w-5 h-5 text-gray-900 cursor-pointer dark:text-gray-50 hover:bg-gray-200 hover:dark:bg-slate-800 '+ onClick={() => setShow(!show)}+ /></div>)}</OutsideClickHandler>diff --git a/app/pages/Captcha/View/components/NoEvents.tsx b/app/pages/Captcha/View/components/NoEvents.tsxindex ddc5ac585..7d38407e9 100644--- a/app/pages/Captcha/View/components/NoEvents.tsx+++ b/app/pages/Captcha/View/components/NoEvents.tsx@@ -1,6 +1,4 @@-import React, {- memo,-} from 'react'+import React, { memo } from 'react'import { useTranslation, Trans } from 'react-i18next'import _isEmpty from 'lodash/isEmpty'import PropTypes from 'prop-types'@@ -17,7 +15,8 @@ import { DOCS_CAPTCHA_URL } from 'redux/constants'* @returns {JSX.Element}*/const NoEvents = ({- filters, resetFilters,+ filters,+ resetFilters,}: {filters: {column: string@@ -26,16 +25,16 @@ const NoEvents = ({}[]resetFilters: () => void}): JSX.Element => {- const { t }: {+ const {+ t,+ }: {t: (key: string) => string} = useTranslation('common')return (<div className='flex flex-col py-6 sm:px-6 lg:px-8 mt-5'><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>+ <h2 className='text-4xl text-center leading-tight my-3'>{t('project.noEvTitle')}</h2><h2 className='text-2xl mb-8 text-center leading-snug'><Trans// @ts-ignore@@ -43,18 +42,20 @@ const NoEvents = ({i18nKey='project.noCaptchaEv'components={{// eslint-disable-next-line jsx-a11y/anchor-has-content- url: <a href={DOCS_CAPTCHA_URL} className='hover:underline text-blue-600' target='_blank' rel='noreferrer noopener' />,+ url: (+ <a+ href={DOCS_CAPTCHA_URL}+ className='hover:underline text-blue-600'+ target='_blank'+ rel='noreferrer noopener'+ />+ ),}}/></h2>{!_isEmpty(filters) && (<div className='!flex !mx-auto'>- <Button- onClick={resetFilters}- className='!flex !mx-auto'- primary- giant- >+ <Button onClick={resetFilters} className='!flex !mx-auto' primary giant>{t('project.resetFilters')}</Button></div>@@ -65,11 +66,13 @@ const NoEvents = ({}NoEvents.propTypes = {- filters: PropTypes.arrayOf(PropTypes.shape({- column: PropTypes.string,- filter: PropTypes.string,- isExclusive: PropTypes.bool,- })),+ filters: PropTypes.arrayOf(+ PropTypes.shape({+ column: PropTypes.string,+ filter: PropTypes.string,+ isExclusive: PropTypes.bool,+ }),+ ),resetFilters: PropTypes.func.isRequired,}diff --git a/app/pages/Captcha/View/components/RefRow.tsx b/app/pages/Captcha/View/components/RefRow.tsxindex bee34ee08..d4bcccf9d 100644--- a/app/pages/Captcha/View/components/RefRow.tsx+++ b/app/pages/Captcha/View/components/RefRow.tsx@@ -9,10 +9,7 @@ import PropTypes from 'prop-types'* @param {boolean} showIcons - Whether to show favicon icons near links or not.* @returns {JSX.Element}*/-const RefRow = ({ rowName, showIcons }: {- rowName: string- showIcons: boolean-}): JSX.Element => {+const RefRow = ({ rowName, showIcons }: { rowName: string; showIcons: boolean }): JSX.Element => {let isUrl: boolean = truelet url: URL | null = null@@ -44,9 +41,7 @@ const RefRow = ({ rowName, showIcons }: {{rowName}</a>) : (- <span className='flex label overflow-visible hover:underline text-blue-600 dark:text-blue-500'>- {rowName}- </span>+ <span className='flex label overflow-visible hover:underline text-blue-600 dark:text-blue-500'>{rowName}</span>)}</div>)diff --git a/app/pages/Changelog/index.tsx b/app/pages/Changelog/index.tsxindex b55ac8891..c9c1d0da5 100644--- a/app/pages/Changelog/index.tsx+++ b/app/pages/Changelog/index.tsx@@ -5,9 +5,7 @@ import { useTranslation } from 'react-i18next'import dayjs from 'dayjs'import { Link } from '@remix-run/react'-import {- SWETRIX_VS_GOOGLE, DOCS_URL, CAPTCHA_URL, DOCS_CAPTCHA_URL,-} from 'redux/constants'+import { SWETRIX_VS_GOOGLE, DOCS_URL, CAPTCHA_URL, DOCS_CAPTCHA_URL } from 'redux/constants'import routes from 'routesPath'const INTEGRATIONS_LINK = `${routes.user_settings}#integrations`@@ -16,9 +14,7 @@ const INTEGRATIONS_LINK = `${routes.user_settings}#integrations`const changelog = [{date: '2023-10-17',- changes: [- 'Added support for cumulative mode visualisation.',- ],+ changes: ['Added support for cumulative mode visualisation.'],},{date: '2023-10-14',@@ -37,20 +33,20 @@ const changelog = [{date: '2023-07-22',changes: [- 'Added 2 new periods: \'All time\' and \'This hour\'. The \'All time\' period will show you the statistics for the whole period since you\'ve created the project, and the \'This hour\' period will show you the statistics for the last 60 minutes (with the \'minute\' time bucket).',+ "Added 2 new periods: 'All time' and 'This hour'. The 'All time' period will show you the statistics for the whole period since you've created the project, and the 'This hour' period will show you the statistics for the last 60 minutes (with the 'minute' time bucket).",'Added the ability to track which region (or state) and city your users come from.','Minor UX improvements by reordering the action buttons on the Project Dashboard page..',- 'Improved billing: When you upgrade or downgrade your plan, we now apply pro-rated charges. This means you\'ll only be charged for the time you use your plan, saving you money in the process.',+ "Improved billing: When you upgrade or downgrade your plan, we now apply pro-rated charges. This means you'll only be charged for the time you use your plan, saving you money in the process.",'Added the ability to apply multiple filters to a column. For example, you can now narrow the statistics to show only the data for users from Germany, the UK and Ukraine.',- 'Lots of other general performance improvements, marketplace extensions (we\'ve added a lot of new extensions recently, check them out. They are free.) and bug fixes.',+ "Lots of other general performance improvements, marketplace extensions (we've added a lot of new extensions recently, check them out. They are free.) and bug fixes.",],},{date: '2023-06-17',changes: ['Fully migrated our frontend to Remix Framework (Server-side rendering), thus improving the performance of Swetrix. Also in the future you can expect A LOT of cool improvements like link image previews and so on.',- 'Now when you create a new Project - it\'s ID is generated on the server side.',- 'Hidden the \'New password\' input fields under the \'Change password\' spoiler on the Account settings page.',+ "Now when you create a new Project - it's ID is generated on the server side.",+ "Hidden the 'New password' input fields under the 'Change password' spoiler on the Account settings page.",'Redesigned Header, Footer and the white theme - removed unnecessary blue colors and made it more consistent (there will be more UI improvements soon!).',],},@@ -72,14 +68,14 @@ const changelog = [date: '2023-05-27',changes: ['Added Plan usage section to the Billing page.',- 'Added currency localisation: now you can pay for your plan with GBP (if you\'re located in the UK) or EUR (if you\'re located in Eurozone), for all other countries the default currency is still the US Dollar.',+ "Added currency localisation: now you can pay for your plan with GBP (if you're located in the UK) or EUR (if you're located in Eurozone), for all other countries the default currency is still the US Dollar.",],},{date: '2023-05-15',changes: ['Fixed timezone related issues.',- 'Dropped support for weekly timebucket - it\'s a pain to support it across multiple timezones, but we may add it back in the future.',+ "Dropped support for weekly timebucket - it's a pain to support it across multiple timezones, but we may add it back in the future.",'Fix a bug when filters might not be applied to the chart when reloading the page.',],},@@ -88,9 +84,11 @@ const changelog = [changes: ['Added an ability to compare statistics over time periods - now you can compare the current period with the previous one, or select a custom date range to compare.',<>- Swetrix is now an Open Startup, we- {' '}- <Link to={routes.open} className='font-medium text-indigo-600 hover:text-indigo-500 dark:text-indigo-400 dark:hover:text-indigo-500'>+ Swetrix is now an Open Startup, we{' '}+ <Link+ to={routes.open}+ className='font-medium text-indigo-600 hover:text-indigo-500 dark:text-indigo-400 dark:hover:text-indigo-500'+ >publish</Link>our finance and technical metrics.@@ -109,27 +107,19 @@ const changelog = [},{date: '2023-04-22',- changes: [- 'Added an ability to partially delete project related analytics data.',- ],+ changes: ['Added an ability to partially delete project related analytics data.'],},{date: '2023-04-20',- changes: [- 'Added sorting functinoality to the Custom events panel.',- ],+ changes: ['Added sorting functinoality to the Custom events panel.'],},{date: '2023-04-18',- changes: [- 'Added pagination for Custom events panel in Dashboard.',- ],+ changes: ['Added pagination for Custom events panel in Dashboard.'],},{date: '2023-04-17',- changes: [- 'Added Github SSO support.',- ],+ changes: ['Added Github SSO support.'],},{date: '2023-04-16',@@ -139,21 +129,17 @@ const changelog = [},{date: '2023-04-13',- changes: [- 'Added an ability to view custom events on chart.',- ],+ changes: ['Added an ability to view custom events on chart.'],},{date: '2023-04-12',- changes: [- 'Fixed an issue when the selected time bucket or period was not remembered and used after page reload.',- ],+ changes: ['Fixed an issue when the selected time bucket or period was not remembered and used after page reload.'],},{date: '2023-04-09',changes: ['Added an ability to transfer a project from one account to another.',- 'Fixed a bug when the app was crashing due to \'ChunkLoadError: Loading chunk N failed\' error. Now in case of such error the app will reload the page automatically for one time.',+ "Fixed a bug when the app was crashing due to 'ChunkLoadError: Loading chunk N failed' error. Now in case of such error the app will reload the page automatically for one time.",'Fixed broken alignment of the action buttons in the dashboard.',],},@@ -170,8 +156,7 @@ const changelog = [date: '2023-03-20',changes: [<>- Introducing a new service:- {' '}+ Introducing a new service:{' '}<ahref={CAPTCHA_URL}className='font-medium text-indigo-600 hover:text-indigo-500 dark:text-indigo-400 dark:hover:text-indigo-500'@@ -180,11 +165,8 @@ const changelog = [>Swetrix CAPTCHA</a>- .- This is a privacy-focused and fully opensource CAPTCHA service that you can use on your website to protect it from bots.- {' '}- Read more about it in our- {' '}+ . This is a privacy-focused and fully opensource CAPTCHA service that you can use on your website to protect it+ from bots. Read more about it in our{' '}<ahref={DOCS_CAPTCHA_URL}className='font-medium text-indigo-600 hover:text-indigo-500 dark:text-indigo-400 dark:hover:text-indigo-500'@@ -207,14 +189,12 @@ const changelog = [{date: '2023-03-11',changes: [- 'Redesigned Dashboard page panel pages layout (now it\'s more user friendly, the total count of items and pages are displayed as well).',+ "Redesigned Dashboard page panel pages layout (now it's more user friendly, the total count of items and pages are displayed as well).",],},{date: '2023-02-26',- changes: [- 'Added a switch between line and bar chart on the dashboard page.',- ],+ changes: ['Added a switch between line and bar chart on the dashboard page.'],},{date: '2023-02-18',@@ -228,12 +208,15 @@ const changelog = [changes: ['Added an ability to filter data by custom events.',<>- Released a public- {' '}- <a href={`${DOCS_URL}/statistics-api`} className='font-medium text-indigo-600 hover:text-indigo-500 dark:text-indigo-400 dark:hover:text-indigo-500' target='_blank' rel='noopener noreferrer'>+ Released a public{' '}+ <a+ href={`${DOCS_URL}/statistics-api`}+ className='font-medium text-indigo-600 hover:text-indigo-500 dark:text-indigo-400 dark:hover:text-indigo-500'+ target='_blank'+ rel='noopener noreferrer'+ >API Documentation- </a>- {' '}+ </a>{' '}related to data aggregation.</>,'Fully refactored the authentication system.',@@ -245,9 +228,11 @@ const changelog = [changes: ['Added a Polish translation.',<>- Added a- {' '}- <Link to={routes.cookiePolicy} className='font-medium text-indigo-600 hover:text-indigo-500 dark:text-indigo-400 dark:hover:text-indigo-500'>+ Added a{' '}+ <Link+ to={routes.cookiePolicy}+ className='font-medium text-indigo-600 hover:text-indigo-500 dark:text-indigo-400 dark:hover:text-indigo-500'+ >Cookie policy</Link>.@@ -265,9 +250,13 @@ const changelog = [date: '2023-01-17',changes: [<>- Got rid of our custom documentation page and migrated to Docusaurus insted. Check it out at- {' '}- <a href={DOCS_URL} className='font-medium text-indigo-600 hover:text-indigo-500 dark:text-indigo-400 dark:hover:text-indigo-500' target='_blank' rel='noopener noreferrer'>+ Got rid of our custom documentation page and migrated to Docusaurus insted. Check it out at{' '}+ <a+ href={DOCS_URL}+ className='font-medium text-indigo-600 hover:text-indigo-500 dark:text-indigo-400 dark:hover:text-indigo-500'+ target='_blank'+ rel='noopener noreferrer'+ >{DOCS_URL}</a>.@@ -278,9 +267,13 @@ const changelog = [date: '2023-01-05',changes: [<>- Added notification channels integrations. Now you can connect your Telegram account to our official bot and receive notifications (e.g. when someone logins into your account), set up custom project alerts and much more! You can set up the integration in your- {' '}- <Link to={INTEGRATIONS_LINK} className='font-medium text-indigo-600 hover:text-indigo-500 dark:text-indigo-400 dark:hover:text-indigo-500'>+ Added notification channels integrations. Now you can connect your Telegram account to our official bot and+ receive notifications (e.g. when someone logins into your account), set up custom project alerts and much more!+ You can set up the integration in your{' '}+ <Link+ to={INTEGRATIONS_LINK}+ className='font-medium text-indigo-600 hover:text-indigo-500 dark:text-indigo-400 dark:hover:text-indigo-500'+ >account settings</Link>.@@ -291,22 +284,26 @@ const changelog = [{date: '2023-01-03',changes: [- 'Added new tab in Dashboard: Performance. By switching to it you\'ll be able to see the performance of your website, page loading by country, some detailed statistics like TTFB, DOM Content Load, DNS response time and so on.\nTo collect the performance data you need to upgrade swetrix.js tracking script to v2.0.0 or higher.\nIf you\'re using the UMD build - the latest version is pulled automatically.\nIf you\'re using the NPM package - make sure to update it manually.',+ "Added new tab in Dashboard: Performance. By switching to it you'll be able to see the performance of your website, page loading by country, some detailed statistics like TTFB, DOM Content Load, DNS response time and so on.\nTo collect the performance data you need to upgrade swetrix.js tracking script to v2.0.0 or higher.\nIf you're using the UMD build - the latest version is pulled automatically.\nIf you're using the NPM package - make sure to update it manually.",],},{date: '2022-12-30',changes: [- 'Added an ability to see live visitors on your website. Now you\'re able to not only see how many visitors you have, but actually see some information about them.',- 'Added new metric: session duration. Now you\'re able to see how long your users are staying on your website.',+ "Added an ability to see live visitors on your website. Now you're able to not only see how many visitors you have, but actually see some information about them.",+ "Added new metric: session duration. Now you're able to see how long your users are staying on your website.",'Added new chart metrics: bounce rate, views per session, trendlines and session duration.',<>- Added the comparisons column to the footer. There's only- {' '}- <a href={SWETRIX_VS_GOOGLE} className='font-medium text-indigo-600 hover:text-indigo-500 dark:text-indigo-400 dark:hover:text-indigo-500' target='_blank' rel='noopener noreferrer' aria-label='Swetrix to Google Analytics comparison (opens in a new tab)'>+ Added the comparisons column to the footer. There's only{' '}+ <a+ href={SWETRIX_VS_GOOGLE}+ className='font-medium text-indigo-600 hover:text-indigo-500 dark:text-indigo-400 dark:hover:text-indigo-500'+ target='_blank'+ rel='noopener noreferrer'+ aria-label='Swetrix to Google Analytics comparison (opens in a new tab)'+ >Google Analytics comparison- </a>- {' '}+ </a>{' '}for now, but more will be added soon.</>,'Improved chart colours.',@@ -316,16 +313,16 @@ const changelog = []const Changelog = (): JSX.Element => {- const { t }: {+ const {+ t,+ }: {t: (key: string) => string} = useTranslation('common')return (<div className='min-h-min-footer 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.changelog')}- </h1>+ <h1 className='text-4xl font-bold text-gray-900 dark:text-gray-50 tracking-tight'>{t('titles.changelog')}</h1><div className='relative sm:ml-[calc(2rem+1px)] md:ml-[calc(3.5rem+1px)] lg:ml-[calc(11rem)] sm:pb-12 mt-10'><div className='hidden absolute top-3 bottom-0 right-full mr-7 md:mr-[3.25rem] w-px bg-slate-200 dark:bg-slate-700 sm:block' />@@ -354,15 +351,15 @@ const Changelog = (): JSX.Element => {<ul className='list-disc text-gray-900 dark:text-gray-50 relative top-7 lg:top-0 lg:block text-base mt-2 mb-4 prose prose-slate prose-a:relative prose-a:z-10 dark:prose-dark line-clamp-2'>{_map(item.changes, (change) => (// @ts-ignore- <li key={change} className='whitespace-pre-line'>{change}</li>+ <li key={change} className='whitespace-pre-line'>+ {change}+ </li>))}</ul><dl className='absolute left-1.5 top-0 lg:left-auto lg:right-full lg:mr-[calc(5rem+1px)]'><dt className='sr-only'>Date</dt><dd className='whitespace-nowrap text-sm leading-6 text-slate-700 dark:text-slate-300'>- <time dateTime={date}>- {displayDate}- </time>+ <time dateTime={date}>{displayDate}</time></dd></dl></div>@@ -371,7 +368,6 @@ const Changelog = (): JSX.Element => {})}</div></div>-</div></div>)diff --git a/app/pages/Contact/index.tsx b/app/pages/Contact/index.tsxindex 4f8863edb..1c0159f03 100644--- a/app/pages/Contact/index.tsx+++ b/app/pages/Contact/index.tsx@@ -2,21 +2,19 @@import React from 'react'import { useTranslation, Trans } from 'react-i18next'-import {- CONTACT_EMAIL, TWITTER_URL, TWITTER_USERNAME, DISCORD_URL,-} from 'redux/constants'+import { CONTACT_EMAIL, TWITTER_URL, TWITTER_USERNAME, DISCORD_URL } from 'redux/constants'const Contact = (): JSX.Element => {- const { t }: {+ const {+ t,+ }: {t: (key: string) => string} = useTranslation('common')return (<div className='min-h-min-footer 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.contact')}- </h1>+ <h1 className='text-4xl font-bold text-gray-900 dark:text-gray-50 tracking-tight'>{t('titles.contact')}</h1><div className='mt-2 text-lg text-gray-900 dark:text-gray-50 tracking-tight'>{t('contact.howTo')}@@ -28,7 +26,12 @@ const Contact = (): JSX.Element => {i18nKey='contact.ways.email'values={{ email: CONTACT_EMAIL }}components={{- mail: <a href={`mailto:${CONTACT_EMAIL}`} className='font-medium text-indigo-600 hover:text-indigo-500 dark:text-indigo-400 dark:hover:text-indigo-500' />,+ mail: (+ <a+ href={`mailto:${CONTACT_EMAIL}`}+ className='font-medium text-indigo-600 hover:text-indigo-500 dark:text-indigo-400 dark:hover:text-indigo-500'+ />+ ),}}/></li>@@ -39,7 +42,12 @@ const Contact = (): JSX.Element => {i18nKey='contact.ways.twitter'values={{ twitter: TWITTER_USERNAME }}components={{- url: <a href={TWITTER_URL} className='font-medium text-indigo-600 hover:text-indigo-500 dark:text-indigo-400 dark:hover:text-indigo-500' />,+ url: (+ <a+ href={TWITTER_URL}+ className='font-medium text-indigo-600 hover:text-indigo-500 dark:text-indigo-400 dark:hover:text-indigo-500'+ />+ ),}}/></li>@@ -49,7 +57,12 @@ const Contact = (): JSX.Element => {t={t}i18nKey='contact.ways.discord'components={{- url: <a href={DISCORD_URL} className='font-medium text-indigo-600 hover:text-indigo-500 dark:text-indigo-400 dark:hover:text-indigo-500' />,+ url: (+ <a+ href={DISCORD_URL}+ className='font-medium text-indigo-600 hover:text-indigo-500 dark:text-indigo-400 dark:hover:text-indigo-500'+ />+ ),}}/></li>diff --git a/app/pages/CookiePolicy/index.tsx b/app/pages/CookiePolicy/index.tsxindex 271a721b5..6ccdf2a5e 100644--- a/app/pages/CookiePolicy/index.tsx+++ b/app/pages/CookiePolicy/index.tsx@@ -5,7 +5,8 @@ import _map from 'lodash/map'const typesOfCookies = [{cookie: 'Essential cookies',- description: 'These cookies are strictly necessary to provide you with our website and use its functionalities. If you choose to disable these cookies via your internet browser, access and/or use of our website may be altered.',+ description:+ 'These cookies are strictly necessary to provide you with our website and use its functionalities. If you choose to disable these cookies via your internet browser, access and/or use of our website may be altered.',},]@@ -13,18 +14,19 @@ const CookiePolicy = () => {return (<div className='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'>- <h1 className='text-4xl font-bold text-gray-900 dark:text-gray-50 tracking-tight'>- Cookie Policy- </h1>+ <h1 className='text-4xl font-bold text-gray-900 dark:text-gray-50 tracking-tight'>Cookie Policy</h1><p className='mt-4 text-lg text-gray-900 dark:text-gray-50 tracking-tight'>- Part of the provision of our service and this website relies on the collection of cookies. Depending on their use, they may be considered essential or subject to your explicit consent.+ Part of the provision of our service and this website relies on the collection of cookies. Depending on their+ use, they may be considered essential or subject to your explicit consent.</p>- <h3 className='text-2xl font-bold text-gray-900 dark:text-gray-50 tracking-tight mt-4'>- What is a cookie?- </h3>+ <h3 className='text-2xl font-bold text-gray-900 dark:text-gray-50 tracking-tight mt-4'>What is a cookie?</h3><p className='text-lg text-gray-900 dark:text-gray-50 tracking-tight'>- A cookie is a small text file that may be deposited and saved on the hard drive of your device (computer, tablet, smartphone, etc.) when you visit our website. It allows us or third parties to identify the device on which it has been saved and to keep record of certain information relating to your journey in order, for instance, to simplify your visit on our website, to secure your connection or to adapt the content of a page to your interests.+ A cookie is a small text file that may be deposited and saved on the hard drive of your device (computer,+ tablet, smartphone, etc.) when you visit our website. It allows us or third parties to identify the device on+ which it has been saved and to keep record of certain information relating to your journey in order, for+ instance, to simplify your visit on our website, to secure your connection or to adapt the content of a page+ to your interests.</p><h3 className='text-2xl font-bold text-gray-900 dark:text-gray-50 tracking-tight mt-4'>@@ -53,13 +55,9 @@ const CookiePolicy = () => {</tr></thead><tbody className='divide-y divide-gray-200 dark:divide-gray-600 bg-white dark:bg-slate-800'>- {_map(typesOfCookies, ({- cookie, description,- }) => (+ {_map(typesOfCookies, ({ cookie, description }) => (<tr key={cookie}>- <td className='w-1/5 px-3 py-4 text-sm text-gray-900 dark:text-gray-50 sm:pl-6'>- {cookie}- </td>+ <td className='w-1/5 px-3 py-4 text-sm text-gray-900 dark:text-gray-50 sm:pl-6'>{cookie}</td><td className='break-words w-4/5 px-3 py-4 text-sm text-gray-900 dark:text-gray-50'>{description}</td>@@ -77,7 +75,9 @@ const CookiePolicy = () => {How to manage cookies?</h3><p className='text-lg text-gray-900 dark:text-gray-50 tracking-tight'>- Your internet browser may allow you to manage your cookie preferences by removing or rejecting them via your browser settings (usually located in "help", “tools” or “edit” sections). Remember that if you choose to disable our cookies, you may experience some inconvenience when using our website.+ Your internet browser may allow you to manage your cookie preferences by removing or rejecting them via your+ browser settings (usually located in "help", “tools” or “edit” sections). Remember that if you choose to+ disable our cookies, you may experience some inconvenience when using our website.</p><hr className='mt-10 mb-4 border-gray-200 dark:border-gray-600' />diff --git a/app/pages/CrashHandler/index.tsx b/app/pages/CrashHandler/index.tsxindex 7fa11b96c..a4e8f003a 100644--- a/app/pages/CrashHandler/index.tsx+++ b/app/pages/CrashHandler/index.tsx@@ -59,9 +59,7 @@ class CrashHandler extends React.Component<CrashHandlerProps, CrashHandlerState>}render() {- const {- appCrashed, crashStack, errorMessage, crashStackShown,- } = this.state+ const { appCrashed, crashStack, errorMessage, crashStackShown } = this.stateconst { children } = this.propsif (appCrashed) {@@ -74,18 +72,21 @@ class CrashHandler extends React.Component<CrashHandlerProps, CrashHandlerState></div><div className='py-8'><div className='text-center'>- <h1 className='text-4xl font-extrabold text-gray-900 dark:text-gray-50 tracking-tight sm:text-5xl'>Uh-oh..</h1>+ <h1 className='text-4xl font-extrabold text-gray-900 dark:text-gray-50 tracking-tight sm:text-5xl'>+ Uh-oh..+ </h1><p className='mt-2 text-base font-medium text-gray-800 dark:text-gray-300'>The app has crashed. We are sorry about that :(<br />- Please, tell us about it at- {' '}- {CONTACT_EMAIL}+ Please, tell us about it at {CONTACT_EMAIL}</p><p className='mt-6 text-base font-medium text-gray-800 dark:text-gray-300'>{errorMessage}<br />- <span onClick={this.onCrashStackClick} className='flex justify-center items-center text-base text-gray-800 dark:text-gray-300 cursor-pointer hover:underline'>+ <span+ onClick={this.onCrashStackClick}+ className='flex justify-center items-center text-base text-gray-800 dark:text-gray-300 cursor-pointer hover:underline'+ >{crashStackShown ? (<>Hide crash stack@@ -99,9 +100,7 @@ class CrashHandler extends React.Component<CrashHandlerProps, CrashHandlerState>)}</span>{crashStackShown && (- <span className='text-sm text-gray-600 dark:text-gray-400 whitespace-pre-line'>- {crashStack}- </span>+ <span className='text-sm text-gray-600 dark:text-gray-400 whitespace-pre-line'>{crashStack}</span>)}</p></div>diff --git a/app/pages/Dashboard/Dashboard.container.tsx b/app/pages/Dashboard/Dashboard.container.tsxindex 1aee5f5d5..458e3c673 100644--- a/app/pages/Dashboard/Dashboard.container.tsx+++ b/app/pages/Dashboard/Dashboard.container.tsx@@ -29,32 +29,42 @@ const mapStateToProps = (state: StateType) => ({const mapDispatchToProps = (dispatch: AppDispatch) => ({deleteProjectFailed: (message: string) => {- dispatch(errorsActions.deleteProjectFailed({- message,- }))+ dispatch(+ errorsActions.deleteProjectFailed({+ message,+ }),+ )},setProjectsShareData: (data: IProject | ISharedProject, id: string, shared?: boolean) => {- dispatch(UIActions.setProjectsShareData({- data,- id,- shared,- }))+ dispatch(+ UIActions.setProjectsShareData({+ data,+ id,+ shared,+ }),+ )},setUserShareData: (data: ISharedProject, id: string) => {- dispatch(authActions.setUserShareData({- data,- id,- }))+ dispatch(+ authActions.setUserShareData({+ data,+ id,+ }),+ )},userSharedUpdate: (message: string) => {- dispatch(alertsActions.userSharedUpdate({- message,- }))+ dispatch(+ alertsActions.userSharedUpdate({+ message,+ }),+ )},sharedProjectError: (message: string) => {- dispatch(errorsActions.sharedProjectFailed({- message,- }))+ dispatch(+ errorsActions.sharedProjectFailed({+ message,+ }),+ )},loadProjects: (take: number, skip: number, search: string) => {dispatch(sagaActions.loadProjects(take, skip, search))diff --git a/app/pages/Dashboard/Dashboard.tsx b/app/pages/Dashboard/Dashboard.tsxindex 349bb75a9..674fcf3c1 100644--- a/app/pages/Dashboard/Dashboard.tsx+++ b/app/pages/Dashboard/Dashboard.tsx@@ -1,7 +1,5 @@/* eslint-disable react/forbid-prop-types */-import React, {- memo, useState, useEffect, useMemo,-} from 'react'+import React, { memo, useState, useEffect, useMemo } from 'react'import { Link, useNavigate } from '@remix-run/react'import { ClientOnly } from 'remix-utils'import cx from 'clsx'@@ -16,7 +14,11 @@ import _filter from 'lodash/filter'import _find from 'lodash/find'import { useTranslation } from 'react-i18next'import {- FolderPlusIcon, AdjustmentsVerticalIcon, ArrowTopRightOnSquareIcon, MagnifyingGlassIcon, XMarkIcon,+ FolderPlusIcon,+ AdjustmentsVerticalIcon,+ ArrowTopRightOnSquareIcon,+ MagnifyingGlassIcon,+ XMarkIcon,} from '@heroicons/react/24/outline'import { XCircleIcon } from '@heroicons/react/24/solid'import { ChevronUpIcon, ChevronDownIcon } from '@heroicons/react/20/solid'@@ -29,8 +31,14 @@ import { Badge } from 'ui/Badge'import routes from 'routesPath'import { nFormatter, calculateRelativePercentage } from 'utils/generic'import {- isSelfhosted, ENTRIES_PER_PAGE_DASHBOARD, tabForOwnedProject, tabForSharedProject,- tabForCaptchaProject, DASHBOARD_TABS, tabsForDashboard, roleViewer,+ isSelfhosted,+ ENTRIES_PER_PAGE_DASHBOARD,+ tabForOwnedProject,+ tabForSharedProject,+ tabForCaptchaProject,+ DASHBOARD_TABS,+ tabsForDashboard,+ roleViewer,} from 'redux/constants'import EventsRunningOutBanner from 'components/EventsRunningOutBanner'import useDebounce from 'hooks/useDebounce'@@ -39,9 +47,7 @@ import { acceptShareProject } from 'api'import Pagination from 'ui/Pagination'import { ISharedProject } from 'redux/models/ISharedProject'-import {- IProject, ICaptchaProject, ILiveStats, IOverall,-} from 'redux/models/IProject'+import { IProject, ICaptchaProject, ILiveStats, IOverall } from 'redux/models/IProject'import { IUser } from 'redux/models/IUser'interface IProjectCard {@@ -49,9 +55,12 @@ interface IProjectCard {active?: booleanbirdseye: IOveralltype: 'analytics' | 'captcha'- t: (key: string, options?: {- [key: string]: string | number | null | undefined- }) => string+ t: (+ key: string,+ options?: {+ [key: string]: string | number | null | undefined+ },+ ) => stringlive?: string | numberisPublic?: booleanconfirmed?: boolean@@ -71,28 +80,25 @@ interface IProjectCard {interface IMiniCard {labelTKey: string- t: (key: string, options?: {- [key: string]: string | number | null | undefined- }) => string+ t: (+ key: string,+ options?: {+ [key: string]: string | number | null | undefined+ },+ ) => stringtotal?: number | stringpercChange?: number}-const MiniCard = ({- labelTKey, t, total, percChange,-}: IMiniCard): JSX.Element => {+const MiniCard = ({ labelTKey, t, total, percChange }: IMiniCard): JSX.Element => {const statsDidGrowUp = percChange ? percChange >= 0 : falsereturn (<div>- <p className='text-sm text-gray-500 dark:text-gray-300'>- {t(labelTKey)}- </p>+ <p className='text-sm text-gray-500 dark:text-gray-300'>{t(labelTKey)}</p><div className='flex font-bold'>- <p className='text-xl text-gray-700 dark:text-gray-100'>- {_isNumber(total) ? nFormatter(total) : total}- </p>+ <p className='text-xl text-gray-700 dark:text-gray-100'>{_isNumber(total) ? nFormatter(total) : total}</p>{_isNumber(percChange) && (<pclassName={cx('flex text-xs items-center', {@@ -103,20 +109,15 @@ const MiniCard = ({{statsDidGrowUp ? (<><ChevronUpIcon className='self-center flex-shrink-0 h-4 w-4 text-green-500' />- <span className='sr-only'>- {t('dashboard.inc')}- </span>+ <span className='sr-only'>{t('dashboard.inc')}</span></>) : (<><ChevronDownIcon className='self-center flex-shrink-0 h-4 w-4 text-red-500' />- <span className='sr-only'>- {t('dashboard.dec')}- </span>+ <span className='sr-only'>{t('dashboard.dec')}</span></>)}- {nFormatter(percChange)}- %+ {nFormatter(percChange)}%</p>)}</div>@@ -130,9 +131,26 @@ MiniCard.defaultProps = {}const ProjectCard = ({- name, active, birdseye, t, live, isPublic, confirmed, id, deleteProjectFailed,- sharedProjects, setProjectsShareData, setUserShareData, shared, userSharedUpdate, sharedProjectError,- captcha, isTransferring, type, getRole, members,+ name,+ active,+ birdseye,+ t,+ live,+ isPublic,+ confirmed,+ id,+ deleteProjectFailed,+ sharedProjects,+ setProjectsShareData,+ setUserShareData,+ shared,+ userSharedUpdate,+ sharedProjectError,+ captcha,+ isTransferring,+ type,+ getRole,+ members,}: IProjectCard): JSX.Element => {const [showInviteModal, setShowInviteModal] = useState(false)const role = useMemo(() => getRole && getRole(id), [getRole, id])@@ -168,9 +186,10 @@ const ProjectCard = ({}return (- <div onClick={() => {- navigate(_replace(type === 'analytics' ? routes.project : routes.captcha, ':id', id))- }}+ <div+ onClick={() => {+ navigate(_replace(type === 'analytics' ? routes.project : routes.captcha, ':id', id))+ }}><lionClick={onElementClick}@@ -178,14 +197,9 @@ const ProjectCard = ({><div className='py-4 px-4'><div className='flex justify-between items-center'>- <p className='text-lg font-semibold text-slate-900 dark:text-gray-50 truncate'>- {name}- </p>-- <div- className='flex items-center gap-2'- onClick={(e) => e.stopPropagation()}- >+ <p className='text-lg font-semibold text-slate-900 dark:text-gray-50 truncate'>{name}</p>++ <div className='flex items-center gap-2' onClick={(e) => e.stopPropagation()}>{role !== roleViewer.role && (<Linkto={_replace(type === 'analytics' ? routes.project_settings : routes.captcha_settings, ':id', id)}@@ -206,49 +220,28 @@ const ProjectCard = ({</div><div className='mt-1 flex-shrink-0 flex gap-2 flex-wrap'>{active ? (- <Badge- colour='green'- label={t('dashboard.active')}- />+ <Badge colour='green' label={t('dashboard.active')} />) : (- <Badge- colour='red'- label={t('dashboard.disabled')}- />+ <Badge colour='red' label={t('dashboard.disabled')} />)}- {shared && (- confirmed ? (- <Badge- colour='green'- label={t('dashboard.shared')}- />+ {shared &&+ (confirmed ? (+ <Badge colour='green' label={t('dashboard.shared')} />) : (- <Badge- colour='yellow'- label={t('common.pending')}- />- )- )}- {isTransferring && (- <Badge- colour='indigo'- label={t('common.transferring')}- />- )}- {isPublic && (- <Badge- colour='green'- label={t('dashboard.public')}- />- )}+ <Badge colour='yellow' label={t('common.pending')} />+ ))}+ {isTransferring && <Badge colour='indigo' label={t('common.transferring')} />}+ {isPublic && <Badge colour='green' label={t('dashboard.public')} />}{_isNumber(members) && (<Badgecolour='slate'- label={members === 1- ? t('common.oneMember')- : t('common.xMembers', {- number: members,- })}+ label={+ members === 1+ ? t('common.oneMember')+ : t('common.xMembers', {+ number: members,+ })+ }/>)}</div>@@ -261,19 +254,18 @@ const ProjectCard = ({percChange={calculateRelativePercentage(birdseye[id].previous.all, birdseye[id].current.all)}/>)}- {!captcha && (- <MiniCard- labelTKey='dashboard.liveVisitors'- t={t}- total={live}- />- )}+ {!captcha && <MiniCard labelTKey='dashboard.liveVisitors' t={t} total={live} />}</div></div>{!confirmed && (<Modal- onClose={() => { setShowInviteModal(false) }}- onSubmit={() => { setShowInviteModal(false); onAccept() }}+ onClose={() => {+ setShowInviteModal(false)+ }}+ onSubmit={() => {+ setShowInviteModal(false)+ onAccept()+ }}submitText={t('common.accept')}type='confirmed'closeText={t('common.cancel')}@@ -318,7 +310,10 @@ const NoProjects = ({ t, onClick }: INoProjects): JSX.Element => ()const AddProject = ({ t, onClick }: INoProjects): JSX.Element => (- <li onClick={onClick} className='flex cursor-pointer justify-center items-center rounded-lg border-2 border-dashed h-auto min-h-[149.1px] lg:min-h-[auto] group border-gray-300 hover:border-gray-400'>+ <li+ onClick={onClick}+ className='flex cursor-pointer justify-center items-center rounded-lg border-2 border-dashed h-auto min-h-[149.1px] lg:min-h-[auto] group border-gray-300 hover:border-gray-400'+ ><div><FolderPlusIcon className='mx-auto h-12 w-12 text-gray-400 dark:text-gray-200 group-hover:text-gray-500 group-hover:dark:text-gray-400' /><span className='mt-2 block text-sm font-semibold text-gray-900 dark:text-gray-50 group-hover:dark:text-gray-400'>@@ -359,16 +354,43 @@ interface DashboardProps {}const Dashboard = ({- projects, isLoading, error, user, deleteProjectFailed, setProjectsShareData,- setUserShareData, userSharedUpdate, sharedProjectError, loadProjects, loadSharedProjects,- total, setDashboardPaginationPage, dashboardPaginationPage, sharedProjects, dashboardTabs,- setDashboardTabs, sharedTotal, setDashboardPaginationPageShared, dashboardPaginationPageShared, captchaProjects, captchaTotal, dashboardPaginationPageCaptcha, setDashboardPaginationPageCaptcha,- loadProjectsCaptcha, liveStats, birdseye,+ projects,+ isLoading,+ error,+ user,+ deleteProjectFailed,+ setProjectsShareData,+ setUserShareData,+ userSharedUpdate,+ sharedProjectError,+ loadProjects,+ loadSharedProjects,+ total,+ setDashboardPaginationPage,+ dashboardPaginationPage,+ sharedProjects,+ dashboardTabs,+ setDashboardTabs,+ sharedTotal,+ setDashboardPaginationPageShared,+ dashboardPaginationPageShared,+ captchaProjects,+ captchaTotal,+ dashboardPaginationPageCaptcha,+ setDashboardPaginationPageCaptcha,+ loadProjectsCaptcha,+ liveStats,+ birdseye,}: DashboardProps): JSX.Element => {- const { t }: {- t: (key: string, options?: {- [key: string]: string | number | null | undefined- }) => string+ const {+ t,+ }: {+ t: (+ key: string,+ options?: {+ [key: string]: string | number | null | undefined+ },+ ) => string} = useTranslation('common')const [isSearchActive, setIsSearchActive] = useState<boolean>(false)const [showActivateEmailModal, setShowActivateEmailModal] = useState<boolean>(false)@@ -377,7 +399,9 @@ const Dashboard = ({const pageAmountShared: number = Math.ceil(sharedTotal / ENTRIES_PER_PAGE_DASHBOARD)const pageAmount: number = Math.ceil(total / ENTRIES_PER_PAGE_DASHBOARD)const pageAmountCaptcha: number = Math.ceil(captchaTotal / ENTRIES_PER_PAGE_DASHBOARD)- const getRole = (pid: string): string | null => (_find([..._map(sharedProjects, (item) => ({ ...item.project, role: item.role }))], p => p.id === pid)?.role || null)+ const getRole = (pid: string): string | null =>+ _find([..._map(sharedProjects, (item) => ({ ...item.project, role: item.role }))], (p) => p.id === pid)?.role ||+ null// This search represents what's inside the search inputconst [search, setSearch] = useState<string>('')const debouncedSearch = useDebounce<string>(search, 500)@@ -409,13 +433,25 @@ const Dashboard = ({useEffect(() => {if (tabProjects === tabForOwnedProject) {- loadProjects(ENTRIES_PER_PAGE_DASHBOARD, (dashboardPaginationPage - 1) * ENTRIES_PER_PAGE_DASHBOARD, debouncedSearch)+ loadProjects(+ ENTRIES_PER_PAGE_DASHBOARD,+ (dashboardPaginationPage - 1) * ENTRIES_PER_PAGE_DASHBOARD,+ debouncedSearch,+ )}if (tabProjects === tabForSharedProject) {- loadSharedProjects(ENTRIES_PER_PAGE_DASHBOARD, (dashboardPaginationPageShared - 1) * ENTRIES_PER_PAGE_DASHBOARD, debouncedSearch)+ loadSharedProjects(+ ENTRIES_PER_PAGE_DASHBOARD,+ (dashboardPaginationPageShared - 1) * ENTRIES_PER_PAGE_DASHBOARD,+ debouncedSearch,+ )}if (tabProjects === tabForCaptchaProject) {- loadProjectsCaptcha(ENTRIES_PER_PAGE_DASHBOARD, (dashboardPaginationPageCaptcha - 1) * ENTRIES_PER_PAGE_DASHBOARD, debouncedSearch)+ loadProjectsCaptcha(+ ENTRIES_PER_PAGE_DASHBOARD,+ (dashboardPaginationPageCaptcha - 1) * ENTRIES_PER_PAGE_DASHBOARD,+ debouncedSearch,+ )}// eslint-disable-next-line react-hooks/exhaustive-deps}, [dashboardPaginationPage, dashboardPaginationPageShared, debouncedSearch])@@ -436,7 +472,6 @@ const Dashboard = ({]}-return [{id: DASHBOARD_TABS.owned,@@ -510,12 +545,12 @@ const Dashboard = ({</h2>{isSearchActive && (<div className='hidden sm:flex items-center pb-1 w-full max-w-md px-2 sm:ml-5'>- <label htmlFor='simple-search' className='sr-only'>Search</label>+ <label htmlFor='simple-search' className='sr-only'>+ Search+ </label><div className='relative w-full'><div className='absolute sm:flex hidden inset-y-0 left-0 items-center pointer-events-none'>- <MagnifyingGlassIcon- className='ml-2 w-5 h-5 text-gray-900 dark:text-gray-50 cursor-pointer hover:opacity-80'- />+ <MagnifyingGlassIcon className='ml-2 w-5 h-5 text-gray-900 dark:text-gray-50 cursor-pointer hover:opacity-80' /></div><inputtype='text'@@ -538,12 +573,12 @@ const Dashboard = ({</div>{isSearchActive && (<div className='flex sm:hidden items-center mb-2 w-full'>- <label htmlFor='simple-search' className='sr-only'>Search</label>+ <label htmlFor='simple-search' className='sr-only'>+ Search+ </label><div className='relative w-full'><div className='absolute flex inset-y-0 left-0 items-center pointer-events-none'>- <MagnifyingGlassIcon- className='ml-2 w-5 h-5 text-gray-900 dark:text-gray-50 cursor-pointer hover:opacity-80'- />+ <MagnifyingGlassIcon className='ml-2 w-5 h-5 text-gray-900 dark:text-gray-50 cursor-pointer hover:opacity-80' /></div><inputtype='text'@@ -587,8 +622,10 @@ const Dashboard = ({type='button'onClick={() => setTabProjects(tab.name)}className={cx('whitespace-nowrap pb-4 px-1 border-b-2 font-medium text-md', {- 'border-slate-900 text-slate-900 dark:text-gray-50 dark:border-gray-50': tabProjects === tab.name,- 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300 dark:text-gray-400 dark:hover:text-gray-300 dark:hover:border-gray-300': tabProjects !== tab.name,+ 'border-slate-900 text-slate-900 dark:text-gray-50 dark:border-gray-50':+ tabProjects === tab.name,+ 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300 dark:text-gray-400 dark:hover:text-gray-300 dark:hover:border-gray-300':+ tabProjects !== tab.name,})}aria-current={tab.name === tabProjects ? 'page' : undefined}>@@ -607,11 +644,11 @@ const Dashboard = ({</div>) : (<ClientOnly- fallback={(+ fallback={<div className='min-h-min-footer bg-gray-50 dark:bg-slate-900'><Loader /></div>- )}+ }>{() => (<>@@ -621,30 +658,31 @@ const Dashboard = ({<NoProjects t={t} onClick={onNewProject} />) : (<ul className='grid grid-cols-1 gap-x-6 gap-y-3 lg:gap-y-6 lg:grid-cols-3'>- {_map(_filter(projects, ({ uiHidden }) => !uiHidden), ({- name, id, active, public: isPublic, isTransferring, share,- }) => (- <ProjectCard- key={id}- members={1 + _size(share)}- id={id}- type='analytics'- t={t}- name={name}- active={active}- isPublic={isPublic}- birdseye={birdseye}- live={_isNumber(liveStats[id]) ? liveStats[id] : 'N/A'}- setUserShareData={() => { }}- deleteProjectFailed={() => { }}- userSharedUpdate={() => { }}- sharedProjects={[]}- setProjectsShareData={() => { }}- sharedProjectError={() => { }}- isTransferring={isTransferring}- confirmed- />- ))}+ {_map(+ _filter(projects, ({ uiHidden }) => !uiHidden),+ ({ name, id, active, public: isPublic, isTransferring, share }) => (+ <ProjectCard+ key={id}+ members={1 + _size(share)}+ id={id}+ type='analytics'+ t={t}+ name={name}+ active={active}+ isPublic={isPublic}+ birdseye={birdseye}+ live={_isNumber(liveStats[id]) ? liveStats[id] : 'N/A'}+ setUserShareData={() => {}}+ deleteProjectFailed={() => {}}+ userSharedUpdate={() => {}}+ sharedProjects={[]}+ setProjectsShareData={() => {}}+ sharedProjectError={() => {}}+ isTransferring={isTransferring}+ confirmed+ />+ ),+ )}<AddProject t={t} onClick={onNewProject} /></ul>)}@@ -657,29 +695,30 @@ const Dashboard = ({<NoProjects t={t} onClick={onNewProject} />) : (<ul className='grid grid-cols-1 gap-x-6 gap-y-3 lg:gap-y-6 lg:grid-cols-3'>- {_map(_filter(captchaProjects, ({ uiHidden }) => !uiHidden), ({- name, id, active, public: isPublic,- }) => (- <ProjectCard- t={t}- key={id}- id={id}- type='captcha'- name={name}- captcha- active={active}- isPublic={isPublic}- birdseye={birdseye}- live={_isNumber(liveStats[id]) ? liveStats[id] : 'N/A'}- deleteProjectFailed={() => { }}- sharedProjects={[]}- setProjectsShareData={() => { }}- setUserShareData={() => { }}- userSharedUpdate={() => { }}- sharedProjectError={() => { }}- confirmed- />- ))}+ {_map(+ _filter(captchaProjects, ({ uiHidden }) => !uiHidden),+ ({ name, id, active, public: isPublic }) => (+ <ProjectCard+ t={t}+ key={id}+ id={id}+ type='captcha'+ name={name}+ captcha+ active={active}+ isPublic={isPublic}+ birdseye={birdseye}+ live={_isNumber(liveStats[id]) ? liveStats[id] : 'N/A'}+ deleteProjectFailed={() => {}}+ sharedProjects={[]}+ setProjectsShareData={() => {}}+ setUserShareData={() => {}}+ userSharedUpdate={() => {}}+ sharedProjectError={() => {}}+ confirmed+ />+ ),+ )}<AddProject t={t} onClick={onNewProject} /></ul>)}@@ -692,57 +731,58 @@ const Dashboard = ({<NoProjects t={t} onClick={onNewProject} />) : (<ul className='grid grid-cols-1 gap-x-6 gap-y-3 lg:gap-y-6 lg:grid-cols-3'>- {_map(_filter(sharedProjects, ({ uiHidden }) => !uiHidden), ({- project, confirmed,- }) => {- if (_isUndefined(confirmed) || confirmed) {+ {_map(+ _filter(sharedProjects, ({ uiHidden }) => !uiHidden),+ ({ project, confirmed }) => {+ if (_isUndefined(confirmed) || confirmed) {+ return (+ <ProjectCard+ t={t}+ key={`${project?.id}-confirmed`}+ type='analytics'+ id={project?.id}+ name={project?.name}+ shared+ getRole={getRole}+ active={project?.active}+ isPublic={project?.public}+ confirmed={confirmed}+ birdseye={birdseye}+ live={_isNumber(liveStats[project.id]) ? liveStats[project.id] : 'N/A'}+ setUserShareData={() => {}}+ deleteProjectFailed={() => {}}+ sharedProjects={[]}+ setProjectsShareData={() => {}}+ userSharedUpdate={() => {}}+ sharedProjectError={() => {}}+ />+ )+ }+return (<ProjectCardt={t}- key={`${project?.id}-confirmed`}- type='analytics'+ key={project?.id}id={project?.id}+ type='analytics'name={project?.name}sharedgetRole={getRole}active={project?.active}isPublic={project?.public}- confirmed={confirmed}birdseye={birdseye}+ confirmed={confirmed}+ sharedProjects={user.sharedProjects}+ setProjectsShareData={setProjectsShareData}+ setUserShareData={setUserShareData}live={_isNumber(liveStats[project.id]) ? liveStats[project.id] : 'N/A'}- setUserShareData={() => { }}- deleteProjectFailed={() => { }}- sharedProjects={[]}- setProjectsShareData={() => { }}- userSharedUpdate={() => { }}- sharedProjectError={() => { }}+ userSharedUpdate={userSharedUpdate}+ sharedProjectError={sharedProjectError}+ deleteProjectFailed={deleteProjectFailed}/>)- }-- return (- <ProjectCard- t={t}- key={project?.id}- id={project?.id}- type='analytics'- name={project?.name}- shared- getRole={getRole}- active={project?.active}- isPublic={project?.public}- birdseye={birdseye}- confirmed={confirmed}- sharedProjects={user.sharedProjects}- setProjectsShareData={setProjectsShareData}- setUserShareData={setUserShareData}- live={_isNumber(liveStats[project.id]) ? liveStats[project.id] : 'N/A'}- userSharedUpdate={userSharedUpdate}- sharedProjectError={sharedProjectError}- deleteProjectFailed={deleteProjectFailed}- />- )- })}+ },+ )}</ul>)}</div>@@ -751,14 +791,32 @@ const Dashboard = ({)}</ClientOnly>)}- {(tabProjects === tabForOwnedProject && pageAmount > 1) && (- <Pagination className='mt-2' page={dashboardPaginationPage} pageAmount={pageAmount} setPage={setDashboardPaginationPage} total={total} />+ {tabProjects === tabForOwnedProject && pageAmount > 1 && (+ <Pagination+ className='mt-2'+ page={dashboardPaginationPage}+ pageAmount={pageAmount}+ setPage={setDashboardPaginationPage}+ total={total}+ />)}- {(tabProjects === tabForSharedProject && pageAmountShared > 1) && (- <Pagination className='mt-2' page={dashboardPaginationPageShared} pageAmount={pageAmountShared} setPage={setDashboardPaginationPageShared} total={sharedTotal} />+ {tabProjects === tabForSharedProject && pageAmountShared > 1 && (+ <Pagination+ className='mt-2'+ page={dashboardPaginationPageShared}+ pageAmount={pageAmountShared}+ setPage={setDashboardPaginationPageShared}+ total={sharedTotal}+ />)}- {(tabProjects === tabForCaptchaProject && pageAmountCaptcha > 1) && (- <Pagination className='mt-2' page={dashboardPaginationPageCaptcha} pageAmount={pageAmountCaptcha} setPage={setDashboardPaginationPageCaptcha} total={captchaTotal} />+ {tabProjects === tabForCaptchaProject && pageAmountCaptcha > 1 && (+ <Pagination+ className='mt-2'+ page={dashboardPaginationPageCaptcha}+ pageAmount={pageAmountCaptcha}+ setPage={setDashboardPaginationPageCaptcha}+ total={captchaTotal}+ />)}</div></div>diff --git a/app/pages/MainPage/Pricing.tsx b/app/pages/MainPage/Pricing.tsxindex 87f3ae889..ac52594fa 100644--- a/app/pages/MainPage/Pricing.tsx+++ b/app/pages/MainPage/Pricing.tsx@@ -15,16 +15,20 @@ import cx from 'clsx'import Modal from 'ui/Modal'import Button from 'ui/Button'import {- CONTACT_EMAIL, paddleLanguageMapping, PLAN_LIMITS, CURRENCIES, BillingFrequency,- REFERRAL_DISCOUNT_CODE, STANDARD_PLANS, TRIAL_DAYS,+ CONTACT_EMAIL,+ paddleLanguageMapping,+ PLAN_LIMITS,+ CURRENCIES,+ BillingFrequency,+ REFERRAL_DISCOUNT_CODE,+ STANDARD_PLANS,+ TRIAL_DAYS,} from 'redux/constants'import { errorsActions } from 'redux/reducers/errors'import { alertsActions } from 'redux/reducers/alerts'import { authActions } from 'redux/reducers/auth'import sagaActions from 'redux/sagas/actions'-import {- authMe, previewSubscriptionUpdate, changeSubscriptionPlan,-} from 'api'+import { authMe, previewSubscriptionUpdate, changeSubscriptionPlan } from 'api'import routes from 'routesPath'import { AppDispatch, StateType } from 'redux/store'import Loader from 'ui/Loader'@@ -44,12 +48,15 @@ const getPaidFeatures = (t: any, tier: any) => {}interface IPricing {- t: (key: string, options?: {- [key: string]: string | number,- }) => string,- language: string,- authenticated: boolean,- isBillingPage?: boolean,+ t: (+ key: string,+ options?: {+ [key: string]: string | number+ },+ ) => string+ language: string+ authenticated: boolean+ isBillingPage?: boolean}const Pricing = ({ t, language, authenticated, isBillingPage }: IPricing) => {@@ -66,10 +73,10 @@ const Pricing = ({ t, language, authenticated, isBillingPage }: IPricing) => {const [newPlanId, setNewPlanId] = useState<number | null>(null)const [isSubUpdating, setIsSubUpdating] = useState<boolean>(false)const [downgradeTo, setDowngradeTo] = useState<{- planCode: string,- name: string,- pid: string,- ypid: string,+ planCode: string+ name: string+ pid: string+ ypid: string} | null>(null)const [showDowngradeModal, setShowDowngradeModal] = useState<boolean>(false)const [billingFrequency, setBillingFrequency] = useState(user?.billingFrequency || BillingFrequency.monthly)@@ -94,9 +101,7 @@ const Pricing = ({ t, language, authenticated, isBillingPage }: IPricing) => {}useEffect(() => {- const lastEventHandler = async (data: {- event: string,- }) => {+ const lastEventHandler = async (data: { event: string }) => {if (_isNil(data)) {return}@@ -114,9 +119,11 @@ const Pricing = ({ t, language, authenticated, isBillingPage }: IPricing) => {dispatch(sagaActions.logout(false, false))}- dispatch(alertsActions.accountUpdated({- message: t('apiNotifications.subscriptionUpdated'),- }))+ dispatch(+ alertsActions.accountUpdated({+ message: t('apiNotifications.subscriptionUpdated'),+ }),+ )}, 3000)setPlanCodeLoading(null)setDowngradeTo(null)@@ -136,20 +143,21 @@ const Pricing = ({ t, language, authenticated, isBillingPage }: IPricing) => {setSubUpdatePreview(preview)} catch (reason) {console.error('[ERROR] An error occured while loading subscription update pricing preview:', reason)- dispatch(errorsActions.genericError({- message: 'An error occured while loading subscription update pricing preview',- }))+ dispatch(+ errorsActions.genericError({+ message: 'An error occured while loading subscription update pricing preview',+ }),+ )setSubUpdatePreview(false)}}- const onPlanChange = async (tier: {- planCode: string,- name: string,- pid: string,- ypid: string,- }) => {- if (planCodeLoading === null && (user.planCode !== tier.planCode || (user.billingFrequency !== billingFrequency && user.planCode !== 'free' && user.planCode !== 'trial'))) {+ const onPlanChange = async (tier: { planCode: string; name: string; pid: string; ypid: string }) => {+ if (+ planCodeLoading === null &&+ (user.planCode !== tier.planCode ||+ (user.billingFrequency !== billingFrequency && user.planCode !== 'free' && user.planCode !== 'trial'))+ ) {if (user.subID && user.planCode !== 'none') {const planId = Number(billingFrequency === BillingFrequency.monthly ? tier.pid : tier.ypid)setNewPlanId(planId)@@ -161,14 +169,17 @@ const Pricing = ({ t, language, authenticated, isBillingPage }: IPricing) => {// @ts-ignoreif (!window.Paddle) {- dispatch(errorsActions.genericError({- message: 'Payment script has not yet loaded! Please, try again.',- }))+ dispatch(+ errorsActions.genericError({+ message: 'Payment script has not yet loaded! Please, try again.',+ }),+ )setPlanCodeLoading(null)return}- const discountMayBeApplied = user.referrerID && (user.planCode === 'trial' || user.planCode === 'none') && !user.cancellationEffectiveDate+ const discountMayBeApplied =+ user.referrerID && (user.planCode === 'trial' || user.planCode === 'none') && !user.cancellationEffectiveDateconst coupon = discountMayBeApplied ? REFERRAL_DISCOUNT_CODE : undefined// @ts-ignore@@ -214,25 +225,24 @@ const Pricing = ({ t, language, authenticated, isBillingPage }: IPricing) => {dispatch(sagaActions.logout(false, false))}- dispatch(alertsActions.accountUpdated({- message: t('apiNotifications.subscriptionUpdated'),- }))+ dispatch(+ alertsActions.accountUpdated({+ message: t('apiNotifications.subscriptionUpdated'),+ }),+ )closeUpdateModal(true)} catch (reason) {console.error('[ERROR] An error occured while updating subscription:', reason)- dispatch(errorsActions.genericError({- message: 'An error occured while updating subscription',- }))+ dispatch(+ errorsActions.genericError({+ message: 'An error occured while updating subscription',+ }),+ )closeUpdateModal(true)}}- const downgradeHandler = (tier: {- planCode: string,- name: string,- pid: string,- ypid: string,- }) => {+ const downgradeHandler = (tier: { planCode: string; name: string; pid: string; ypid: string }) => {if (planCodeLoading === null && user.planCode !== tier.planCode) {setDowngradeTo(tier)setShowDowngradeModal(true)@@ -250,7 +260,12 @@ const Pricing = ({ t, language, authenticated, isBillingPage }: IPricing) => {action = t('pricing.upgrade')} else if (downgrade) {action = t('pricing.downgrade')- } else if (user.billingFrequency === billingFrequency || user.planCode === 'free' || user.planCode === 'trial' || user.planCode === 'none') {+ } else if (+ user.billingFrequency === billingFrequency ||+ user.planCode === 'free' ||+ user.planCode === 'trial' ||+ user.planCode === 'none'+ ) {action = t('pricing.yourPlan')} else if (billingFrequency === BillingFrequency.monthly) {action = t('pricing.switchToMonthly')@@ -266,7 +281,7 @@ const Pricing = ({ t, language, authenticated, isBillingPage }: IPricing) => {'px-4 sm:px-6 lg:px-8 py-24': !authenticated,'mx-auto': !isBillingPage,})}- >+ ><div className='sm:flex sm:flex-col sm:align-center'>{!authenticated && (<>@@ -285,9 +300,7 @@ const Pricing = ({ t, language, authenticated, isBillingPage }: IPricing) => {<h3 className='text-lg font-medium text-gray-900 dark:text-gray-50 tracking-tight'>{selectedTier.monthlyUsageLimit.toLocaleString('en-US')}</h3>- <p className='text-gray-700 dark:text-gray-200'>- {t('pricing.eventPerMonth')}- </p>+ <p className='text-gray-700 dark:text-gray-200'>{t('pricing.eventPerMonth')}</p></div><div className='flex justify-center'><RadioGroup@@ -295,9 +308,7 @@ const Pricing = ({ t, language, authenticated, isBillingPage }: IPricing) => {onChange={setBillingFrequency}className='grid grid-cols-2 gap-x-1 rounded-md p-1 text-center text-xs font-semibold leading-5 ring-1 ring-inset ring-gray-200 dark:ring-slate-700'>- <RadioGroup.Label className='sr-only'>- {t('pricing.frequency')}- </RadioGroup.Label>+ <RadioGroup.Label className='sr-only'>{t('pricing.frequency')}</RadioGroup.Label><RadioGroup.Optionkey={BillingFrequency.monthly}value={BillingFrequency.monthly}@@ -308,9 +319,7 @@ const Pricing = ({ t, language, authenticated, isBillingPage }: IPricing) => {)}>- <span>- {t('pricing.monthlyBilling')}- </span>+ <span>{t('pricing.monthlyBilling')}</span></RadioGroup.Option><RadioGroup.Optionkey={BillingFrequency.yearly}@@ -322,9 +331,7 @@ const Pricing = ({ t, language, authenticated, isBillingPage }: IPricing) => {)}>- <span>- {t('pricing.yearlyBilling')}- </span>+ <span>{t('pricing.yearlyBilling')}</span></RadioGroup.Option></RadioGroup></div>@@ -368,22 +375,30 @@ const Pricing = ({ t, language, authenticated, isBillingPage }: IPricing) => {<p className='mt-2 sm:mt-0'><span className='text-4xl font-bold text-[#4D4D4D] dark:text-gray-50'>{currency.symbol}- {billingFrequency === BillingFrequency.monthly ? selectedTier.price[currencyCode]?.monthly : selectedTier.price[currencyCode]?.yearly}+ {billingFrequency === BillingFrequency.monthly+ ? selectedTier.price[currencyCode]?.monthly+ : selectedTier.price[currencyCode]?.yearly}</span> <span className='text-base font-medium text-gray-500 dark:text-gray-400'>- /- {t(billingFrequency === BillingFrequency.monthly ? 'pricing.perMonth' : 'pricing.perYear')}+ /{t(billingFrequency === BillingFrequency.monthly ? 'pricing.perMonth' : 'pricing.perYear')}</span></p>{authenticated ? (<Button- onClick={() => downgrade ? downgradeHandler(selectedTier) : onPlanChange(selectedTier)}+ onClick={() => (downgrade ? downgradeHandler(selectedTier) : onPlanChange(selectedTier))}type='button'className='mt-2 sm:mt-0'loading={planCodeLoading === selectedTier.planCode}- disabled={planCodeLoading !== null || (selectedTier.planCode === user.planCode && (user.billingFrequency === billingFrequency || user.planCode === 'free' || user.planCode === 'trial' || user.planCode === 'none'))}+ disabled={+ planCodeLoading !== null ||+ (selectedTier.planCode === user.planCode &&+ (user.billingFrequency === billingFrequency ||+ user.planCode === 'free' ||+ user.planCode === 'trial' ||+ user.planCode === 'none'))+ }primarylarge>@@ -430,7 +445,13 @@ const Pricing = ({ t, language, authenticated, isBillingPage }: IPricing) => {}}// @ts-ignorecomponents={{- url: <Link to={routes.contact} className='font-semibold leading-6 text-indigo-600 hover:text-indigo-500 dark:text-indigo-400 dark:hover:text-indigo-500' aria-label={t('footer.tos')} />,+ url: (+ <Link+ to={routes.contact}+ className='font-semibold leading-6 text-indigo-600 hover:text-indigo-500 dark:text-indigo-400 dark:hover:text-indigo-500'+ aria-label={t('footer.tos')}+ />+ ),}}/></p>@@ -452,7 +473,7 @@ const Pricing = ({ t, language, authenticated, isBillingPage }: IPricing) => {closeText={t('common.no')}title={t('pricing.downgradeTitle')}type='warning'- message={(+ message={<Trans// @ts-ignoret={t}@@ -461,7 +482,7 @@ const Pricing = ({ t, language, authenticated, isBillingPage }: IPricing) => {email: CONTACT_EMAIL,}}/>- )}+ }isOpened={showDowngradeModal}/><Modal@@ -473,11 +494,9 @@ const Pricing = ({ t, language, authenticated, isBillingPage }: IPricing) => {submitType='regular'type='info'isLoading={isSubUpdating}- message={(+ message={<>- {subUpdatePreview === null && (- <Loader />- )}+ {subUpdatePreview === null && <Loader />}{subUpdatePreview === false && (<p className='whitespace-pre-line'><Trans@@ -488,27 +507,35 @@ const Pricing = ({ t, language, authenticated, isBillingPage }: IPricing) => {email: CONTACT_EMAIL,}}components={{- mail: <a title={`Email us at ${CONTACT_EMAIL}`} href={`mailto:${CONTACT_EMAIL}`} className='font-medium text-indigo-600 hover:text-indigo-500 dark:text-indigo-400' />,+ mail: (+ <a+ title={`Email us at ${CONTACT_EMAIL}`}+ href={`mailto:${CONTACT_EMAIL}`}+ className='font-medium text-indigo-600 hover:text-indigo-500 dark:text-indigo-400'+ />+ ),}}/></p>)}{subUpdatePreview && (<div>- <h2 className='text-base font-bold'>- {t('billing.dueNow')}- </h2>- <p className='text-sm'>- {t('billing.dueNowDescription')}- </p>+ <h2 className='text-base font-bold'>{t('billing.dueNow')}</h2>+ <p className='text-sm'>{t('billing.dueNowDescription')}</p><div className='overflow-hidden shadow ring-1 ring-black ring-opacity-5 md:rounded-lg mt-2'><table className='min-w-full divide-y divide-gray-300 200 dark:divide-gray-500'><thead className='bg-gray-50 dark:bg-slate-800'><tr>- <th scope='col' className='py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 dark:text-gray-50 sm:pl-6'>+ <th+ scope='col'+ className='py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 dark:text-gray-50 sm:pl-6'+ >{t('common.amount')}</th>- <th scope='col' className='px-3 py-3.5 text-left text-sm font-semibold text-gray-900 dark:text-gray-50'>+ <th+ scope='col'+ className='px-3 py-3.5 text-left text-sm font-semibold text-gray-900 dark:text-gray-50'+ >{t('common.date')}</th></tr>@@ -532,22 +559,29 @@ const Pricing = ({ t, language, authenticated, isBillingPage }: IPricing) => {{t('billing.negativePayment', {currency: subUpdatePreview.immediatePayment.symbol,dueNowAmount: -subUpdatePreview.immediatePayment.amount,- dueNowDate: language === 'en' ? dayjs(subUpdatePreview.immediatePayment.date).locale(language).format('MMMM D, YYYY') : dayjs(subUpdatePreview.immediatePayment.date).locale(language).format('D MMMM, YYYY'),+ dueNowDate:+ language === 'en'+ ? dayjs(subUpdatePreview.immediatePayment.date).locale(language).format('MMMM D, YYYY')+ : dayjs(subUpdatePreview.immediatePayment.date).locale(language).format('D MMMM, YYYY'),nextPaymentAmount: subUpdatePreview.nextPayment.amount,})}</p>)}- <h2 className='text-base font-bold mt-5'>- {t('billing.nextPayment')}- </h2>+ <h2 className='text-base font-bold mt-5'>{t('billing.nextPayment')}</h2><div className='overflow-hidden shadow ring-1 ring-black ring-opacity-5 md:rounded-lg mt-2'><table className='min-w-full divide-y divide-gray-300 200 dark:divide-gray-500'><thead className='bg-gray-50 dark:bg-slate-800'><tr>- <th scope='col' className='py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 dark:text-gray-50 sm:pl-6'>+ <th+ scope='col'+ className='py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 dark:text-gray-50 sm:pl-6'+ >{t('common.amount')}</th>- <th scope='col' className='px-3 py-3.5 text-left text-sm font-semibold text-gray-900 dark:text-gray-50'>+ <th+ scope='col'+ className='px-3 py-3.5 text-left text-sm font-semibold text-gray-900 dark:text-gray-50'+ >{t('common.date')}</th></tr>@@ -569,7 +603,7 @@ const Pricing = ({ t, language, authenticated, isBillingPage }: IPricing) => {</div>)}</>- )}+ }isOpened={isNewPlanConfirmationModalOpened}/></>diff --git a/app/pages/MainPage/index.tsx b/app/pages/MainPage/index.tsxindex 4ab1b739b..4c62c90d7 100644--- a/app/pages/MainPage/index.tsx+++ b/app/pages/MainPage/index.tsx@@ -5,10 +5,20 @@ import cx from 'clsx'import { useSelector } from 'react-redux'import { ClientOnly } from 'remix-utils'import {- ArrowTopRightOnSquareIcon, ArrowSmallRightIcon, CheckCircleIcon, CheckIcon, XMarkIcon, ChevronRightIcon,+ ArrowTopRightOnSquareIcon,+ ArrowSmallRightIcon,+ CheckCircleIcon,+ CheckIcon,+ XMarkIcon,+ ChevronRightIcon,} from '@heroicons/react/24/solid'import {- CodeBracketIcon, PuzzlePieceIcon, ShareIcon, ArrowsPointingOutIcon, LightBulbIcon, ArrowTrendingUpIcon,+ CodeBracketIcon,+ PuzzlePieceIcon,+ ShareIcon,+ ArrowsPointingOutIcon,+ LightBulbIcon,+ ArrowTrendingUpIcon,} from '@heroicons/react/20/solid'import { TypeAnimation } from 'react-type-animation'import _map from 'lodash/map'@@ -18,9 +28,7 @@ import _isEmpty from 'lodash/isEmpty'import routesPath from 'routesPath'import { getAccessToken } from 'utils/accessToken'import { nFormatterSeparated } from 'utils/generic'-import {- GITHUB_URL, MARKETPLACE_URL, LIVE_DEMO_URL, isBrowser,-} from 'redux/constants'+import { GITHUB_URL, MARKETPLACE_URL, LIVE_DEMO_URL, isBrowser } from 'redux/constants'import { StateType } from 'redux/store/index'import BackgroundSvg from 'ui/icons/BackgroundSvg'import Webflow from 'ui/icons/Webflow'@@ -44,11 +52,15 @@ import Pricing from './Pricing'const COMPETITORS_LIST = ['Google Analytics', 'Fathom', 'Plausible', 'Simple Analytics']const SWETRIX_AND_COMPETITORS_LIST = ['Swetrix', ...COMPETITORS_LIST]const COMPETITOR_SEQUENCE_DELAY = 5000 // in milliseconds-const processedList = _reduce(COMPETITORS_LIST, (acc: any[], curr: any) => {- acc.push(curr)- acc.push(COMPETITOR_SEQUENCE_DELAY)- return acc-}, [])+const processedList = _reduce(+ COMPETITORS_LIST,+ (acc: any[], curr: any) => {+ acc.push(curr)+ acc.push(COMPETITOR_SEQUENCE_DELAY)+ return acc+ },+ [],+)// The order in the table is defined by the Swetrix objectconst COMPETITOR_FEATURE_TABLE: {@@ -155,25 +167,26 @@ interface IMain {}const Main: React.FC<IMain> = ({ ssrTheme, ssrAuthenticated }): JSX.Element => {- const { t, i18n: { language } }: {- t: (key: string, options?: {- [key: string]: any- }) => string,+ const {+ t,+ i18n: { language },+ }: {+ t: (+ key: string,+ options?: {+ [key: string]: any+ },+ ) => stringi18n: {language: string- },+ }} = useTranslation('common')const reduxTheme = useSelector((state: StateType) => state.ui.theme.theme)- const {- authenticated: reduxAuthenticated,- loading,- } = useSelector((state: StateType) => state.auth)+ const { authenticated: reduxAuthenticated, loading } = useSelector((state: StateType) => state.auth)const { stats, lastBlogPost } = useSelector((state: StateType) => state.ui.misc)const theme = isBrowser ? reduxTheme : ssrThemeconst accessToken = getAccessToken()- const authenticated = isBrowser- ? (loading ? !!accessToken : reduxAuthenticated)- : ssrAuthenticated+ const authenticated = isBrowser ? (loading ? !!accessToken : reduxAuthenticated) : ssrAuthenticatedconst events = nFormatterSeparated(Number(stats.events))const users = nFormatterSeparated(Number(stats.users))@@ -189,14 +202,7 @@ const Main: React.FC<IMain> = ({ ssrTheme, ssrAuthenticated }): JSX.Element => {aria-hidden='true'><defs>- <pattern- id='rect-pattern'- width={200}- height={200}- x='50%'- y={-1}- patternUnits='userSpaceOnUse'- >+ <pattern id='rect-pattern' width={200} height={200} x='50%' y={-1} patternUnits='userSpaceOnUse'><path d='M.5 200V.5H200' fill='none' /></pattern></defs>@@ -232,9 +238,7 @@ const Main: React.FC<IMain> = ({ ssrTheme, ssrAuthenticated }): JSX.Element => {</a><ArrowTopRightOnSquareIcon className='h-4 w-4 text-slate-800 dark:text-white ml-1 hidden md:block' /></div>- <div- className='relative pt-10 lg:pt-24 pb-5 xl:px-8 lg:px-6 sm:px-3 mx-auto min-h-[740px]'- >+ <div className='relative pt-10 lg:pt-24 pb-5 xl:px-8 lg:px-6 sm:px-3 mx-auto min-h-[740px]'><div className='relative z-20 flex flex-row content-between 2xl:mr-[14vw] 2xl:justify-center justify-center lg:justify-start'><div className='lg:mt-0 text-left relative lg:mr-14 px-4'><h1 className='max-w-2xl text-3xl sm:text-5xl md:text-5xl font-extrabold text-slate-900 dark:text-white sm:leading-none lg:text-5xl xl:text-6xl xl:leading-[110%]'>@@ -243,7 +247,9 @@ const Main: React.FC<IMain> = ({ ssrTheme, ssrAuthenticated }): JSX.Element => {t={t}i18nKey='main.slogan'components={{- span: <span className='from-indigo-700 to-indigo-700 dark:from-indigo-600 dark:to-indigo-400 text-transparent bg-clip-text bg-gradient-to-r' />,+ span: (+ <span className='from-indigo-700 to-indigo-700 dark:from-indigo-600 dark:to-indigo-400 text-transparent bg-clip-text bg-gradient-to-r' />+ ),}}/></h1>@@ -254,15 +260,17 @@ const Main: React.FC<IMain> = ({ ssrTheme, ssrAuthenticated }): JSX.Element => {{_isEmpty(lastBlogPost) ? (<div className='h-6 ml-1 bg-slate-300 dark:bg-slate-700 w-full max-w-xs rounded-md animate-pulse' />) : (- <ClientOnly fallback={<div className='h-6 ml-1 bg-slate-300 dark:bg-slate-700 w-full max-w-xs rounded-md animate-pulse' />}>+ <ClientOnly+ fallback={+ <div className='h-6 ml-1 bg-slate-300 dark:bg-slate-700 w-full max-w-xs rounded-md animate-pulse' />+ }+ >{() => (<LinkclassName='inline-flex ml-1 items-center space-x-1 text-sm font-semibold leading-6 text-slate-700 dark:text-slate-300 hover:underline'to={`blog/${lastBlogPost.handle}`}>- <small className='text-sm'>- {lastBlogPost.title}- </small>+ <small className='text-sm'>{lastBlogPost.title}</small><ChevronRightIcon className='h-4 w-4 text-slate-500' aria-hidden='true' /></Link>)}@@ -280,9 +288,7 @@ const Main: React.FC<IMain> = ({ ssrTheme, ssrAuthenticated }): JSX.Element => {className='rounded-md !duration-300 transition-all w-full sm:max-w-[210px] h-12 flex items-center justify-center sm:mr-6 shadow-sm ring-1 text-white bg-slate-900 ring-slate-900 hover:bg-slate-700 dark:bg-indigo-700 dark:ring-indigo-700 dark:hover:bg-indigo-600'aria-label={t('titles.signup')}>- <span className='text-base font-semibold mr-1'>- {t('common.getStarted')}- </span>+ <span className='text-base font-semibold mr-1'>{t('common.getStarted')}</span><ArrowSmallRightIcon className='h-4 w-5 mt-[1px]' /></Link><a@@ -299,7 +305,10 @@ const Main: React.FC<IMain> = ({ ssrTheme, ssrAuthenticated }): JSX.Element => {<div className='max-w-md xl:max-w-lg hidden lg:block'><Lines /><picture>- <source srcSet={theme === 'dark' ? '/assets/screenshot_dark.webp' : '/assets/screenshot_light.webp'} type='image/webp' />+ <source+ srcSet={theme === 'dark' ? '/assets/screenshot_dark.webp' : '/assets/screenshot_light.webp'}+ type='image/webp'+ /><imgsrc={theme === 'dark' ? '/assets/screenshot_dark.png' : '/assets/screenshot_light.png'}className='h-full min-w-[880px] rounded-xl relative shadow-2xl ring-1 ring-gray-900/10 dark:ring-white/10'@@ -312,7 +321,10 @@ const Main: React.FC<IMain> = ({ ssrTheme, ssrAuthenticated }): JSX.Element => {</div><div className='my-10 block lg:hidden relative z-20 px-4 md:px-0'><picture>- <source srcSet={theme === 'dark' ? '/assets/screenshot_dark.webp' : '/assets/screenshot_light.webp'} type='image/webp' />+ <source+ srcSet={theme === 'dark' ? '/assets/screenshot_dark.webp' : '/assets/screenshot_light.webp'}+ type='image/webp'+ /><imgsrc={theme === 'dark' ? '/assets/screenshot_dark.png' : '/assets/screenshot_light.png'}className='rounded-xl relative shadow-2xl w-full ring-1 ring-gray-900/10 dark:ring-white/10'@@ -327,7 +339,10 @@ const Main: React.FC<IMain> = ({ ssrTheme, ssrAuthenticated }): JSX.Element => {{/* end first block with live demo */}{/* section Core Analytics Features */}<div className='dark:bg-slate-900 bg-white px-4 pb-24'>- <section id='core-analytics' className='flex pt-16 md:pt-48 flex-col-reverse md:flex-row items-center md:items-start md:justify-between max-w-7xl m-auto'>+ <section+ id='core-analytics'+ className='flex pt-16 md:pt-48 flex-col-reverse md:flex-row items-center md:items-start md:justify-between max-w-7xl m-auto'+ ><picture><sourcesrcSet={theme === 'dark' ? '/assets/CoreFeaturesDark.webp' : '/assets/CoreFeaturesLight.webp'}@@ -342,12 +357,8 @@ const Main: React.FC<IMain> = ({ ssrTheme, ssrAuthenticated }): JSX.Element => {/></picture><div className='max-w-lg md:ml-5'>- <h2 className='font-extrabold text-4xl dark:text-white text-slate-900'>- {t('main.coreFeatures.title')}- </h2>- <p className='mt-6 dark:text-gray-400 text-gray-600 mb-6'>- {t('main.coreFeatures.desc')}- </p>+ <h2 className='font-extrabold text-4xl dark:text-white text-slate-900'>{t('main.coreFeatures.title')}</h2>+ <p className='mt-6 dark:text-gray-400 text-gray-600 mb-6'>{t('main.coreFeatures.desc')}</p><ahref={LIVE_DEMO_URL}className='dark:text-indigo-400 text-indigo-700 hover:underline font-bold border-0 flex items-center'@@ -364,15 +375,9 @@ const Main: React.FC<IMain> = ({ ssrTheme, ssrAuthenticated }): JSX.Element => {{/* section Marketplace & built-in Extensions */}<section className='flex flex-col md:flex-row items-center md:justify-between max-w-7xl m-auto'><div className='max-w-[516px]'>- <h2 className='font-extrabold text-4xl text-slate-900 dark:text-white'>- {t('main.marketplace.title')}- </h2>- <p className='mt-6 text-gray-600 dark:text-gray-400 mb-3'>- {t('main.marketplace.desc1')}- </p>- <p className='text-gray-600 dark:text-gray-400 mb-6'>- {t('main.marketplace.desc2')}- </p>+ <h2 className='font-extrabold text-4xl text-slate-900 dark:text-white'>{t('main.marketplace.title')}</h2>+ <p className='mt-6 text-gray-600 dark:text-gray-400 mb-3'>{t('main.marketplace.desc1')}</p>+ <p className='text-gray-600 dark:text-gray-400 mb-6'>{t('main.marketplace.desc2')}</p><ahref={MARKETPLACE_URL}className='dark:text-indigo-400 text-indigo-700 hover:underline font-bold border-0 flex items-center'@@ -403,13 +408,8 @@ const Main: React.FC<IMain> = ({ ssrTheme, ssrAuthenticated }): JSX.Element => {alt='GDPR compliant'/><div className='max-w-[516px] w-full md:min-w-[370px] pb-16 md:pb-0 md:pt-8'>- <h2 className='font-extrabold mb-6 text-4xl text-slate-900 dark:text-white'>- {t('main.privacy.title')}- </h2>- {_map(t('main.privacy.list', { returnObjects: true }), (item: {- label: string- desc: string- }) => (+ <h2 className='font-extrabold mb-6 text-4xl text-slate-900 dark:text-white'>{t('main.privacy.title')}</h2>+ {_map(t('main.privacy.list', { returnObjects: true }), (item: { label: string; desc: string }) => (<div key={item.label} className='mb-4 flex items-center'><div className='mr-3'><CheckCircleIcon className='fill-indigo-500 w-[24px] h-[24px]' />@@ -422,7 +422,11 @@ const Main: React.FC<IMain> = ({ ssrTheme, ssrAuthenticated }): JSX.Element => {</div>))}{/* mt-7 because mb-4 in upper component + mt-7 = 11. mb-11 is used for spacing the links in other sections. */}- <Link to={routesPath.privacy} className='mt-7 dark:text-indigo-400 text-indigo-700 hover:underline font-bold border-0 flex items-center' aria-label={t('footer.pp')}>+ <Link+ to={routesPath.privacy}+ className='mt-7 dark:text-indigo-400 text-indigo-700 hover:underline font-bold border-0 flex items-center'+ aria-label={t('footer.pp')}+ >{t('main.dataProtection')}<ArrowSmallRightIcon className='w-5 h-4 mt-[1px]' /></Link>@@ -465,9 +469,21 @@ const Main: React.FC<IMain> = ({ ssrTheme, ssrAuthenticated }): JSX.Element => {i18nKey='main.signupTerms'components={{// eslint-disable-next-line jsx-a11y/anchor-has-content- tos: <Link to={routesPath.terms} className='font-medium text-gray-900 dark:text-gray-300 hover:underline' aria-label={t('footer.tos')} />,+ tos: (+ <Link+ to={routesPath.terms}+ className='font-medium text-gray-900 dark:text-gray-300 hover:underline'+ aria-label={t('footer.tos')}+ />+ ),// eslint-disable-next-line jsx-a11y/anchor-has-content- pp: <Link to={routesPath.privacy} className='font-medium text-gray-900 dark:text-gray-300 hover:underline' aria-label={t('footer.pp')} />,+ pp: (+ <Link+ to={routesPath.privacy}+ className='font-medium text-gray-900 dark:text-gray-300 hover:underline'+ aria-label={t('footer.pp')}+ />+ ),}}/></p>@@ -477,7 +493,10 @@ const Main: React.FC<IMain> = ({ ssrTheme, ssrAuthenticated }): JSX.Element => {</div><div className='relative'><picture>- <source srcSet={theme === 'dark' ? '/assets/section-signup-dark.webp' : '/assets/section-signup-light.webp'} type='image/webp' />+ <source+ srcSet={theme === 'dark' ? '/assets/section-signup-dark.webp' : '/assets/section-signup-light.webp'}+ type='image/webp'+ /><imgsrc={theme === 'dark' ? '/assets/section-signup-dark.png' : '/assets/section-signup-light.png'}className='relative z-50 hidden md:block'@@ -495,24 +514,34 @@ const Main: React.FC<IMain> = ({ ssrTheme, ssrAuthenticated }): JSX.Element => {<section className='bg-white dark:bg-slate-900 pt-14 relative pb-14'><BackgroundSvg theme={theme} className='absolute -left-8' type='shapes' /><div className='mx-auto text-slate-900 font-extrabold text-3xl sm:text-5xl w-fit relative'>- <h2 className='relative z-20 dark:text-white'>- {t('main.coreFeaturesBlock')}- </h2>- <BackgroundSvg theme={theme} className='absolute right-0 sm:-right-16 top-9 z-10 opacity-30' type='semicircle' />+ <h2 className='relative z-20 dark:text-white'>{t('main.coreFeaturesBlock')}</h2>+ <BackgroundSvg+ theme={theme}+ className='absolute right-0 sm:-right-16 top-9 z-10 opacity-30'+ type='semicircle'+ /></div><div className='mt-[60px] flex items-center max-w-7xl w-full mx-auto flex-wrap justify-center xl:justify-between'>- {_map(t('main.features', { returnObjects: true }), (item: {- name: string- desc: string- }, index: number) => (- <div key={item.name} className='w-[416px] h-64 px-7 py-11 text-center'>- <span className='text-indigo-500 text-3xl font-semibold'>{1 + index}</span>- <div className='mt-2'>- <h2 className='text-slate-900 dark:text-white text-xl font-semibold max-w-[300px] mx-auto mb-3 whitespace-pre-line'>{item.name}</h2>- <p className='text-gray-600 max-w-xs mx-auto dark:text-gray-400'>{item.desc}</p>+ {_map(+ t('main.features', { returnObjects: true }),+ (+ item: {+ name: string+ desc: string+ },+ index: number,+ ) => (+ <div key={item.name} className='w-[416px] h-64 px-7 py-11 text-center'>+ <span className='text-indigo-500 text-3xl font-semibold'>{1 + index}</span>+ <div className='mt-2'>+ <h2 className='text-slate-900 dark:text-white text-xl font-semibold max-w-[300px] mx-auto mb-3 whitespace-pre-line'>+ {item.name}+ </h2>+ <p className='text-gray-600 max-w-xs mx-auto dark:text-gray-400'>{item.desc}</p>+ </div></div>- </div>- ))}+ ),+ )}</div><BackgroundSvg theme={theme} className='absolute right-0 bottom-0 z-10' type='twolinecircle' /></section>@@ -546,14 +575,7 @@ const Main: React.FC<IMain> = ({ ssrTheme, ssrAuthenticated }): JSX.Element => {aria-hidden='true'><defs>- <pattern- id='rect-pattern-2'- width={200}- height={200}- x='50%'- y={0}- patternUnits='userSpaceOnUse'- >+ <pattern id='rect-pattern-2' width={200} height={200} x='50%' y={0} patternUnits='userSpaceOnUse'><path d='M.5 200V.5H200' fill='none' /></pattern></defs>@@ -570,22 +592,26 @@ const Main: React.FC<IMain> = ({ ssrTheme, ssrAuthenticated }): JSX.Element => {{t('main.marketplaceBlock')}</h2><div className='grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-y-10 sm:gap-y-24 justify-between justify-items-center text-slate-900 dark:text-white pt-20 pb-36'>- {_map(t('main.mFeatures', { returnObjects: true }), (item: {- name: string- desc: string- }, index: number) => (- <div key={item.name} className='max-w-[310px] w-full'>- <div className='flex items-center'>- <span className='text-slate-900 dark:text-gray-200 text-xl mr-4'>- {M_FEATURES_ICONS[index]}- </span>- <h2 className='font-semibold text-xl'>- {item.name}- </h2>+ {_map(+ t('main.mFeatures', { returnObjects: true }),+ (+ item: {+ name: string+ desc: string+ },+ index: number,+ ) => (+ <div key={item.name} className='max-w-[310px] w-full'>+ <div className='flex items-center'>+ <span className='text-slate-900 dark:text-gray-200 text-xl mr-4'>+ {M_FEATURES_ICONS[index]}+ </span>+ <h2 className='font-semibold text-xl'>{item.name}</h2>+ </div>+ <p className='pl-9 text-slate-700 dark:text-gray-300'>{item.desc}</p></div>- <p className='pl-9 text-slate-700 dark:text-gray-300'>{item.desc}</p>- </div>- ))}+ ),+ )}</div></section></div>@@ -593,9 +619,7 @@ const Main: React.FC<IMain> = ({ ssrTheme, ssrAuthenticated }): JSX.Element => {{/* end Marketplace and extension features */}{/* For now let's hide Pricing for authenticated users on the main page as the Paddle script only loads on the Billing page */}- {!authenticated && (- <Pricing authenticated={false} t={t} language={language} />- )}+ {!authenticated && <Pricing authenticated={false} t={t} language={language} />}{/* section: Why use Swetrix when there is .... */}<div className='overflow-hidden'>@@ -678,15 +702,19 @@ const Main: React.FC<IMain> = ({ ssrTheme, ssrAuthenticated }): JSX.Element => {className='w-1/6 px-3 py-4 text-sm text-gray-50 sm:pl-6'>{COMPETITOR_FEATURE_TABLE[service][key] && (- <CheckIcon className='flex-shrink-0 h-5 w-5 text-green-600 dark:text-green-500' aria-label={t('common.yes')} />+ <CheckIcon+ className='flex-shrink-0 h-5 w-5 text-green-600 dark:text-green-500'+ aria-label={t('common.yes')}+ />)}{COMPETITOR_FEATURE_TABLE[service][key] === false && (- <XMarkIcon className='flex-shrink-0 h-5 w-5 text-red-600 dark:text-red-500' aria-label={t('common.no')} />+ <XMarkIcon+ className='flex-shrink-0 h-5 w-5 text-red-600 dark:text-red-500'+ aria-label={t('common.no')}+ />)}{COMPETITOR_FEATURE_TABLE[service][key] === null && (- <p className='text-slate-700 dark:text-gray-50 h-5 w-5 text-center'>- -- </p>+ <p className='text-slate-700 dark:text-gray-50 h-5 w-5 text-center'>-</p>)}</td>))}@@ -719,41 +747,51 @@ const Main: React.FC<IMain> = ({ ssrTheme, ssrAuthenticated }): JSX.Element => {{t('main.peopleUseSwetrix')}</p><div className='flex items-center flex-col md:flex-row justify-between mt-16'>- {_map(t('main.lTestimonials', { returnObjects: true }), (item: {- name: string;- role: string;- desc: string;- }, index: number) => (- <div- key={item.name}- className={cx('max-w-xs w-full dark:bg-slate-900', {- 'mt-5 md:mt-0': index > 0,- })}- style={{- boxShadow: '-22px -11px 40px rgba(0, 0, 0, 0.02), 3px -5px 16px rgba(0, 0, 0, 0.02), 17px 24px 20px rgba(0, 0, 0, 0.02)',- borderRadius: '100px 30px 30px 30px',- }}- >- <Quote theme={theme} color={index === 1 ? 'indigo' : 'black'} className='mx-auto relative -top-4' />- <div className='px-10 mb-10 max-h-80 overflow-auto'>- <p className='text-gray-600 text-sm mt-8 dark:text-gray-400'>- {item.name}- <br />- {item.role}- </p>- <cite className='text-slate-900 dark:text-white text-md text mt-2 leading-9 whitespace-pre-line not-italic'>- {item.desc}- </cite>+ {_map(+ t('main.lTestimonials', { returnObjects: true }),+ (+ item: {+ name: string+ role: string+ desc: string+ },+ index: number,+ ) => (+ <div+ key={item.name}+ className={cx('max-w-xs w-full dark:bg-slate-900', {+ 'mt-5 md:mt-0': index > 0,+ })}+ style={{+ boxShadow:+ '-22px -11px 40px rgba(0, 0, 0, 0.02), 3px -5px 16px rgba(0, 0, 0, 0.02), 17px 24px 20px rgba(0, 0, 0, 0.02)',+ borderRadius: '100px 30px 30px 30px',+ }}+ >+ <Quote theme={theme} color={index === 1 ? 'indigo' : 'black'} className='mx-auto relative -top-4' />+ <div className='px-10 mb-10 max-h-80 overflow-auto'>+ <p className='text-gray-600 text-sm mt-8 dark:text-gray-400'>+ {item.name}+ <br />+ {item.role}+ </p>+ <cite className='text-slate-900 dark:text-white text-md text mt-2 leading-9 whitespace-pre-line not-italic'>+ {item.desc}+ </cite>+ </div></div>- </div>- ))}+ ),+ )}</div></div></section>{/* end section Testimonials */}<div className='bg-white dark:bg-slate-900 px-4 md:px-8 pb-12'>- <section className='relative isolate max-w-7xl w-full mx-auto bg-slate-800 overflow-hidden lg:h-[450px]' style={{ borderRadius: '100px 30px 30px 30px' }}>+ <section+ className='relative isolate max-w-7xl w-full mx-auto bg-slate-800 overflow-hidden lg:h-[450px]'+ style={{ borderRadius: '100px 30px 30px 30px' }}+ ><div className='absolute -z-10 inset-0 overflow-hidden' aria-hidden='true'><div className='absolute left-[calc(20%-19rem)] top-[calc(50%-36rem)] transform-gpu blur-3xl'><div@@ -777,10 +815,12 @@ const Main: React.FC<IMain> = ({ ssrTheme, ssrAuthenticated }): JSX.Element => {}}/></h2>- <p className='text-gray-300 mb-9 font-medium text-base sm:text-lg'>- {t('main.whyDitch')}- </p>- <Link to={routesPath.signup} className='rounded-md border !duration-300 transition-all w-full max-w-[210px] h-[50px] flex items-center justify-center sm:mr-6 shadow-sm text-white bg-indigo-600 hover:bg-indigo-700 border-transparent' aria-label={t('titles.signup')}>+ <p className='text-gray-300 mb-9 font-medium text-base sm:text-lg'>{t('main.whyDitch')}</p>+ <Link+ to={routesPath.signup}+ className='rounded-md border !duration-300 transition-all w-full max-w-[210px] h-[50px] flex items-center justify-center sm:mr-6 shadow-sm text-white bg-indigo-600 hover:bg-indigo-700 border-transparent'+ aria-label={t('titles.signup')}+ ><span className='text-base font-semibold mr-1'>{t('main.start')}</span><ArrowSmallRightIcon className='w-5 h-4 mt-[1px]' /></Link>@@ -801,7 +841,10 @@ const Main: React.FC<IMain> = ({ ssrTheme, ssrAuthenticated }): JSX.Element => {{/* Advantages of using open source */}<section className='flex items-center lg:flex-row flex-col-reverse justify-between max-w-7xl w-full mx-auto py-20 lg:py-32 px-5'><picture>- <source srcSet={theme === 'dark' ? '/assets/opensource_dark.webp' : '/assets/opensource_light.webp'} type='image/webp' />+ <source+ srcSet={theme === 'dark' ? '/assets/opensource_dark.webp' : '/assets/opensource_light.webp'}+ type='image/webp'+ /><imgclassName='ring-1 ring-gray-900/10 dark:ring-white/10 rounded-xl'width='576'@@ -819,16 +862,25 @@ const Main: React.FC<IMain> = ({ ssrTheme, ssrAuthenticated }): JSX.Element => {i18nKey='main.opensourceAdv'components={{// eslint-disable-next-line jsx-a11y/anchor-has-content- url: <a href={GITHUB_URL} className='hover:underline' target='_blank' rel='noopener noreferrer' aria-label='Source code (opens in a new tab)' />,+ url: (+ <a+ href={GITHUB_URL}+ className='hover:underline'+ target='_blank'+ rel='noopener noreferrer'+ aria-label='Source code (opens in a new tab)'+ />+ ),}}/></h2><hr className='border-slate-300 dark:border-slate-700 border-1 max-w-[346px] my-6' /><div className='max-w-md w-full lg:mb-0 mb-9'>- {_map(t('main.opensource', { returnObjects: true }), (item: {- desc: string- }) => (- <p key={item.desc} className='text-slate-700 dark:text-gray-300 text-sm leading-6 flex items-center mb-3'>+ {_map(t('main.opensource', { returnObjects: true }), (item: { desc: string }) => (+ <p+ key={item.desc}+ className='text-slate-700 dark:text-gray-300 text-sm leading-6 flex items-center mb-3'+ ><span><CheckCircleIcon className='w-6 h-6 text-indigo-500 mr-4' /></span>@@ -862,18 +914,11 @@ const Main: React.FC<IMain> = ({ ssrTheme, ssrAuthenticated }): JSX.Element => {{() => (<p className='text-indigo-700 text-5xl font-extrabold text-center'>{users[0]}- {users[1] && (- <span className='text-gray-900 dark:text-indigo-200'>- {users[1]}- +- </span>- )}+ {users[1] && <span className='text-gray-900 dark:text-indigo-200'>{users[1]}+</span>}</p>)}</ClientOnly>- <p className='text-gray-600 text-lg dark:text-gray-200'>- {t('main.users')}- </p>+ <p className='text-gray-600 text-lg dark:text-gray-200'>{t('main.users')}</p></div><div className='bg-gray-800 dark:bg-gray-200 w-2 h-2 rounded-full mx-5 mb-14 mt-16 md:mb-0 md:mt-0' /><div className='text-center'>@@ -881,18 +926,11 @@ const Main: React.FC<IMain> = ({ ssrTheme, ssrAuthenticated }): JSX.Element => {{() => (<p className='text-indigo-700 text-5xl font-extrabold text-center'>{websites[0]}- {websites[1] && (- <span className='text-gray-900 dark:text-indigo-200'>- {websites[1]}- +- </span>- )}+ {websites[1] && <span className='text-gray-900 dark:text-indigo-200'>{websites[1]}+</span>}</p>)}</ClientOnly>- <p className='text-gray-600 text-lg dark:text-gray-200'>- {t('main.websites')}- </p>+ <p className='text-gray-600 text-lg dark:text-gray-200'>{t('main.websites')}</p></div><div className='bg-gray-800 dark:bg-gray-200 w-2 h-2 rounded-full mx-5 mb-14 mt-16 md:mb-0 md:mt-0' /><div className='text-center'>@@ -900,18 +938,11 @@ const Main: React.FC<IMain> = ({ ssrTheme, ssrAuthenticated }): JSX.Element => {{() => (<p className='text-indigo-700 text-5xl font-extrabold text-center'>{events[0]}- {events[1] && (- <span className='text-gray-900 dark:text-indigo-200'>- {events[1]}- +- </span>- )}+ {events[1] && <span className='text-gray-900 dark:text-indigo-200'>{events[1]}+</span>}</p>)}</ClientOnly>- <p className='text-gray-600 text-lg dark:text-gray-200'>- {t('main.pageviews')}- </p>+ <p className='text-gray-600 text-lg dark:text-gray-200'>{t('main.pageviews')}</p></div></div></div>diff --git a/app/pages/NotFound/index.tsx b/app/pages/NotFound/index.tsxindex 5f977ecc9..66b40e488 100644--- a/app/pages/NotFound/index.tsx+++ b/app/pages/NotFound/index.tsx@@ -5,7 +5,9 @@ import { useTranslation } from 'react-i18next'import routes from 'routesPath'const NotFound = (): JSX.Element => {- const { t }: {+ const {+ t,+ }: {t: (key: string) => string} = useTranslation('common')@@ -13,9 +15,7 @@ const NotFound = (): JSX.Element => {<div className='min-h-min-footer bg-gray-50 dark:bg-slate-900 px-4 py-16 sm:px-6 sm:py-24 md:grid md:place-items-center lg:px-8'><div className='max-w-max mx-auto'><main className='sm:flex'>- <p className='text-4xl font-bold text-indigo-600 dark:text-indigo-500 sm:text-5xl'>- 404- </p>+ <p className='text-4xl font-bold text-indigo-600 dark:text-indigo-500 sm:text-5xl'>404</p><div className='sm:ml-6'><div className='sm:border-l sm:border-gray-200 sm:pl-6'><h1 className='text-4xl font-extrabold text-gray-900 dark:text-gray-50 tracking-tight sm:text-5xl'>diff --git a/app/pages/OpenStartup/index.tsx b/app/pages/OpenStartup/index.tsxindex e3d2d21b3..74b6783f6 100644--- a/app/pages/OpenStartup/index.tsx+++ b/app/pages/OpenStartup/index.tsx@@ -1,9 +1,7 @@/* eslint-disable */import React, { useEffect } from 'react'import _map from 'lodash/map'-import bb, {- bar, line,-} from 'billboard.js'+import bb, { bar, line } from 'billboard.js'import { useTranslation, Trans } from 'react-i18next'import { Link } from '@remix-run/react'import { useSelector } from 'react-redux'@@ -19,190 +17,183 @@ const financeData = {'2021-08-01': {'Technical Expences': -32,'Business Expences': 0,- 'MRR': 0,- 'Revenue': 0,+ MRR: 0,+ Revenue: 0,},'2021-09-01': {'Technical Expences': -32,'Business Expences': 0,- 'MRR': 0,- 'Revenue': 0,+ MRR: 0,+ Revenue: 0,},'2021-10-01': {'Technical Expences': -32,'Business Expences': 0,- 'MRR': 0,- 'Revenue': 0,+ MRR: 0,+ Revenue: 0,},'2021-11-01': {'Technical Expences': -32,'Business Expences': 0,- 'MRR': 0,- 'Revenue': 0,+ MRR: 0,+ Revenue: 0,},'2021-12-01': {'Technical Expences': -32,'Business Expences': 0,- 'MRR': 0,- 'Revenue': 0,+ MRR: 0,+ Revenue: 0,},'2022-01-01': {'Technical Expences': -32,'Business Expences': 0,- 'MRR': 0,- 'Revenue': 0,+ MRR: 0,+ Revenue: 0,},'2022-02-01': {'Technical Expences': -32,'Business Expences': 0,- 'MRR': 2,- 'Revenue': 2,+ MRR: 2,+ Revenue: 2,},'2022-03-01': {'Technical Expences': -32,'Business Expences': 0,- 'MRR': 15,- 'Revenue': 14,+ MRR: 15,+ Revenue: 14,},'2022-04-01': {'Technical Expences': -32,'Business Expences': -300,- 'MRR': 15,- 'Revenue': 14,+ MRR: 15,+ Revenue: 14,},'2022-05-01': {'Technical Expences': -32,'Business Expences': -300,- 'MRR': 15,- 'Revenue': 14,+ MRR: 15,+ Revenue: 14,},'2022-06-01': {'Technical Expences': -32,'Business Expences': -300,- 'MRR': 15,- 'Revenue': 14,+ MRR: 15,+ Revenue: 14,},'2022-07-01': {'Technical Expences': -32,'Business Expences': -300,- 'MRR': 15,- 'Revenue': 14,+ MRR: 15,+ Revenue: 14,},'2022-08-01': {'Technical Expences': -42,'Business Expences': -300,- 'MRR': 15,- 'Revenue': 14,+ MRR: 15,+ Revenue: 14,},'2022-09-01': {'Technical Expences': -42,'Business Expences': -350,- 'MRR': 15,- 'Revenue': 14,+ MRR: 15,+ Revenue: 14,},'2022-10-01': {'Technical Expences': -48,'Business Expences': -300,- 'MRR': 15,- 'Revenue': 14,+ MRR: 15,+ Revenue: 14,},'2022-11-01': {'Technical Expences': -48,'Business Expences': -300,- 'MRR': 15,- 'Revenue': 14,+ MRR: 15,+ Revenue: 14,},'2022-12-01': {'Technical Expences': -48,'Business Expences': -400,- 'MRR': 15,- 'Revenue': 14,+ MRR: 15,+ Revenue: 14,},'2023-01-01': {'Technical Expences': -48,'Business Expences': -375,- 'MRR': 15,- 'Revenue': 14,+ MRR: 15,+ Revenue: 14,},'2023-02-01': {'Technical Expences': -48,'Business Expences': -300,- 'MRR': 35,- 'Revenue': 31,+ MRR: 35,+ Revenue: 31,},'2023-03-01': {'Technical Expences': -48,'Business Expences': -370,- 'MRR': 30,- 'Revenue': 26,+ MRR: 30,+ Revenue: 26,},'2023-04-01': {'Technical Expences': -48,'Business Expences': -50,- 'MRR': 34,- 'Revenue': 73,+ MRR: 34,+ Revenue: 73,},'2023-05-01': {'Technical Expences': -48,'Business Expences': -650,- 'MRR': 38,- 'Revenue': 73,+ MRR: 38,+ Revenue: 73,},'2023-06-01': {'Technical Expences': -48,'Business Expences': -300,- 'MRR': 38,- 'Revenue': 22,+ MRR: 38,+ Revenue: 22,},'2023-07-01': {'Technical Expences': -23,'Business Expences': -300,- 'MRR': 63,- 'Revenue': 63,+ MRR: 63,+ Revenue: 63,},'2023-08-01': {'Technical Expences': -23,'Business Expences': 0,- 'MRR': 64,- 'Revenue': 49,+ MRR: 64,+ Revenue: 49,},'2023-09-01': {'Technical Expences': -23,'Business Expences': 0,- 'MRR': 58,- 'Revenue': 86,+ MRR: 58,+ Revenue: 86,},'2023-10-01': {'Technical Expences': -23,'Business Expences': 0,- 'MRR': 68,- 'Revenue': 47,+ MRR: 68,+ Revenue: 47,},'2023-11-01': {'Technical Expences': -23,'Business Expences': 0,- 'MRR': 77,- 'Revenue': 100,+ MRR: 77,+ Revenue: 100,},}const financeDataToColumns = (financeData: any) => {const dates = Object.keys(financeData)- const columns = [- ['Technical Expences'],- ['Business Expences'],- ['MRR'],- ['Profit'],- ['Revenue'],- ['x']- ]+ const columns = [['Technical Expences'], ['Business Expences'], ['MRR'], ['Profit'], ['Revenue'], ['x']]dates.forEach((date) => {columns[0].push(financeData[date]['Technical Expences'])columns[1].push(financeData[date]['Business Expences'])columns[2].push(financeData[date]['MRR'])columns[3].push(- financeData[date]['Revenue'] + financeData[date]['Technical Expences'] + financeData[date]['Business Expences']+ financeData[date]['Revenue'] + financeData[date]['Technical Expences'] + financeData[date]['Business Expences'],)columns[4].push(financeData[date]['Revenue'])columns[5].push(date)@@ -233,11 +224,9 @@ const getSettings = () => {'Business Expences': '#F27059',MRR: '#709775',Profit: '#A5E6AB',- Revenue: '#12731E'+ Revenue: '#12731E',},- groups: [- groups,- ],+ groups: [groups],},axis: {x: {@@ -285,9 +274,7 @@ const getSettings = () => {// focus: {// only: xAxisSize > 1,// },- pattern: [- 'circle',- ],+ pattern: ['circle'],r: 3,},legend: {@@ -326,25 +313,17 @@ const OpenStartup = (): JSX.Element => {return (<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>+ <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>- <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' />@@ -352,44 +331,27 @@ const OpenStartup = (): JSX.Element => {{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>- )}+ {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>- )}+ {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>- )}+ {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'>@@ -397,7 +359,12 @@ const OpenStartup = (): JSX.Element => {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' />,+ 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>diff --git a/app/pages/Press/index.tsx b/app/pages/Press/index.tsxindex a789c56f1..17239a729 100644--- a/app/pages/Press/index.tsx+++ b/app/pages/Press/index.tsx@@ -16,14 +16,8 @@ interface ILogoComponent {const LogoComponent = ({ description, logoSVG, logoPNG }: ILogoComponent): JSX.Element => (<p>- <b className='font-bold text-gray-900 dark:text-gray-50 tracking-tight'>- {description}- </b>- <img- className='h-20 mt-5 mb-2'- src={logoSVG || logoPNG}- alt={description}- />+ <b className='font-bold text-gray-900 dark:text-gray-50 tracking-tight'>{description}</b>+ <img className='h-20 mt-5 mb-2' src={logoSVG || logoPNG} alt={description} />{logoSVG && (<ahref={logoSVG}@@ -34,9 +28,7 @@ const LogoComponent = ({ description, logoSVG, logoPNG }: ILogoComponent): JSX.ESVG</a>)}- {logoSVG && logoPNG && (- <span className='text-gray-900 dark:text-gray-50'> | </span>- )}+ {logoSVG && logoPNG && <span className='text-gray-900 dark:text-gray-50'> | </span>}{logoPNG && (<ahref={logoPNG}@@ -55,44 +47,38 @@ LogoComponent.defaultProps = {}const Press = (): JSX.Element => {- const { t }: {+ const {+ t,+ }: {t: (key: string) => string} = useTranslation('common')return (<div className='min-h-min-footer 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.press')}- </h1>+ <h1 className='text-4xl font-bold text-gray-900 dark:text-gray-50 tracking-tight'>{t('titles.press')}</h1><p className='mt-2 text-lg text-gray-900 dark:text-gray-50 tracking-tight'><Transi18nKey='press.description'components={{- url: <Link to={routes.contact} className='font-medium hover:underline text-indigo-600 hover:text-indigo-500 dark:text-indigo-400 dark:hover:text-indigo-500' />,+ url: (+ <Link+ to={routes.contact}+ className='font-medium hover:underline text-indigo-600 hover:text-indigo-500 dark:text-indigo-400 dark:hover:text-indigo-500'+ />+ ),}}/></p>{/* Logos */}- <h2 className='text-2xl mt-2 font-bold text-gray-900 dark:text-gray-50 tracking-tight'>- {t('press.logos')}- </h2>+ <h2 className='text-2xl mt-2 font-bold text-gray-900 dark:text-gray-50 tracking-tight'>{t('press.logos')}</h2><div className='grid grid-cols-2 gap-4 mt-2'>- <LogoComponent- description={t('press.logo')}- logoPNG='/assets/logo_blue.png'- />- <LogoComponent- description={t('press.logoWhiteText')}- logoPNG='/assets/logo_white.png'- />+ <LogoComponent description={t('press.logo')} logoPNG='/assets/logo_blue.png' />+ <LogoComponent description={t('press.logoWhiteText')} logoPNG='/assets/logo_white.png' /></div><div className='grid grid-cols-2 gap-4 mt-8'>- <LogoComponent- description={t('press.logoNoText')}- logoPNG='/logo512.png'- />+ <LogoComponent description={t('press.logoNoText')} logoPNG='/logo512.png' /></div>{/* Font */}@@ -103,13 +89,15 @@ const Press = (): JSX.Element => {<Transi18nKey='press.font.description'components={{- url: <a- aria-label='Inter font website (opens in a new tab)'- href={FONT_INTER_URL}- className='font-medium hover:underline text-indigo-600 hover:text-indigo-500 dark:text-indigo-400 dark:hover:text-indigo-500'- target='_blank'- rel='noopener noreferrer'- />,+ url: (+ <a+ aria-label='Inter font website (opens in a new tab)'+ href={FONT_INTER_URL}+ className='font-medium hover:underline text-indigo-600 hover:text-indigo-500 dark:text-indigo-400 dark:hover:text-indigo-500'+ target='_blank'+ rel='noopener noreferrer'+ />+ ),}}values={{font: FONT_NAME,diff --git a/app/pages/Privacy/index.tsx b/app/pages/Privacy/index.tsxindex 2d4e4d913..f4085ee08 100644--- a/app/pages/Privacy/index.tsx+++ b/app/pages/Privacy/index.tsx@@ -2,9 +2,7 @@import React from 'react'import _map from 'lodash/map'-import {- CONTACT_EMAIL, SECURITY_EMAIL, DOCS_URL,-} from 'redux/constants'+import { CONTACT_EMAIL, SECURITY_EMAIL, DOCS_URL } from 'redux/constants'const serviceProviders: {company: string@@ -56,156 +54,231 @@ const Features = (): JSX.Element => {<div className='w-11/12 md:w-4/5 mx-auto pb-16 pt-12 px-4 sm:px-6 lg:px-8'><h1 className='text-4xl font-bold text-gray-900 dark:text-gray-50 tracking-tight'>Privacy Policy</h1><p className='mt-4 text-lg text-gray-900 dark:text-gray-50 tracking-tight'>- This Swetrix Privacy Policy (“Policy”, "Privacy Policy") outlines the personal information that we gather, how we use that personal information, and the options you have to access, correct, or delete such personal information.+ This Swetrix Privacy Policy (“Policy”, "Privacy Policy") outlines the personal information that we gather, how+ we use that personal information, and the options you have to access, correct, or delete such personal+ information.<br />- By visiting swetrix.com and using the Services provided here, you agree to the terms outlined in this Privacy Policy. Unless otherwise defined in this document, the terms used in this Privacy Policy have the same meanings as in our Terms and Conditions.+ By visiting swetrix.com and using the Services provided here, you agree to the terms outlined in this Privacy+ Policy. Unless otherwise defined in this document, the terms used in this Privacy Policy have the same+ meanings as in our Terms and Conditions.</p>- <h3 className='text-2xl font-bold text-gray-900 dark:text-gray-50 tracking-tight mt-4'>1. Policy application</h3>+ <h3 className='text-2xl font-bold text-gray-900 dark:text-gray-50 tracking-tight mt-4'>+ 1. Policy application+ </h3><p className='text-lg text-gray-900 dark:text-gray-50 tracking-tight'>This Privacy Policy applies to the following data subjects:<br />-{'- '}- <b>Customers:</b>- {' '}- Those who register for an account on Swetrix and to whom Swetrix provides its Services. For purposes of this Policy, “Services” refers to all of the solutions offered, marketed, or sold by us.+ <b>Customers:</b> Those who register for an account on Swetrix and to whom Swetrix provides its Services. For+ purposes of this Policy, “Services” refers to all of the solutions offered, marketed, or sold by us.<br />{'- '}- <b>Website Visitors:</b>- {' '}- Those who visit our Websites, which may optionally provide an email address or other information to receive communications from us, or give us feedback. For the purposes of this Policy, “Websites” refer to swetrix.com as well as any other websites we operate on our own behalf and that link to this Policy. For clarity, “Websites” does not include any sites owned or operated by our Customers.+ <b>Website Visitors:</b> Those who visit our Websites, which may optionally provide an email address or other+ information to receive communications from us, or give us feedback. For the purposes of this Policy,+ “Websites” refer to swetrix.com as well as any other websites we operate on our own behalf and that link to+ this Policy. For clarity, “Websites” does not include any sites owned or operated by our Customers.<br />{'- '}- <b>End Users:</b>- {' '}- Those who access or use our Customers websites, networks, APIs, and applications.+ <b>End Users:</b> Those who access or use our Customers websites, networks, APIs, and applications.<br />-- This Privacy Policy does not apply to our Customers websites, networks, APIs, and applications, which may have their own terms and privacy policies. Our Customers are solely responsible for establishing policies for and ensuring compliance with all applicable laws and regulations.+ This Privacy Policy does not apply to our Customers websites, networks, APIs, and applications, which may have+ their own terms and privacy policies. Our Customers are solely responsible for establishing policies for and+ ensuring compliance with all applicable laws and regulations.<br />-- Swetrix’s Websites and Services are not intended for, nor designed to attract, individuals under the age of eighteen. Swetrix does not knowingly collect personal information from any person under the age of eighteen. You represent that you are at least 18 or that you are the parent or guardian of such a minor and consent to such minor dependent’s use of the Websites and Services.+ Swetrix’s Websites and Services are not intended for, nor designed to attract, individuals under the age of+ eighteen. Swetrix does not knowingly collect personal information from any person under the age of eighteen.+ You represent that you are at least 18 or that you are the parent or guardian of such a minor and consent to+ such minor dependent’s use of the Websites and Services.</p>- <h3 className='text-2xl font-bold text-gray-900 dark:text-gray-50 tracking-tight mt-4'>2. Information we collect</h3>+ <h3 className='text-2xl font-bold text-gray-900 dark:text-gray-50 tracking-tight mt-4'>+ 2. Information we collect+ </h3><p className='text-lg text-gray-900 dark:text-gray-50 tracking-tight'>We may collect the following types of data in order to provide and improve our Services:<br />{'- '}- <b>Personal Data:</b>- {' '}- While using our Services, we may ask you to provide us with certain personally identifiable information that can be used to contact or identify you. Personally identifiable information may include, but is not limited to your name, email address and billing addresses necessary to process payment and delivery of Services.+ <b>Personal Data:</b> While using our Services, we may ask you to provide us with certain personally+ identifiable information that can be used to contact or identify you. Personally identifiable information may+ include, but is not limited to your name, email address and billing addresses necessary to process payment and+ delivery of Services.<br />{'- '}- <b>Payment Information:</b>- {' '}- We do not require our Customers to have payment information on file with us unless they have a paid subscription to our Services.+ <b>Payment Information:</b> We do not require our Customers to have payment information on file with us unless+ they have a paid subscription to our Services.<br />- When you sign up for one of our paid Subscriptions, you must provide payment and billing information. The information you will need to submit depends on which payment method you choose. For clarity, we do not store full credit card numbers or personal account numbers.+ When you sign up for one of our paid Subscriptions, you must provide payment and billing information. The+ information you will need to submit depends on which payment method you choose. For clarity, we do not store+ full credit card numbers or personal account numbers.<br />{'- '}- <b>Usage Data:</b>- {' '}- When you visit our Websites, we gather certain information and store it in log files to be able to provide you with our Services. This information may include but is not limited to Internet Protocol (IP) addresses, device or system information, URLs of referrer pages, browser information and language preferences.+ <b>Usage Data:</b> When you visit our Websites, we gather certain information and store it in log files to be+ able to provide you with our Services. This information may include but is not limited to Internet Protocol+ (IP) addresses, device or system information, URLs of referrer pages, browser information and language+ preferences.<br />- For clarity, the purpose of these log files is to enable us to operate and provide you with our Services, and to monitor for overall trends on our Websites and for security. These log files are not shared with third parties.+ For clarity, the purpose of these log files is to enable us to operate and provide you with our Services, and+ to monitor for overall trends on our Websites and for security. These log files are not shared with third+ parties.<br />{'- '}- <b>Cookie Data:</b>- {' '}- We use essential cookies on our Websites to provide our Services. Without these cookies, the services that you have asked for cannot be provided, and we only use these cookies to provide you those services.+ <b>Cookie Data:</b> We use essential cookies on our Websites to provide our Services. Without these cookies,+ the services that you have asked for cannot be provided, and we only use these cookies to provide you those+ services.<br />- These cookies are essential for the functioning of our Websites. For example, they help to authenticate you and to prevent fraudulent use of your account.+ These cookies are essential for the functioning of our Websites. For example, they help to authenticate you+ and to prevent fraudulent use of your account.<br />- You can instruct your browser to refuse all cookies or to indicate when a cookie is being sent. However, if you do not accept cookies, you may not be able to use some parts of our Websites and Services.+ You can instruct your browser to refuse all cookies or to indicate when a cookie is being sent. However, if+ you do not accept cookies, you may not be able to use some parts of our Websites and Services.<br />At this time, our Websites do not respond to Do Not Track beacons sent by browser plugins.<br />{'- '}- <b>Log Data:</b>- {' '}- We process End Users information on behalf of our Customers. This information is processed when End Users access or use our Customers domains, websites, APIs, applications, devices, endpoints, and networks that use our Services.- <br />- The information processed may include but is not limited to IP addresses, device or system information, and other information about the traffic on our Customers websites, devices, applications, and/or networks (collectively, “Log Data”). You can find more information on the data collected and how we process it- {' '}- <a className='text-indigo-600 hover:text-indigo-500 dark:text-indigo-400 dark:hover:text-indigo-500' href={`${DOCS_URL}/swetrix-js-reference#trackviews`} target='_blank' rel='noreferrer noopener'>here</a>+ <b>Log Data:</b> We process End Users information on behalf of our Customers. This information is processed+ when End Users access or use our Customers domains, websites, APIs, applications, devices, endpoints, and+ networks that use our Services.+ <br />+ The information processed may include but is not limited to IP addresses, device or system information, and+ other information about the traffic on our Customers websites, devices, applications, and/or networks+ (collectively, “Log Data”). You can find more information on the data collected and how we process it{' '}+ <a+ className='text-indigo-600 hover:text-indigo-500 dark:text-indigo-400 dark:hover:text-indigo-500'+ href={`${DOCS_URL}/swetrix-js-reference#trackviews`}+ target='_blank'+ rel='noreferrer noopener'+ >+ here+ </a>.</p>- <h3 className='text-2xl font-bold text-gray-900 dark:text-gray-50 tracking-tight mt-4'>3. How we use information we collect</h3>+ <h3 className='text-2xl font-bold text-gray-900 dark:text-gray-50 tracking-tight mt-4'>+ 3. How we use information we collect+ </h3><p className='text-lg text-gray-900 dark:text-gray-50 tracking-tight'>- We only processes personal information in a way that is relevant for the purpose for which it was collected or authorized:+ We only processes personal information in a way that is relevant for the purpose for which it was collected or+ authorized:<br />- To enable you to access and use the Websites and Services.<br />- To operate and improve the Websites and Services.<br />- - To send transactional messages, provide customer support, updates, security alerts, and account related messages.+ - To send transactional messages, provide customer support, updates, security alerts, and account related+ messages.<br />- - To process and complete transactions, and send you related information, including purchase confirmations and invoices.+ - To process and complete transactions, and send you related information, including purchase confirmations and+ invoices.<br />- To monitor and analyze overall trends, usage, and activities in connection with the Websites and Services.<br />- - To create, publish or send marketing emails, news or advertising material. For clarity, we do not send marketing emails without your explicit consent.+ - To create, publish or send marketing emails, news or advertising material. For clarity, we do not send+ marketing emails without your explicit consent.<br />- - To comply with legal obligations to investigate and prevent fraudulent transactions, unauthorized access, and other illegal activities.+ - To comply with legal obligations to investigate and prevent fraudulent transactions, unauthorized access,+ and other illegal activities.<br />- To personalize the Websites and Services.<br />- To process your data for other purposes for which we obtain your consent.<br />- We use and process the Log Data from End Users to fulfill our obligations under our Customer agreements and as may be required by law. We act as a data processor and service provider pursuant to data processing instructions by our Customers.+ We use and process the Log Data from End Users to fulfill our obligations under our Customer agreements and as+ may be required by law. We act as a data processor and service provider pursuant to data processing+ instructions by our Customers.<br />- We may use the Usage and Log Data to assemble non-personally identifiable web traffic reports and statistics. These reports and statistics may be shared with third parties.+ We may use the Usage and Log Data to assemble non-personally identifiable web traffic reports and statistics.+ These reports and statistics may be shared with third parties.</p>- <h3 className='text-2xl font-bold text-gray-900 dark:text-gray-50 tracking-tight mt-4'>4. UK and EU residents</h3>+ <h3 className='text-2xl font-bold text-gray-900 dark:text-gray-50 tracking-tight mt-4'>+ 4. UK and EU residents+ </h3><p className='text-lg text-gray-900 dark:text-gray-50 tracking-tight'>- Please note that the “personal information” referenced in this Privacy Policy means “personal data” as that term is defined under the European Union (“EU”) General Data Protection Regulations (“GDPR”) and its United Kingdom (“UK”) GDPR counterpart. Swetrix is the data controller for the Personal Data of Customers and Website Visitors, but not for the Personal Data of End Users. We process the Personal Data of End Users on behalf of our Customers.- <br />- If you are an individual from the European Economic Area (the “EEA”), the UK or Switzerland, please note that our legal basis for collecting and using your personal information will depend on the personal information collected and the specific context in which we collect it.- <br />- However, we will normally collect personal data from you only (i) where the processing is in our legitimate interests and not overridden by your rights; (ii) where we need the personal data to perform a contract with you or (iii) where we have your consent to do so. In some cases, we may also have a legal obligation to collect personal data from you.- <br />- Please note that in most cases, if you do not provide the requested information, we will not be able to provide the requested service to you. In some cases, we may also have a legal obligation to collect personal information from you, or may need the personal information to protect your vital interests or those of another person.- <br />- Where we rely on your consent to process your personal data, you have the right to withdraw or decline consent at any time. Where we rely on our legitimate interests to process your personal data, you have the right to object.- <br />- If you have any questions about or need further information concerning the legal basis on which we collect and use your personal information, please contact us at - <a href={`mailto:${CONTACT_EMAIL}`} className='font-medium text-indigo-600 hover:text-indigo-500 dark:text-indigo-400 dark:hover:text-indigo-500'>+ Please note that the “personal information” referenced in this Privacy Policy means “personal data” as that+ term is defined under the European Union (“EU”) General Data Protection Regulations (“GDPR”) and its United+ Kingdom (“UK”) GDPR counterpart. Swetrix is the data controller for the Personal Data of Customers and Website+ Visitors, but not for the Personal Data of End Users. We process the Personal Data of End Users on behalf of+ our Customers.+ <br />+ If you are an individual from the European Economic Area (the “EEA”), the UK or Switzerland, please note that+ our legal basis for collecting and using your personal information will depend on the personal information+ collected and the specific context in which we collect it.+ <br />+ However, we will normally collect personal data from you only (i) where the processing is in our legitimate+ interests and not overridden by your rights; (ii) where we need the personal data to perform a contract with+ you or (iii) where we have your consent to do so. In some cases, we may also have a legal obligation to+ collect personal data from you.+ <br />+ Please note that in most cases, if you do not provide the requested information, we will not be able to+ provide the requested service to you. In some cases, we may also have a legal obligation to collect personal+ information from you, or may need the personal information to protect your vital interests or those of another+ person.+ <br />+ Where we rely on your consent to process your personal data, you have the right to withdraw or decline consent+ at any time. Where we rely on our legitimate interests to process your personal data, you have the right to+ object.+ <br />+ If you have any questions about or need further information concerning the legal basis on which we collect and+ use your personal information, please contact us at + <a+ href={`mailto:${CONTACT_EMAIL}`}+ className='font-medium text-indigo-600 hover:text-indigo-500 dark:text-indigo-400 dark:hover:text-indigo-500'+ >{CONTACT_EMAIL}</a>.</p>- <h3 className='text-2xl font-bold text-gray-900 dark:text-gray-50 tracking-tight mt-4'>5. California Residents</h3>+ <h3 className='text-2xl font-bold text-gray-900 dark:text-gray-50 tracking-tight mt-4'>+ 5. California Residents+ </h3><p className='text-lg text-gray-900 dark:text-gray-50 tracking-tight'>- We do not sell, rent, or share personal information with third parties as defined under the California Consumer Privacy Act of 2018 (California Civil Code Sec. 1798.100 et seq.), nor do we sell, rent, or share personal information with third parties for their direct marketing purposes as defined under California Civil Code Sec. 1798.83.+ We do not sell, rent, or share personal information with third parties as defined under the California+ Consumer Privacy Act of 2018 (California Civil Code Sec. 1798.100 et seq.), nor do we sell, rent, or share+ personal information with third parties for their direct marketing purposes as defined under California Civil+ Code Sec. 1798.83.</p><h3 className='text-2xl font-bold text-gray-900 dark:text-gray-50 tracking-tight mt-4'>6. Retention of data</h3><p className='text-lg text-gray-900 dark:text-gray-50 tracking-tight'>- We may retain your information for as long as your account is active or as needed to provide you services, comply with our legal obligations, resolve disputes and enforce our agreements. In certain circumstances we may be required by law to retain your personal information, or may need to retain your personal information in order to continue providing a service.+ We may retain your information for as long as your account is active or as needed to provide you services,+ comply with our legal obligations, resolve disputes and enforce our agreements. In certain circumstances we+ may be required by law to retain your personal information, or may need to retain your personal information in+ order to continue providing a service.<br />- Even if you delete your account, keep in mind that the deletion by our third party providers may not be immediate and that the deleted information may persist in backup copies for a reasonable period of time.+ Even if you delete your account, keep in mind that the deletion by our third party providers may not be+ immediate and that the deleted information may persist in backup copies for a reasonable period of time.</p><h3 className='text-2xl font-bold text-gray-900 dark:text-gray-50 tracking-tight mt-4'>7. Transfer of data</h3><p className='text-lg text-gray-900 dark:text-gray-50 tracking-tight'>- Your information, including Personal Data, may be transferred to — and maintained on — computers located outside of your state, province, country or other governmental jurisdiction where the data protection laws may differ from those in your jurisdiction. If you are located outside Germany and choose to provide information to us, please note that we transfer the data, including Personal Data, to Germany and process it there.- <br />- Your consent to this Privacy Policy followed by your submission of such information represents your agreement to that transfer. We will take all steps reasonably necessary to ensure that your data is treated securely and in accordance with this Privacy Policy and no transfer of your Personal Data will take place to an organization or a country unless there are adequate controls in place including the security of your data and other personal information.+ Your information, including Personal Data, may be transferred to — and maintained on — computers located+ outside of your state, province, country or other governmental jurisdiction where the data protection laws may+ differ from those in your jurisdiction. If you are located outside Germany and choose to provide information+ to us, please note that we transfer the data, including Personal Data, to Germany and process it there.+ <br />+ Your consent to this Privacy Policy followed by your submission of such information represents your agreement+ to that transfer. We will take all steps reasonably necessary to ensure that your data is treated securely and+ in accordance with this Privacy Policy and no transfer of your Personal Data will take place to an+ organization or a country unless there are adequate controls in place including the security of your data and+ other personal information.</p>- <h3 className='text-2xl font-bold text-gray-900 dark:text-gray-50 tracking-tight mt-4'>8. Information sharing</h3>+ <h3 className='text-2xl font-bold text-gray-900 dark:text-gray-50 tracking-tight mt-4'>+ 8. Information sharing+ </h3><p className='text-lg text-gray-900 dark:text-gray-50 tracking-tight'>We do not sell or rent personal information.<br />- We may disclose personal information to service providers who help us run the Services and our business (“Service Providers”). These Service Providers may only process personal information pursuant to our instructions and in compliance both with this Privacy Policy and other applicable security measures and regulations.+ We may disclose personal information to service providers who help us run the Services and our business+ (“Service Providers”). These Service Providers may only process personal information pursuant to our+ instructions and in compliance both with this Privacy Policy and other applicable security measures and+ regulations.<br />{/* Before engaging any Service Provider, we perform due diligence, including a security assessment. Our Service Providers are subject to strict contract terms designed to ensure that these Service Providers process personal data only for the purposes of providing services to Swetrix and in accordance with our commitments to applicable data protection laws.<br /> */}- The following Service Providers may be considered our "sub-processors" under GDPR. We only share what's required for their purpose.+ The following Service Providers may be considered our "sub-processors" under GDPR. We only share what's+ required for their purpose.<br /><div className='mt-8 flex flex-col'><div className='-my-2 -mx-4 overflow-x-auto sm:-mx-6 lg:-mx-8'>@@ -214,29 +287,47 @@ const Features = (): JSX.Element => {<table className='min-w-full divide-y divide-gray-300 200 dark:divide-gray-500'><thead className='bg-gray-50 dark:bg-slate-800'><tr>- <th scope='col' className='py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 dark:text-gray-50 sm:pl-6'>+ <th+ scope='col'+ className='py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 dark:text-gray-50 sm:pl-6'+ >Company</th>- <th scope='col' className='px-3 py-3.5 text-left text-sm font-semibold text-gray-900 dark:text-gray-50'>+ <th+ scope='col'+ className='px-3 py-3.5 text-left text-sm font-semibold text-gray-900 dark:text-gray-50'+ >Purpose</th>- <th scope='col' className='px-3 py-3.5 text-left text-sm font-semibold text-gray-900 dark:text-gray-50'>+ <th+ scope='col'+ className='px-3 py-3.5 text-left text-sm font-semibold text-gray-900 dark:text-gray-50'+ >Data subjects</th>- <th scope='col' className='px-3 py-3.5 text-left text-sm font-semibold text-gray-900 dark:text-gray-50'>+ <th+ scope='col'+ className='px-3 py-3.5 text-left text-sm font-semibold text-gray-900 dark:text-gray-50'+ >Corporate location</th></tr></thead><tbody className='divide-y divide-gray-200 dark:divide-gray-600 bg-white dark:bg-slate-800'>- {_map(serviceProviders, ({- company, purpose, dataSubjects, location,- }) => (+ {_map(serviceProviders, ({ company, purpose, dataSubjects, location }) => (<tr key={company}>- <td className='whitespace-nowrap px-3 py-4 text-sm text-gray-900 dark:text-gray-50 sm:pl-6'>{company}</td>- <td className='whitespace-nowrap px-3 py-4 text-sm text-gray-900 dark:text-gray-50'>{purpose}</td>- <td className='whitespace-nowrap px-3 py-4 text-sm text-gray-900 dark:text-gray-50'>{dataSubjects}</td>- <td className='whitespace-nowrap px-3 py-4 text-sm text-gray-900 dark:text-gray-50'>{location}</td>+ <td className='whitespace-nowrap px-3 py-4 text-sm text-gray-900 dark:text-gray-50 sm:pl-6'>+ {company}+ </td>+ <td className='whitespace-nowrap px-3 py-4 text-sm text-gray-900 dark:text-gray-50'>+ {purpose}+ </td>+ <td className='whitespace-nowrap px-3 py-4 text-sm text-gray-900 dark:text-gray-50'>+ {dataSubjects}+ </td>+ <td className='whitespace-nowrap px-3 py-4 text-sm text-gray-900 dark:text-gray-50'>+ {location}+ </td></tr>))}</tbody>@@ -246,64 +337,78 @@ const Features = (): JSX.Element => {</div></div><br />- In addition to sharing with Service Providers as described above, we also may share your information with others in the following circumstances:+ In addition to sharing with Service Providers as described above, we also may share your information with+ others in the following circumstances:<br />- In the event of a merger, sale, change in control, or reorganization of all or part of our business.<br />- - When we are required to disclose personal information to respond to subpoenas, court orders, or legal process, or to establish or exercise our legal rights or defend against legal claims.- <br />- - Where we have a good-faith belief sharing is necessary to investigate, prevent or take action regarding illegal activities, suspected fraud, situations involving potential threats to the physical safety of any person, or violations of our Terms and Conditions, or as otherwise required to comply with our legal obligations.+ - When we are required to disclose personal information to respond to subpoenas, court orders, or legal+ process, or to establish or exercise our legal rights or defend against legal claims.<br />- - Other purposes for which we obtain your consent.+ - Where we have a good-faith belief sharing is necessary to investigate, prevent or take action regarding+ illegal activities, suspected fraud, situations involving potential threats to the physical safety of any+ person, or violations of our Terms and Conditions, or as otherwise required to comply with our legal+ obligations.+ <br />- Other purposes for which we obtain your consent.</p>- <h3 className='text-2xl font-bold text-gray-900 dark:text-gray-50 tracking-tight mt-4'>9. Data subject rights</h3>+ <h3 className='text-2xl font-bold text-gray-900 dark:text-gray-50 tracking-tight mt-4'>+ 9. Data subject rights+ </h3><p className='text-lg text-gray-900 dark:text-gray-50 tracking-tight'>- We would like to make sure you are fully aware of all of your data protection rights. In certain circumstances, you have the following data protection rights:+ We would like to make sure you are fully aware of all of your data protection rights. In certain+ circumstances, you have the following data protection rights:<br />{'- '}- <b>The right to access:</b>- {' '}- You have the right to request our Company for copies of your personal data.+ <b>The right to access:</b> You have the right to request our Company for copies of your personal data.<br />{'- '}- <b>The right to rectification:</b>- {' '}- You have the right to request that our Company corrects any information you believe is inaccurate. You also have the right to request our Company to complete the information you believe is incomplete.+ <b>The right to rectification:</b> You have the right to request that our Company corrects any information you+ believe is inaccurate. You also have the right to request our Company to complete the information you believe+ is incomplete.<br />{'- '}- <b>The right to erasure:</b>- {' '}- You have the right to request that our Company erases your personal data, under certain conditions.+ <b>The right to erasure:</b> You have the right to request that our Company erases your personal data, under+ certain conditions.<br />{'- '}- <b>The right to restrict processing:</b>- {' '}- You have the right to request that our Company restricts the processing of your personal data, under certain conditions.+ <b>The right to restrict processing:</b> You have the right to request that our Company restricts the+ processing of your personal data, under certain conditions.<br />{'- '}- <b>The right to object to processing:</b>- {' '}- You have the right to object to our Company's processing of your personal data, under certain conditions.+ <b>The right to object to processing:</b> You have the right to object to our Company's processing of your+ personal data, under certain conditions.<br />{'- '}- <b>The right to data portability:</b>- {' '}- You have the right to request that our Company transfers the data that we have collected to another organization, or directly to you, under certain conditions.- <br />- If you make a request, we have one month to respond to you. If you would like to exercise any of these rights, please contact us via email at - <a href={`mailto:${CONTACT_EMAIL}`} className='font-medium text-indigo-600 hover:text-indigo-500 dark:text-indigo-400 dark:hover:text-indigo-500'>+ <b>The right to data portability:</b> You have the right to request that our Company transfers the data that+ we have collected to another organization, or directly to you, under certain conditions.+ <br />+ If you make a request, we have one month to respond to you. If you would like to exercise any of these rights,+ please contact us via email at + <a+ href={`mailto:${CONTACT_EMAIL}`}+ className='font-medium text-indigo-600 hover:text-indigo-500 dark:text-indigo-400 dark:hover:text-indigo-500'+ >{CONTACT_EMAIL}</a>. Please note that we may ask you to verify your identity before responding to such requests.<br />- We have no direct relationship with the End Users. Our Customers are solely responsible for ensuring compliance with all applicable laws and regulations with respect to their website users.+ We have no direct relationship with the End Users. Our Customers are solely responsible for ensuring+ compliance with all applicable laws and regulations with respect to their website users.</p>- <h3 className='text-2xl font-bold text-gray-900 dark:text-gray-50 tracking-tight mt-4'>10. Communication preferences</h3>+ <h3 className='text-2xl font-bold text-gray-900 dark:text-gray-50 tracking-tight mt-4'>+ 10. Communication preferences+ </h3><p className='text-lg text-gray-900 dark:text-gray-50 tracking-tight'>- Swetrix will send you commercial communications based on the communication preferences in your account settings. Swetrix also will send you service-related communications. You may manage your receipt of commercial communications by clicking on the “unsubscribe” link located on the bottom of such emails, through your account settings if you have a Swetrix account, or you may send a request to - <a href={`mailto:${CONTACT_EMAIL}`} className='font-medium text-indigo-600 hover:text-indigo-500 dark:text-indigo-400 dark:hover:text-indigo-500'>+ Swetrix will send you commercial communications based on the communication preferences in your account+ settings. Swetrix also will send you service-related communications. You may manage your receipt of commercial+ communications by clicking on the “unsubscribe” link located on the bottom of such emails, through your+ account settings if you have a Swetrix account, or you may send a request to + <a+ href={`mailto:${CONTACT_EMAIL}`}+ className='font-medium text-indigo-600 hover:text-indigo-500 dark:text-indigo-400 dark:hover:text-indigo-500'+ >{CONTACT_EMAIL}</a>.@@ -311,27 +416,46 @@ const Features = (): JSX.Element => {<h3 className='text-2xl font-bold text-gray-900 dark:text-gray-50 tracking-tight mt-4'>11. Data security</h3><p className='text-lg text-gray-900 dark:text-gray-50 tracking-tight'>- We take all reasonable steps to protect information we receive from you from loss, misuse or unauthorized access, disclosure, alteration and/or destruction. We have put in place appropriate physical, technical and administrative measures to safeguard and secure your information, and we make use of privacy-enhancing technologies such as encryption. If you have any questions about the security of your personal information, you can contact us at - <a href={`mailto:${CONTACT_EMAIL}`} className='font-medium text-indigo-600 hover:text-indigo-500 dark:text-indigo-400 dark:hover:text-indigo-500'>+ We take all reasonable steps to protect information we receive from you from loss, misuse or unauthorized+ access, disclosure, alteration and/or destruction. We have put in place appropriate physical, technical and+ administrative measures to safeguard and secure your information, and we make use of privacy-enhancing+ technologies such as encryption. If you have any questions about the security of your personal information,+ you can contact us at + <a+ href={`mailto:${CONTACT_EMAIL}`}+ className='font-medium text-indigo-600 hover:text-indigo-500 dark:text-indigo-400 dark:hover:text-indigo-500'+ >{SECURITY_EMAIL}</a>.</p>- <h3 className='text-2xl font-bold text-gray-900 dark:text-gray-50 tracking-tight mt-4'>12. Notification of changes</h3>+ <h3 className='text-2xl font-bold text-gray-900 dark:text-gray-50 tracking-tight mt-4'>+ 12. Notification of changes+ </h3><p className='text-lg text-gray-900 dark:text-gray-50 tracking-tight'>- If we make changes to this Policy that we believe materially impact the privacy of your personal information, we will promptly provide notice of any such changes (and, where necessary, obtain consent), as well as post the updated Policy on this website noting the date of any changes via the "Last updated" date at the bottom of this Privacy Policy. We encourage you to periodically review this page for the latest information on our privacy practices.+ If we make changes to this Policy that we believe materially impact the privacy of your personal information,+ we will promptly provide notice of any such changes (and, where necessary, obtain consent), as well as post+ the updated Policy on this website noting the date of any changes via the "Last updated" date at the bottom of+ this Privacy Policy. We encourage you to periodically review this page for the latest information on our+ privacy practices.</p>- <h3 className='text-2xl font-bold text-gray-900 dark:text-gray-50 tracking-tight mt-4'>13. Business transactions</h3>+ <h3 className='text-2xl font-bold text-gray-900 dark:text-gray-50 tracking-tight mt-4'>+ 13. Business transactions+ </h3><p className='text-lg text-gray-900 dark:text-gray-50 tracking-tight'>- We may assign or transfer this Policy, as well as information covered by this Policy, in the event of a merger, sale, change in control, or reorganization of all or part of our business.+ We may assign or transfer this Policy, as well as information covered by this Policy, in the event of a+ merger, sale, change in control, or reorganization of all or part of our business.</p><h3 className='text-2xl font-bold text-gray-900 dark:text-gray-50 tracking-tight mt-4'>14. Contact</h3><p className='text-lg text-gray-900 dark:text-gray-50 tracking-tight'>If you have any questions about this Privacy Policy, you can contact us by email at - <a href={`mailto:${CONTACT_EMAIL}`} className='font-medium text-indigo-600 hover:text-indigo-500 dark:text-indigo-400 dark:hover:text-indigo-500'>+ <a+ href={`mailto:${CONTACT_EMAIL}`}+ className='font-medium text-indigo-600 hover:text-indigo-500 dark:text-indigo-400 dark:hover:text-indigo-500'+ >{CONTACT_EMAIL}</a>.diff --git a/app/pages/Project/Alerts/Settings/ProjectAlertsSettings.container.tsx b/app/pages/Project/Alerts/Settings/ProjectAlertsSettings.container.tsxindex e8d825bf2..f0c9d689e 100644--- a/app/pages/Project/Alerts/Settings/ProjectAlertsSettings.container.tsx+++ b/app/pages/Project/Alerts/Settings/ProjectAlertsSettings.container.tsx@@ -15,23 +15,29 @@ const mapStateToProps = (state: StateType) => ({const mapDispatchToProps = (dispatch: AppDispatch) => ({showError: (message: string) => {- dispatch(errorsActions.genericError({- message,- }))+ dispatch(+ errorsActions.genericError({+ message,+ }),+ )},generateAlerts: (message: string) => {- dispatch(alertsActions.generateAlerts({- message,- type: 'success',- }))+ dispatch(+ alertsActions.generateAlerts({+ message,+ type: 'success',+ }),+ )},setProjectAlerts: (alerts: IAlerts[]) => {dispatch(UIActions.setProjectAlerts(alerts))},setProjectAlertsTotal: (total: number) => {- dispatch(UIActions.setProjectAlertsTotal({- total,- }))+ dispatch(+ UIActions.setProjectAlertsTotal({+ total,+ }),+ )},})diff --git a/app/pages/Project/Alerts/Settings/ProjectAlertsSettings.tsx b/app/pages/Project/Alerts/Settings/ProjectAlertsSettings.tsxindex c9560c813..102f03de6 100644--- a/app/pages/Project/Alerts/Settings/ProjectAlertsSettings.tsx+++ b/app/pages/Project/Alerts/Settings/ProjectAlertsSettings.tsx@@ -1,8 +1,6 @@/* eslint-disable react/forbid-prop-types */import React, { useEffect, useMemo, useState } from 'react'-import {- useNavigate, useParams, useLocation, Link,-} from '@remix-run/react'+import { useNavigate, useParams, useLocation, Link } from '@remix-run/react'import { useTranslation, Trans } from 'react-i18next'import { ExclamationTriangleIcon } from '@heroicons/react/24/outline'import PropTypes from 'prop-types'@@ -23,12 +21,8 @@ import Input from 'ui/Input'import Button from 'ui/Button'import Checkbox from 'ui/Checkbox'import Modal from 'ui/Modal'-import {- PROJECT_TABS, QUERY_CONDITION, QUERY_METRIC, QUERY_TIME,-} from 'redux/constants'-import {- createAlert, updateAlert, deleteAlert, ICreateAlert,-} from 'api'+import { PROJECT_TABS, QUERY_CONDITION, QUERY_METRIC, QUERY_TIME } from 'redux/constants'+import { createAlert, updateAlert, deleteAlert, ICreateAlert } from 'api'import { withAuthentication, auth } from 'hoc/protected'import routes from 'routesPath'import Select from 'ui/Select'@@ -49,17 +43,30 @@ interface IProjectAlertsSettings {}const ProjectAlertsSettings = ({- alerts, setProjectAlerts, showError, user, setProjectAlertsTotal, total, generateAlerts, loading,+ alerts,+ setProjectAlerts,+ showError,+ user,+ setProjectAlertsTotal,+ total,+ generateAlerts,+ loading,}: IProjectAlertsSettings): JSX.Element => {const navigate = useNavigate()const { id, pid } = useParams()const { pathname } = useLocation()- const { t }: {- t: (key: string, options?: {- [key: string]: string | number | null | undefined- }) => string+ const {+ t,+ }: {+ t: (+ key: string,+ options?: {+ [key: string]: string | number | null | undefined+ },+ ) => string} = useTranslation('common')- const isSettings: boolean = !_isEmpty(id) && (_replace(_replace(routes.alert_settings, ':id', id as string), ':pid', pid as string) === pathname)+ const isSettings: boolean =+ !_isEmpty(id) && _replace(_replace(routes.alert_settings, ':id', id as string), ':pid', pid as string) === pathnameconst alert = useMemo(() => _find(alerts, { id }), [alerts, id])const [form, setForm] = useState<Partial<IAlerts>>({pid,@@ -86,27 +93,31 @@ const ProjectAlertsSettings = ({} = useMemo(() => {const values = _values(QUERY_TIME)- return _reduce(values, (prev, curr) => {- const [, amount, metric] = _split(curr, '_')- let translated-- if (metric === 'minutes') {- translated = t('alert.xMinutes', { amount })- }-- if (metric === 'hour') {- translated = t('alert.xHour', { amount })- }-- if (metric === 'hours') {- translated = t('alert.xHours', { amount })- }-- return {- ...prev,- [curr]: translated,- }- }, {})+ return _reduce(+ values,+ (prev, curr) => {+ const [, amount, metric] = _split(curr, '_')+ let translated++ if (metric === 'minutes') {+ translated = t('alert.xMinutes', { amount })+ }++ if (metric === 'hour') {+ translated = t('alert.xHour', { amount })+ }++ if (metric === 'hours') {+ translated = t('alert.xHours', { amount })+ }++ return {+ ...prev,+ [curr]: translated,+ }+ },+ {},+ )}, [t])const queryConditionTMapping: {@@ -114,10 +125,14 @@ const ProjectAlertsSettings = ({} = useMemo(() => {const values = _values(QUERY_CONDITION)- return _reduce(values, (prev, curr) => ({- ...prev,- [curr]: t(`alert.conditions.${curr}`),- }), {})+ return _reduce(+ values,+ (prev, curr) => ({+ ...prev,+ [curr]: t(`alert.conditions.${curr}`),+ }),+ {},+ )}, [t])const queryMetricTMapping: {@@ -125,10 +140,14 @@ const ProjectAlertsSettings = ({} = useMemo(() => {const values = _values(QUERY_METRIC)- return _reduce(values, (prev, curr) => ({- ...prev,- [curr]: t(`alert.metrics.${curr}`),- }), {})+ return _reduce(+ values,+ (prev, curr) => ({+ ...prev,+ [curr]: t(`alert.metrics.${curr}`),+ }),+ {},+ )}, [t])useEffect(() => {@@ -215,7 +234,7 @@ const ProjectAlertsSettings = ({const { target } = eventconst value = target.type === 'checkbox' ? target.checked : target.value- setForm(prevForm => ({+ setForm((prevForm) => ({...prevForm,[target.name]: value,}))@@ -231,9 +250,11 @@ const ProjectAlertsSettings = ({}}- const title = isSettings ? t('alert.settingsOf', {- name: form.name,- }) : t('alert.create')+ const title = isSettings+ ? t('alert.settingsOf', {+ name: form.name,+ })+ : t('alert.create')return (<div@@ -242,14 +263,12 @@ const ProjectAlertsSettings = ({})}><form className='max-w-7xl w-full mx-auto' onSubmit={handleSubmit}>- <h2 className='mt-2 text-3xl font-bold text-gray-900 dark:text-gray-50'>- {title}- </h2>+ <h2 className='mt-2 text-3xl font-bold text-gray-900 dark:text-gray-50'>{title}</h2>{!loading && !isIntegrationLinked && (<div className='flex items-center bg-blue-50 dark:text-gray-50 dark:bg-slate-800 rounded px-5 py-3 mt-2 whitespace-pre-wrap text-base'><ExclamationTriangleIcon className='w-5 h-5 mr-1' /><Trans- // @ts-ignore+ // @ts-ignoret={t}i18nKey='alert.noIntegration'components={{@@ -286,9 +305,9 @@ const ProjectAlertsSettings = ({items={_values(queryMetricTMapping)}title={form.queryMetric ? queryMetricTMapping[form.queryMetric] : ''}onSelect={(item) => {- const key = _findKey(queryMetricTMapping, predicate => predicate === item)+ const key = _findKey(queryMetricTMapping, (predicate) => predicate === item)- setForm(prevForm => ({+ setForm((prevForm) => ({...prevForm,queryMetric: key,}))@@ -316,9 +335,9 @@ const ProjectAlertsSettings = ({items={_values(queryConditionTMapping)}title={form.queryCondition ? queryConditionTMapping[form.queryCondition] : ''}onSelect={(item) => {- const key = _findKey(queryConditionTMapping, predicate => predicate === item)+ const key = _findKey(queryConditionTMapping, (predicate) => predicate === item)- setForm(prevForm => ({+ setForm((prevForm) => ({...prevForm,queryCondition: key,}))@@ -344,9 +363,9 @@ const ProjectAlertsSettings = ({items={_values(queryTimeTMapping)}title={form.queryTime ? queryTimeTMapping[form.queryTime] : ''}onSelect={(item) => {- const key = _findKey(queryTimeTMapping, predicate => predicate === item)+ const key = _findKey(queryTimeTMapping, (predicate) => predicate === item)- setForm(prevForm => ({+ setForm((prevForm) => ({...prevForm,queryTime: key,}))@@ -363,7 +382,12 @@ const ProjectAlertsSettings = ({</></Button><div className='flex justify-between items-center'>- <Button className='mr-2 border-indigo-100 dark:text-gray-50 dark:border-slate-700/50 dark:bg-slate-800 dark:hover:bg-slate-700' onClick={onCancel} secondary regular>+ <Button+ className='mr-2 border-indigo-100 dark:text-gray-50 dark:border-slate-700/50 dark:bg-slate-800 dark:hover:bg-slate-700'+ onClick={onCancel}+ secondary+ regular+ >{t('common.cancel')}</Button><Button type='submit' primary regular>@@ -373,7 +397,12 @@ const ProjectAlertsSettings = ({</div>) : (<div className='mt-5 flex justify-between items-center'>- <Button className='mr-2 border-indigo-100 dark:text-gray-50 dark:border-slate-700/50 dark:bg-slate-800 dark:hover:bg-slate-700' onClick={onCancel} secondary regular>+ <Button+ className='mr-2 border-indigo-100 dark:text-gray-50 dark:border-slate-700/50 dark:bg-slate-800 dark:hover:bg-slate-700'+ onClick={onCancel}+ secondary+ regular+ >{t('common.cancel')}</Button><Button type='submit' primary regular>diff --git a/app/pages/Project/Alerts/View/ProjectAlertsView.tsx b/app/pages/Project/Alerts/View/ProjectAlertsView.tsxindex f89093c58..5f9c8dd3f 100644--- a/app/pages/Project/Alerts/View/ProjectAlertsView.tsx+++ b/app/pages/Project/Alerts/View/ProjectAlertsView.tsx@@ -1,7 +1,5 @@/* eslint-disable react/forbid-prop-types */-import React, {- useMemo, memo, useState,-} from 'react'+import React, { useMemo, memo, useState } from 'react'import dayjs from 'dayjs'import _map from 'lodash/map'import _isEmpty from 'lodash/isEmpty'@@ -13,9 +11,7 @@ import _trucate from 'lodash/truncate'import { useNavigate } from '@remix-run/react'import { useTranslation } from 'react-i18next'import PropTypes from 'prop-types'-import {- BellIcon, CurrencyDollarIcon, PencilSquareIcon, FolderPlusIcon,-} from '@heroicons/react/24/outline'+import { BellIcon, CurrencyDollarIcon, PencilSquareIcon, FolderPlusIcon } from '@heroicons/react/24/outline'import routes from 'routesPath'import Button from 'ui/Button'@@ -25,25 +21,33 @@ import { IAlerts } from 'redux/models/IAlerts'import { IUser } from 'redux/models/IUser'const ProjectAlerts = ({- projectId, alerts, loading, user, total, authenticated,+ projectId,+ alerts,+ loading,+ user,+ total,+ authenticated,}: {- projectId: string,- alerts: IAlerts[],- loading: boolean,- user: IUser,- total: number,- authenticated: boolean,+ projectId: string+ alerts: IAlerts[]+ loading: boolean+ user: IUser+ total: number+ authenticated: boolean}): JSX.Element => {- const { t, i18n: { language } }: {- t: (key: string) => string,- i18n: { language: string },+ const {+ t,+ i18n: { language },+ }: {+ t: (key: string) => string+ i18n: { language: string }} = useTranslation()const [isPaidFeatureOpened, setIsPaidFeatureOpened] = useState<boolean>(false)const navigate = useNavigate()// @ts-ignoreconst limits = PLAN_LIMITS[user?.planCode] || PLAN_LIMITS.trial- const isLimitReached = authenticated && (total >= limits?.maxAlerts)+ const isLimitReached = authenticated && total >= limits?.maxAlertsconst projectAlerts = useMemo(() => {if (loading) return []@@ -51,14 +55,18 @@ const ProjectAlerts = ({}, [projectId, alerts, loading])const queryMetricTMapping: {- [key: string]: string,+ [key: string]: string} = useMemo(() => {const values = _values(QUERY_METRIC)- return _reduce(values, (prev, curr) => ({- ...prev,- [curr]: t(`alert.metrics.${curr}`),- }), {})+ return _reduce(+ values,+ (prev, curr) => ({+ ...prev,+ [curr]: t(`alert.metrics.${curr}`),+ }),+ {},+ )}, [t])const isIntegrationLinked = useMemo(() => {@@ -79,15 +87,8 @@ const ProjectAlerts = ({<div className='flex justify-between items-center mt-4'>{!loading && !_isEmpty(projectAlerts) && (<>- <h2 className='text-2xl font-bold dark:text-white text-gray-800'>- {t('dashboard.alerts')}- </h2>- <Button- type='button'- primary- large- onClick={handleNewAlert}- >+ <h2 className='text-2xl font-bold dark:text-white text-gray-800'>{t('dashboard.alerts')}</h2>+ <Button type='button' primary large onClick={handleNewAlert}><>{isLimitReached ? (<CurrencyDollarIcon className='w-5 h-5 mr-1' />@@ -101,22 +102,14 @@ const ProjectAlerts = ({)}</div><div className='mt-4'>- {loading && (- <div>- {t('common.loading')}- </div>- )}- {(!loading && _isEmpty(projectAlerts)) && (+ {loading && <div>{t('common.loading')}</div>}+ {!loading && _isEmpty(projectAlerts) && (<div className='p-5 mt-5 bg-gray-700 rounded-xl'><div className='flex items-center text-gray-50'><BellIcon className='w-8 h-8 mr-2' />- <p className='font-bold text-3xl'>- {t('dashboard.alerts')}- </p>+ <p className='font-bold text-3xl'>{t('dashboard.alerts')}</p></div>- <p className='text-lg whitespace-pre-wrap mt-2 text-gray-100'>- {t('dashboard.alertsDesc')}- </p>+ <p className='text-lg whitespace-pre-wrap mt-2 text-gray-100'>{t('dashboard.alertsDesc')}</p><ButtononClick={handleNewAlert}className='mt-6 bg-white py-2 px-3 md:px-4 border border-transparent rounded-md text-base font-medium text-gray-700 hover:bg-indigo-50'@@ -124,53 +117,49 @@ const ProjectAlerts = ({large><>- {isLimitReached && (- <CurrencyDollarIcon className='w-5 h-5 mr-1' />- )}+ {isLimitReached && <CurrencyDollarIcon className='w-5 h-5 mr-1' />}{t('alert.add')}</></Button></div>)}- {(!loading && !_isEmpty(projectAlerts)) && (+ {!loading && !_isEmpty(projectAlerts) && (<table className='w-full mb-3 border-separate border-spacing-y-4'><tbody>- {_map(projectAlerts, ({- id, name, queryMetric, lastTriggered,- }) => (+ {_map(projectAlerts, ({ id, name, queryMetric, lastTriggered }) => (<tr key={id} className='bg-white dark:bg-slate-900 rounded-lg shadow-lg'><td className='p-4 pr-0 rounded-l-lg justify-start'><div className='flex flex-col'><div className='text-lg font-bold dark:text-white text-gray-800 hidden lg:block'>{name}</div>- <div className='text-lg font-bold dark:text-white text-gray-800 hidden md:block lg:hidden'>{_trucate(name, { length: 35 })}</div>- <div className='text-lg font-bold dark:text-white text-gray-800 hidden sm:block md:hidden'>{_trucate(name, { length: 20 })}</div>- <div className='text-lg font-bold dark:text-white text-gray-800 sm:hidden'>{_trucate(name, { length: 10 })}</div>+ <div className='text-lg font-bold dark:text-white text-gray-800 hidden md:block lg:hidden'>+ {_trucate(name, { length: 35 })}+ </div>+ <div className='text-lg font-bold dark:text-white text-gray-800 hidden sm:block md:hidden'>+ {_trucate(name, { length: 20 })}+ </div>+ <div className='text-lg font-bold dark:text-white text-gray-800 sm:hidden'>+ {_trucate(name, { length: 10 })}+ </div><div className='text-sm dark:text-gray-400 text-gray-600'>{queryMetricTMapping[queryMetric]}</div></div>-</td><td className='py-4'><div className='flex flex-col'>- <div className='text-sm dark:text-gray-400 text-gray-600'>- {t('alert.lastTriggered')}- </div>+ <div className='text-sm dark:text-gray-400 text-gray-600'>{t('alert.lastTriggered')}</div><div className='text-lg font-bold dark:text-white text-gray-800'>{lastTriggered- ? (language === 'en'+ ? language === 'en'? dayjs(lastTriggered).locale(language).format('MMMM D, YYYY')- : dayjs(lastTriggered).locale(language).format('D MMMM, YYYY'))+ : dayjs(lastTriggered).locale(language).format('D MMMM, YYYY'): t('alert.never')}</div></div>-</td><td className='rounded-r-lg p-4 pl-0'><div className='flex items-center justify-end'>{!isIntegrationLinked && (- <p className='text-gray-800 dark:text-gray-200 text-sm mr-3'>- {t('alert.noNotification')}- </p>+ <p className='text-gray-800 dark:text-gray-200 text-sm mr-3'>{t('alert.noNotification')}</p>)}<ButtononClick={() => {@@ -186,7 +175,6 @@ const ProjectAlerts = ({</></Button></div>-</td></tr>))}@@ -194,10 +182,7 @@ const ProjectAlerts = ({</table>)}</div>- <PaidFeature- isOpened={isPaidFeatureOpened}- onClose={() => setIsPaidFeatureOpened(false)}- />+ <PaidFeature isOpened={isPaidFeatureOpened} onClose={() => setIsPaidFeatureOpened(false)} /></div>)}diff --git a/app/pages/Project/ConfirmShare/index.tsx b/app/pages/Project/ConfirmShare/index.tsxindex 461a152d8..28d5e0f26 100644--- a/app/pages/Project/ConfirmShare/index.tsx+++ b/app/pages/Project/ConfirmShare/index.tsx@@ -11,7 +11,9 @@ import routes from 'routesPath'import { AppDispatch } from 'redux/store'const ConfirmShare = () => {- const { t }: {+ const {+ t,+ }: {t: (key: string) => string} = useTranslation('common')const dispatch: AppDispatch = useDispatch()diff --git a/app/pages/Project/ProjectProtectedPassword/index.tsx b/app/pages/Project/ProjectProtectedPassword/index.tsxindex 54844012c..ebdcc2be7 100644--- a/app/pages/Project/ProjectProtectedPassword/index.tsx+++ b/app/pages/Project/ProjectProtectedPassword/index.tsx@@ -16,32 +16,41 @@ import Header from 'components/Header'import Footer from 'components/Footer'interface IProjectProtectedPasswordForm {- password: string,+ password: string}const MAX_PASSWORD_LENGTH = 80const ProjectProtectedPassword = ({- ssrTheme, embedded, isAuth,+ ssrTheme,+ embedded,+ isAuth,}: {- ssrTheme: "light" | "dark",- embedded: boolean,+ ssrTheme: 'light' | 'dark'+ embedded: booleanisAuth: boolean}): JSX.Element => {- const { t }: {- t: (key: string, optinions?: {- [key: string]: string | number,- }) => string,+ const {+ t,+ }: {+ t: (+ key: string,+ optinions?: {+ [key: string]: string | number+ },+ ) => string} = useTranslation('common')const [form, setForm] = useState<IProjectProtectedPasswordForm>({password: '',})const [validated, setValidated] = useState<boolean>(false)const [errors, setErrors] = useState<{- password?: string,+ password?: string}>({})- const { id }: {- id: string,+ const {+ id,+ }: {+ id: string} = useParams()const [beenSubmitted, setBeenSubmitted] = useState<boolean>(false)const [isLoading, setIsLoading] = useState<boolean>(false)@@ -50,7 +59,7 @@ const ProjectProtectedPassword = ({const validate = () => {const allErrors = {} as {- password?: string,+ password?: string}if (_isEmpty(form.password)) {@@ -77,10 +86,12 @@ const ProjectProtectedPassword = ({await checkPassword(id, data.password).then((res) => {if (res) {- dispatch(UIActions.setProjectProtectedPassword({- id,- password: data.password,- }))+ dispatch(+ UIActions.setProjectProtectedPassword({+ id,+ password: data.password,+ }),+ )navigate({pathname: _replace(routes.project, ':id', id),search: `?embedded=${embedded}&theme=${ssrTheme}`,@@ -99,12 +110,10 @@ const ProjectProtectedPassword = ({}}- const handleInput = ({ target }: {- target: HTMLInputElement,- }) => {+ const handleInput = ({ target }: { target: HTMLInputElement }) => {const value = target.type === 'checkbox' ? target.checked : target.value- setForm(oldForm => ({+ setForm((oldForm) => ({...oldForm,[target.name]: value,}))@@ -126,14 +135,10 @@ const ProjectProtectedPassword = ({return (<>- {!embedded && (- <Header ssrTheme={ssrTheme} authenticated={isAuth} />- )}+ {!embedded && <Header ssrTheme={ssrTheme} authenticated={isAuth} />}<div className='min-h-page bg-gray-50 dark:bg-slate-900 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-bold text-gray-900 dark:text-gray-50'>- {t('titles.passwordProtected')}- </h2>+ <h2 className='mt-2 text-3xl font-bold text-gray-900 dark:text-gray-50'>{t('titles.passwordProtected')}</h2><Inputname='password'id='password'@@ -146,7 +151,12 @@ const ProjectProtectedPassword = ({error={beenSubmitted && errors.password}/><div className='mt-5'>- <Button className='mr-2 border-indigo-100 dark:text-gray-50 dark:border-slate-700/50 dark:bg-slate-800 dark:hover:bg-slate-700' onClick={onCancel} secondary regular>+ <Button+ className='mr-2 border-indigo-100 dark:text-gray-50 dark:border-slate-700/50 dark:bg-slate-800 dark:hover:bg-slate-700'+ onClick={onCancel}+ secondary+ regular+ >{t('common.cancel')}</Button><Button type='submit' loading={isLoading} primary regular>@@ -155,9 +165,7 @@ const ProjectProtectedPassword = ({</div></form></div>- {!embedded && (- <Footer authenticated={isAuth} minimal />- )}+ {!embedded && <Footer authenticated={isAuth} minimal />}</>)}diff --git a/app/pages/Project/Settings/Emails/ConfirmReportsShare/index.tsx b/app/pages/Project/Settings/Emails/ConfirmReportsShare/index.tsxindex 133ec9979..2188915a6 100644--- a/app/pages/Project/Settings/Emails/ConfirmReportsShare/index.tsx+++ b/app/pages/Project/Settings/Emails/ConfirmReportsShare/index.tsx@@ -9,10 +9,14 @@ import { confirmSubscriberInvite } from 'api'import routes from 'routesPath'const ConfirmReportsShare = (): JSX.Element => {- const { t }: {+ const {+ t,+ }: {t: (key: string) => string} = useTranslation('common')- const { id }: {+ const {+ id,+ }: {id: string} = useParams()const [loading, setLoading] = useState<boolean>(true)diff --git a/app/pages/Project/Settings/Emails/Emails.container.tsx b/app/pages/Project/Settings/Emails/Emails.container.tsxindex 0eb84826b..435a05add 100644--- a/app/pages/Project/Settings/Emails/Emails.container.tsx+++ b/app/pages/Project/Settings/Emails/Emails.container.tsx@@ -10,27 +10,35 @@ const mapStateToProps = (state: StateType) => ({const mapDispatchToProps = (dispatch: AppDispatch) => ({emailFailed: (message: string) => {- dispatch(errorsActions.genericError({- message,- }))+ dispatch(+ errorsActions.genericError({+ message,+ }),+ )},addEmail: (message: string, type = 'success') => {- dispatch(alertsActions.generateAlerts({- message,- type,- }))+ dispatch(+ alertsActions.generateAlerts({+ message,+ type,+ }),+ )},removeEmail: (message: string, type = 'success') => {- dispatch(alertsActions.generateAlerts({- message,- type,- }))+ dispatch(+ alertsActions.generateAlerts({+ message,+ type,+ }),+ )},reportTypeNotifiction: (message: string, type = 'success') => {- dispatch(alertsActions.generateAlerts({- message,- type,- }))+ dispatch(+ alertsActions.generateAlerts({+ message,+ type,+ }),+ )},})diff --git a/app/pages/Project/Settings/Emails/Emails.tsx b/app/pages/Project/Settings/Emails/Emails.tsxindex 474393c2e..a26ab380f 100644--- a/app/pages/Project/Settings/Emails/Emails.tsx+++ b/app/pages/Project/Settings/Emails/Emails.tsx@@ -1,9 +1,5 @@-import React, {- useState, useEffect, useRef,-} from 'react'-import {- TrashIcon, InboxStackIcon, ChevronDownIcon, CheckIcon,-} from '@heroicons/react/24/outline'+import React, { useState, useEffect, useRef } from 'react'+import { TrashIcon, InboxStackIcon, ChevronDownIcon, CheckIcon } from '@heroicons/react/24/outline'import { useTranslation } from 'react-i18next'import PropTypes from 'prop-types'import dayjs from 'dayjs'@@ -13,9 +9,7 @@ import _filter from 'lodash/filter'import _map from 'lodash/map'import _toLower from 'lodash/toLower'-import {- addSubscriber, removeSubscriber, getSubscribers, updateSubscriber,-} from 'api'+import { addSubscriber, removeSubscriber, getSubscribers, updateSubscriber } from 'api'import { isValidEmail } from 'utils/validator'import useOnClickOutside from 'hooks/useOnClickOutside'@@ -31,7 +25,12 @@ import { Badge } from 'ui/Badge'import { ISubscribers } from 'redux/models/ISubscribers'const ModalMessage = ({- project, handleInput, beenSubmitted, errors, form, t,+ project,+ handleInput,+ beenSubmitted,+ errors,+ form,+ t,}: {project: stringhandleInput: (e: React.ChangeEvent<HTMLInputElement>) => void@@ -44,17 +43,18 @@ const ModalMessage = ({email: stringreportFrequency: string}- t: (key: string, options?: {- [key: string]: string | number | boolean | undefined- }) => string+ t: (+ key: string,+ options?: {+ [key: string]: string | number | boolean | undefined+ },+ ) => string}): JSX.Element => (<div><h2 className='text-xl font-bold text-gray-700 dark:text-gray-200'>{t('project.settings.inviteTo', { project })}</h2>- <p className='mt-2 text-base text-gray-700 dark:text-gray-200'>- {t('project.settings.inviteDesc')}- </p>+ <p className='mt-2 text-base text-gray-700 dark:text-gray-200'>{t('project.settings.inviteDesc')}</p><Inputname='email'id='email'@@ -71,17 +71,23 @@ const ModalMessage = ({<label className='block text-sm font-medium text-gray-700 dark:text-gray-300' htmlFor='role'>{t('project.emails.reportFrequency')}</label>- <div className={cx('mt-1 bg-white rounded-md -space-y-px dark:bg-slate-900', { 'border-red-300 border': errors.reportFrequency })}>+ <div+ className={cx('mt-1 bg-white rounded-md -space-y-px dark:bg-slate-900', {+ 'border-red-300 border': errors.reportFrequency,+ })}+ >{/* eslint-disable-next-line jsx-a11y/label-has-associated-control */}{_map(reportFrequencyForEmailsOptions, (item, index) => (<div key={item.value}>{/* eslint-disable-next-line jsx-a11y/label-has-associated-control */}- <label className={cx('dark:border-gray-500 relative border p-4 flex cursor-pointer border-gray-200', {- 'bg-indigo-50 border-indigo-200 dark:bg-indigo-500 dark:border-indigo-800 z-10': item.value === form.reportFrequency,- 'border-gray-200': form.reportFrequency !== item.value,- 'rounded-tl-md rounded-tr-md': index === 0,- 'rounded-bl-md rounded-br-md': index === reportFrequencyForEmailsOptions.length - 1,- })}+ <label+ className={cx('dark:border-gray-500 relative border p-4 flex cursor-pointer border-gray-200', {+ 'bg-indigo-50 border-indigo-200 dark:bg-indigo-500 dark:border-indigo-800 z-10':+ item.value === form.reportFrequency,+ 'border-gray-200': form.reportFrequency !== item.value,+ 'rounded-tl-md rounded-tr-md': index === 0,+ 'rounded-bl-md rounded-br-md': index === reportFrequencyForEmailsOptions.length - 1,+ })}><inputname='reportFrequency'@@ -92,7 +98,12 @@ const ModalMessage = ({onChange={handleInput}/><div className='ml-3 flex flex-col'>- <span className={cx('block text-sm font-medium', { 'text-indigo-900 dark:text-white': form.reportFrequency === item.value, 'text-gray-700 dark:text-gray-200': form.reportFrequency !== item.value })}>+ <span+ className={cx('block text-sm font-medium', {+ 'text-indigo-900 dark:text-white': form.reportFrequency === item.value,+ 'text-gray-700 dark:text-gray-200': form.reportFrequency !== item.value,+ })}+ >{t(`profileSettings.${item.value}`)}</span></div>@@ -102,14 +113,22 @@ const ModalMessage = ({{/* eslint-disable-next-line jsx-a11y/label-has-associated-control */}</div>{errors.reportFrequency && (- <p className='mt-2 text-sm text-red-600 dark:text-red-500' id='email-error'>{errors.reportFrequency}</p>+ <p className='mt-2 text-sm text-red-600 dark:text-red-500' id='email-error'>+ {errors.reportFrequency}+ </p>)}</fieldset></div>)const EmailList = ({- data, onRemove, t, setEmails, emailFailed, language, reportTypeNotifiction,+ data,+ onRemove,+ t,+ setEmails,+ emailFailed,+ language,+ reportTypeNotifiction,}: {data: {id: string@@ -120,10 +139,13 @@ const EmailList = ({reportFrequency: string}onRemove: (id: string) => void- t: (key: string, options?: {- [key: string]: string | number | boolean | undefined- }) => string- setEmails: (value: ISubscribers[] | ((prevVar: ISubscribers[]) => ISubscribers[])) => void;+ t: (+ key: string,+ options?: {+ [key: string]: string | number | boolean | undefined+ },+ ) => string+ setEmails: (value: ISubscribers[] | ((prevVar: ISubscribers[]) => ISubscribers[])) => voidemailFailed: (message: string) => voidlanguage: stringreportTypeNotifiction: (message: string) => void@@ -132,14 +154,9 @@ const EmailList = ({const [showDeleteModal, setShowDeleteModal] = useState<boolean>(false)const openRef = useRef<HTMLDivElement>(null)useOnClickOutside(openRef, () => setOpen(false))- const {- id, addedAt, isConfirmed, projectId, email, reportFrequency,- } = data+ const { id, addedAt, isConfirmed, projectId, email, reportFrequency } = data- const changeRole = async (reportType: {- value: string- label: string- }) => {+ const changeRole = async (reportType: { value: string; label: string }) => {try {const results = await updateSubscriber(projectId, id, { reportFrequency: reportType.value })setEmails((prev) => {@@ -179,15 +196,16 @@ const EmailList = ({className='inline-flex items-center shadow-sm pl-2 pr-1 py-0.5 border border-gray-200 dark:border-gray-600 text-sm leading-5 font-medium rounded-full bg-white dark:bg-slate-800 text-gray-700 dark:text-gray-200 hover:bg-gray-50 dark:hover:bg-gray-600'>{t(`profileSettings.${_toLower(reportFrequency)}`)}- <ChevronDownIcon- style={{ transform: open ? 'rotate(180deg)' : '' }}- className='w-4 h-4 pt-px ml-0.5'- />+ <ChevronDownIcon style={{ transform: open ? 'rotate(180deg)' : '' }} className='w-4 h-4 pt-px ml-0.5' /></button>{open && (<ul className='text-left origin-top-right absolute z-10 right-0 mt-2 w-72 rounded-md shadow-lg bg-white dark:bg-slate-900 divide-y divide-gray-200 dark:divide-gray-700 focus:outline-none'>{_map(reportFrequencyForEmailsOptions, (item) => (- <li onClick={() => changeRole(item)} className='p-4 hover:bg-indigo-600 group cursor-pointer flex justify-between items-center' key={item.value}>+ <li+ onClick={() => changeRole(item)}+ className='p-4 hover:bg-indigo-600 group cursor-pointer flex justify-between items-center'+ key={item.value}+ ><div><p className='font-bold text-gray-700 dark:text-gray-200 group-hover:text-gray-200'>{t(`profileSettings.${_toLower(item.label)}`)}@@ -200,11 +218,15 @@ const EmailList = ({)}</li>))}- <li onClick={() => { setOpen(false); setShowDeleteModal(true) }} className='p-4 hover:bg-gray-200 dark:hover:bg-gray-700 group cursor-pointer flex justify-between items-center'>+ <li+ onClick={() => {+ setOpen(false)+ setShowDeleteModal(true)+ }}+ className='p-4 hover:bg-gray-200 dark:hover:bg-gray-700 group cursor-pointer flex justify-between items-center'+ ><div>- <p className='font-bold text-red-600 dark:text-red-500'>- {t('project.settings.removeMember')}- </p>+ <p className='font-bold text-red-600 dark:text-red-500'>{t('project.settings.removeMember')}</p></div></li></ul>@@ -212,11 +234,7 @@ const EmailList = ({</div>) : (<div className='flex items-center justify-end'>- <Badge- colour='yellow'- className='mr-3'- label={t('common.pending')}- />+ <Badge colour='yellow' className='mr-3' label={t('common.pending')} /><Buttontype='button'className='bg-white text-indigo-700 rounded-md text-base font-medium hover:bg-indigo-50 dark:text-gray-50 dark:border-gray-600 dark:bg-slate-800 dark:hover:bg-slate-700'@@ -263,20 +281,21 @@ EmailList.defaultProps = {data: {},}-const NoSubscribers = ({ t }: {- t: (string: string) => string,-}): JSX.Element => (+const NoSubscribers = ({ t }: { t: (string: string) => string }): JSX.Element => (<div className='flex flex-col py-6 sm:px-6 lg:px-8'><div className='max-w-7xl w-full mx-auto text-gray-900 dark:text-gray-50'>- <h2 className='text-xl mb-8 text-center leading-snug px-4'>- {t('project.settings.noPeople')}- </h2>+ <h2 className='text-xl mb-8 text-center leading-snug px-4'>{t('project.settings.noPeople')}</h2></div></div>)const Emails = ({- emailFailed, addEmail, removeEmail, projectId, projectName, reportTypeNotifiction,+ emailFailed,+ addEmail,+ removeEmail,+ projectId,+ projectName,+ reportTypeNotifiction,}: {emailFailed: (message: string, type?: string) => voidaddEmail: (message: string, type?: string) => void@@ -286,23 +305,29 @@ const Emails = ({reportTypeNotifiction: (message: string, type?: string) => void}): JSX.Element => {const [showModal, setShowModal] = useState<boolean>(false)- const { t, i18n: { language } }: {- t: (string: string, options?: {- [key: string]: string | number | boolean | undefined | null- }) => string,- i18n: { language: string },+ const {+ t,+ i18n: { language },+ }: {+ t: (+ string: string,+ options?: {+ [key: string]: string | number | boolean | undefined | null+ },+ ) => string+ i18n: { language: string }} = useTranslation('common')const [form, setForm] = useState<{- email: string,- reportFrequency: string,+ email: string+ reportFrequency: string}>({email: '',reportFrequency: reportFrequencyForEmailsOptions[3].value,})const [beenSubmitted, setBeenSubmitted] = useState<boolean>(false)const [errors, setErrors] = useState<{- email?: string,- reportFrequency?: string,+ email?: string+ reportFrequency?: string}>({})const [validated, setValidated] = useState<boolean>(false)const [emails, setEmails] = useState<ISubscribers[]>([])@@ -316,7 +341,7 @@ const Emails = ({const getSubcribersAsync = async () => {try {const { subscribers, count } = await getSubscribers(projectId, paggination.page - 1, paggination.limit)- setPaggination(oldPaggination => ({+ setPaggination((oldPaggination) => ({...oldPaggination,count,}))@@ -334,8 +359,8 @@ const Emails = ({const validate = () => {const allErrors: {- email?: string,- reportFrequency?: string,+ email?: string+ reportFrequency?: string} = {}if (!isValidEmail(form.email)) {@@ -357,7 +382,7 @@ const Emails = ({const handleInput = ({ target }: React.ChangeEvent<HTMLInputElement>) => {const value = target.type === 'checkbox' ? target.checked : target.value- setForm(oldForm => ({+ setForm((oldForm) => ({...oldForm,[target.name]: value,}))@@ -403,7 +428,7 @@ const Emails = ({const onRemove = async (email: string) => {try {await removeSubscriber(projectId, email)- const results = _filter(emails, s => s.id !== email)+ const results = _filter(emails, (s) => s.id !== email)setEmails(results)removeEmail(t('apiNotifications.emailDelete'))} catch (e) {@@ -422,17 +447,9 @@ const Emails = ({<Beta /></div></h3>- <p className='text-sm text-gray-500 dark:text-gray-400'>- {t('project.emails.description')}- </p>+ <p className='text-sm text-gray-500 dark:text-gray-400'>{t('project.emails.description')}</p></div>- <Button- className='h-8 pl-2 whitespace-nowrap'- primary- regular- type='button'- onClick={() => setShowModal(true)}- >+ <Button className='h-8 pl-2 whitespace-nowrap' primary regular type='button' onClick={() => setShowModal(true)}><><InboxStackIcon className='w-5 h-5 mr-1' />{t('project.emails.add')}@@ -443,15 +460,21 @@ const Emails = ({<div className='mt-3 flex flex-col'><div className='-my-2 -mx-4 overflow-x-auto md:overflow-x-visible sm:-mx-6 lg:-mx-8'><div className='inline-block min-w-full py-2 md:px-6 lg:px-8'>- {(!loading && !_isEmpty(emails)) && (+ {!loading && !_isEmpty(emails) && (<div className='shadow ring-1 ring-black ring-opacity-5 md:rounded-lg'><table className='min-w-full divide-y divide-gray-300 dark:divide-gray-600'><thead><tr className='dark:bg-slate-800'>- <th scope='col' className='py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6 dark:text-white'>+ <th+ scope='col'+ className='py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6 dark:text-white'+ >{t('auth.common.email')}</th>- <th scope='col' className='px-3 py-3.5 text-left text-sm font-semibold text-gray-900 dark:text-white'>+ <th+ scope='col'+ className='px-3 py-3.5 text-left text-sm font-semibold text-gray-900 dark:text-white'+ >{t('auth.common.addedOn')}</th><th scope='col' />@@ -459,7 +482,7 @@ const Emails = ({</tr></thead><tbody className='divide-y divide-gray-300 dark:divide-gray-600'>- {_map(emails, email => (+ {_map(emails, (email) => (<EmailListdata={email}key={email.id}@@ -475,19 +498,15 @@ const Emails = ({</table></div>)}- {_isEmpty(emails) && (- <NoSubscribers t={t} />- )}- {loading && (- <Loader />- )}+ {_isEmpty(emails) && <NoSubscribers t={t} />}+ {loading && <Loader />}</div></div></div></div><ModalonClose={closeModal}- customButtons={(+ customButtons={<buttontype='button'className='w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 text-base font-medium text-white sm:ml-3 sm:w-auto sm:text-sm bg-indigo-600 hover:bg-indigo-700'@@ -495,9 +514,9 @@ const Emails = ({>{t('project.emails.add')}</button>- )}+ }closeText={t('common.cancel')}- message={(+ message={<ModalMessaget={t}project={projectName}@@ -506,7 +525,7 @@ const Emails = ({errors={errors}beenSubmitted={beenSubmitted}/>- )}+ }isOpened={showModal}/></div>diff --git a/app/pages/Project/Settings/People/People.container.tsx b/app/pages/Project/Settings/People/People.container.tsxindex d39372375..964ab7b6a 100644--- a/app/pages/Project/Settings/People/People.container.tsx+++ b/app/pages/Project/Settings/People/People.container.tsx@@ -13,34 +13,44 @@ const mapStateToProps = (state: StateType) => ({const mapDispatchToProps = (dispatch: AppDispatch) => ({updateProjectFailed: (message: string) => {- dispatch(errorsActions.updateProjectFailed({- message,- }))+ dispatch(+ errorsActions.updateProjectFailed({+ message,+ }),+ )},setProjectShareData: (data: Partial<IProject>, projectId: string, shared = false) => {- dispatch(UIActions.setProjectsShareData({- data,- id: projectId,- shared,- }))+ dispatch(+ UIActions.setProjectsShareData({+ data,+ id: projectId,+ shared,+ }),+ )},roleUpdatedNotification: (message: string, type = 'success') => {- dispatch(alertsActions.roleUpdated({- message,- type,- }))+ dispatch(+ alertsActions.roleUpdated({+ message,+ type,+ }),+ )},inviteUserNotification: (message: string, type = 'success') => {- dispatch(alertsActions.inviteUser({- message,- type,- }))+ dispatch(+ alertsActions.inviteUser({+ message,+ type,+ }),+ )},removeUserNotification: (message: string, type = 'success') => {- dispatch(alertsActions.removeUser({- message,- type,- }))+ dispatch(+ alertsActions.removeUser({+ message,+ type,+ }),+ )},})diff --git a/app/pages/Project/Settings/People/People.tsx b/app/pages/Project/Settings/People/People.tsxindex 9f6fd17bf..500948746 100644--- a/app/pages/Project/Settings/People/People.tsx+++ b/app/pages/Project/Settings/People/People.tsx@@ -17,32 +17,37 @@ import { Badge } from 'ui/Badge'import Button from 'ui/Button'import Modal from 'ui/Modal'import PaidFeature from 'modals/PaidFeature'-import {- roles, roleViewer, roleAdmin, INVITATION_EXPIRES_IN,-} from 'redux/constants'+import { roles, roleViewer, roleAdmin, INVITATION_EXPIRES_IN } from 'redux/constants'import useOnClickOutside from 'hooks/useOnClickOutside'import { IProject, IShareOwnerProject } from 'redux/models/IProject'-const NoEvents = ({ t }: {- t: (key: string) => string-}): JSX.Element => (+const NoEvents = ({ t }: { t: (key: string) => string }): JSX.Element => (<div className='flex flex-col py-6 sm:px-6 lg:px-8'><div className='max-w-7xl w-full mx-auto text-gray-900 dark:text-gray-50'>- <h2 className='text-xl mb-8 text-center leading-snug px-4'>- {t('project.settings.noPeople')}- </h2>+ <h2 className='text-xl mb-8 text-center leading-snug px-4'>{t('project.settings.noPeople')}</h2></div></div>)const UsersList = ({- data, onRemove, t, share, setProjectShareData, pid, updateProjectFailed, language, roleUpdatedNotification,+ data,+ onRemove,+ t,+ share,+ setProjectShareData,+ pid,+ updateProjectFailed,+ language,+ roleUpdatedNotification,}: {data: IShareOwnerProjectonRemove: (id: string) => void- t: (key: string, options?: {- [key: string]: string | number | null- }) => string+ t: (+ key: string,+ options?: {+ [key: string]: string | number | null+ },+ ) => stringshare?: IShareOwnerProject[]setProjectShareData: (item: Partial<IProject>, id: string) => voidpid: string@@ -54,9 +59,7 @@ const UsersList = ({const [showDeleteModal, setShowDeleteModal] = useState<boolean>(false)const openRef = useRef<HTMLDivElement>(null)useOnClickOutside(openRef, () => setOpen(false))- const {- id, created, confirmed, role, user,- } = data+ const { id, created, confirmed, role, user } = dataconst changeRole = async (newRole: string) => {try {@@ -96,15 +99,16 @@ const UsersList = ({className='inline-flex items-center shadow-sm pl-2 pr-1 py-0.5 border border-gray-200 dark:border-gray-600 text-sm leading-5 font-medium rounded-full bg-white dark:bg-slate-800 text-gray-700 dark:text-gray-200 hover:bg-gray-50 dark:hover:bg-gray-600'>{t(`project.settings.roles.${role}.name`)}- <ChevronDownIcon- style={{ transform: open ? 'rotate(180deg)' : '' }}- className='w-4 h-4 pt-px ml-0.5'- />+ <ChevronDownIcon style={{ transform: open ? 'rotate(180deg)' : '' }} className='w-4 h-4 pt-px ml-0.5' /></button>{open && (<ul className='text-left origin-top-right absolute z-10 right-0 mt-2 w-72 rounded-md shadow-lg bg-white dark:bg-slate-900 divide-y divide-gray-200 dark:divide-gray-700 focus:outline-none'>{_map(roles, (itRole) => (- <li onClick={() => changeRole(itRole)} className='p-4 hover:bg-indigo-600 group cursor-pointer flex justify-between items-center' key={itRole}>+ <li+ onClick={() => changeRole(itRole)}+ className='p-4 hover:bg-indigo-600 group cursor-pointer flex justify-between items-center'+ key={itRole}+ ><div><p className='font-bold text-gray-700 dark:text-gray-200 group-hover:text-gray-200'>{t(`project.settings.roles.${itRole}.name`)}@@ -120,11 +124,15 @@ const UsersList = ({)}</li>))}- <li onClick={() => { setOpen(false); setShowDeleteModal(true) }} className='p-4 hover:bg-gray-200 dark:hover:bg-gray-700 group cursor-pointer flex justify-between items-center'>+ <li+ onClick={() => {+ setOpen(false)+ setShowDeleteModal(true)+ }}+ className='p-4 hover:bg-gray-200 dark:hover:bg-gray-700 group cursor-pointer flex justify-between items-center'+ ><div>- <p className='font-bold text-red-600 dark:text-red-500'>- {t('project.settings.removeMember')}- </p>+ <p className='font-bold text-red-600 dark:text-red-500'>{t('project.settings.removeMember')}</p></div></li></ul>@@ -132,11 +140,7 @@ const UsersList = ({</div>) : (<div className='flex items-center justify-end'>- <Badge- colour='yellow'- className='mr-3'- label={t('common.pending')}- />+ <Badge colour='yellow' className='mr-3' label={t('common.pending')} /><Buttontype='button'className='bg-white text-indigo-700 rounded-md text-base font-medium hover:bg-indigo-50 dark:text-gray-50 dark:border-gray-600 dark:bg-slate-800 dark:hover:bg-slate-700'@@ -183,48 +187,59 @@ UsersList.defaultProps = {}interface IPeopleProps {- project: IProject,- updateProjectFailed: (error: string) => void,- setProjectShareData: (data: Partial<IProject>, projectId: string, share?: boolean) => void,- roleUpdatedNotification: (email: string, role?: string) => void,- inviteUserNotification: (email: string, type?: string) => void,- removeUserNotification: (email: string) => void,- isPaidTierUsed: boolean,+ project: IProject+ updateProjectFailed: (error: string) => void+ setProjectShareData: (data: Partial<IProject>, projectId: string, share?: boolean) => void+ roleUpdatedNotification: (email: string, role?: string) => void+ inviteUserNotification: (email: string, type?: string) => void+ removeUserNotification: (email: string) => void+ isPaidTierUsed: boolean}const People: React.FunctionComponent<IPeopleProps> = ({- project, updateProjectFailed, setProjectShareData, roleUpdatedNotification, inviteUserNotification,- removeUserNotification, isPaidTierUsed,+ project,+ updateProjectFailed,+ setProjectShareData,+ roleUpdatedNotification,+ inviteUserNotification,+ removeUserNotification,+ isPaidTierUsed,}: IPeopleProps): JSX.Element => {const [showModal, setShowModal] = useState<boolean>(false)const [isPaidFeatureOpened, setIsPaidFeatureOpened] = useState<boolean>(false)- const { t, i18n: { language } }: {- t: (key: string, options?: {- [key: string]: string | number | null- }) => string,+ const {+ t,+ i18n: { language },+ }: {+ t: (+ key: string,+ options?: {+ [key: string]: string | number | null+ },+ ) => stringi18n: {language: string}} = useTranslation('common')const [form, setForm] = useState<{- email: string,- role: string,+ email: string+ role: string}>({email: '',role: '',})const [beenSubmitted, setBeenSubmitted] = useState<boolean>(false)const [errors, setErrors] = useState<{- email?: string,- role?: string,+ email?: string+ role?: string}>({})const [validated, setValidated] = useState<boolean>(false)const { id, name, share } = projectconst validate = () => {const allErrors: {- email?: string,- role?: string,+ email?: string+ role?: string} = {}if (!isValidEmail(form.email)) {@@ -250,7 +265,7 @@ const People: React.FunctionComponent<IPeopleProps> = ({const handleInput = ({ target }: React.ChangeEvent<HTMLInputElement>) => {const value = target.type === 'checkbox' ? target.checked : target.value- setForm(oldForm => ({+ setForm((oldForm) => ({...oldForm,[target.name]: value,}))@@ -301,7 +316,10 @@ const People: React.FunctionComponent<IPeopleProps> = ({const onRemove = async (userId: string) => {try {await deleteShareProjectUsers(id, userId)- const newShared = _map(_filter(share, s => s.id !== userId), s => s)+ const newShared = _map(+ _filter(share, (s) => s.id !== userId),+ (s) => s,+ )setProjectShareData({ share: newShared }, id)removeUserNotification(t('apiNotifications.userRemoved'))} catch (e) {@@ -317,17 +335,9 @@ const People: React.FunctionComponent<IPeopleProps> = ({<h3 className='flex items-center mt-2 text-lg font-bold text-gray-900 dark:text-gray-50'>{t('project.settings.people')}</h3>- <p className='text-sm text-gray-500 dark:text-gray-400'>- {t('project.settings.inviteCoworkers')}- </p>+ <p className='text-sm text-gray-500 dark:text-gray-400'>{t('project.settings.inviteCoworkers')}</p></div>- <Button- className='h-8 pl-2'- primary- regular- type='button'- onClick={() => setShowModal(true)}- >+ <Button className='h-8 pl-2' primary regular type='button' onClick={() => setShowModal(true)}><><UserPlusIcon className='w-5 h-5 mr-1' />{t('project.settings.invite')}@@ -335,80 +345,80 @@ const People: React.FunctionComponent<IPeopleProps> = ({</Button></div><div>- {- _isEmpty(share) ? (- <NoEvents t={t} />- ) : (- <div className='mt-3 flex flex-col'>- <div className='-my-2 -mx-4 overflow-x-auto md:overflow-x-visible sm:-mx-6 lg:-mx-8'>- <div className='inline-block min-w-full py-2 md:px-6 lg:px-8'>- <div className='shadow ring-1 ring-black ring-opacity-5 md:rounded-lg'>- <table className='min-w-full divide-y divide-gray-300 dark:divide-gray-600'>- <thead>- <tr className='dark:bg-slate-800'>- <th scope='col' className='py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6 dark:text-white'>- {t('auth.common.email')}- </th>- <th scope='col' className='px-3 py-3.5 text-left text-sm font-semibold text-gray-900 dark:text-white'>- {t('profileSettings.sharedTable.joinedOn')}- </th>- <th scope='col' />- <th scope='col' />- </tr>- </thead>- <tbody className='divide-y divide-gray-300 dark:divide-gray-600'>- {_map(share, user => (- <UsersList- data={user}- key={user.id}- onRemove={onRemove}- t={t}- language={language}- share={project.share}- setProjectShareData={setProjectShareData}- updateProjectFailed={updateProjectFailed}- roleUpdatedNotification={roleUpdatedNotification}- pid={id}- />- ))}- </tbody>- </table>- </div>+ {_isEmpty(share) ? (+ <NoEvents t={t} />+ ) : (+ <div className='mt-3 flex flex-col'>+ <div className='-my-2 -mx-4 overflow-x-auto md:overflow-x-visible sm:-mx-6 lg:-mx-8'>+ <div className='inline-block min-w-full py-2 md:px-6 lg:px-8'>+ <div className='shadow ring-1 ring-black ring-opacity-5 md:rounded-lg'>+ <table className='min-w-full divide-y divide-gray-300 dark:divide-gray-600'>+ <thead>+ <tr className='dark:bg-slate-800'>+ <th+ scope='col'+ className='py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6 dark:text-white'+ >+ {t('auth.common.email')}+ </th>+ <th+ scope='col'+ className='px-3 py-3.5 text-left text-sm font-semibold text-gray-900 dark:text-white'+ >+ {t('profileSettings.sharedTable.joinedOn')}+ </th>+ <th scope='col' />+ <th scope='col' />+ </tr>+ </thead>+ <tbody className='divide-y divide-gray-300 dark:divide-gray-600'>+ {_map(share, (user) => (+ <UsersList+ data={user}+ key={user.id}+ onRemove={onRemove}+ t={t}+ language={language}+ share={project.share}+ setProjectShareData={setProjectShareData}+ updateProjectFailed={updateProjectFailed}+ roleUpdatedNotification={roleUpdatedNotification}+ pid={id}+ />+ ))}+ </tbody>+ </table></div></div></div>- )- }+ </div>+ )}</div>- <PaidFeature- isOpened={isPaidFeatureOpened}- onClose={() => setIsPaidFeatureOpened(false)}- />+ <PaidFeature isOpened={isPaidFeatureOpened} onClose={() => setIsPaidFeatureOpened(false)} /><ModalonClose={closeModal}- customButtons={(+ customButtons={<buttontype='button'- className={cx('w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 text-base font-medium text-white sm:ml-3 sm:w-auto sm:text-sm bg-indigo-600 hover:bg-indigo-700', {- 'opacity-80 !px-3': !isPaidTierUsed,- })}+ className={cx(+ 'w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 text-base font-medium text-white sm:ml-3 sm:w-auto sm:text-sm bg-indigo-600 hover:bg-indigo-700',+ {+ 'opacity-80 !px-3': !isPaidTierUsed,+ },+ )}onClick={handleSubmit}>- {!isPaidTierUsed && (- <CurrencyDollarIcon className='w-5 h-5 mr-1' />- )}+ {!isPaidTierUsed && <CurrencyDollarIcon className='w-5 h-5 mr-1' />}{t('common.invite')}</button>- )}+ }closeText={t('common.cancel')}- message={(+ message={<div><h2 className='text-xl font-bold text-gray-700 dark:text-gray-200'>{t('project.settings.inviteTo', { project: name })}</h2>- <p className='mt-2 text-base text-gray-700 dark:text-gray-200'>- {t('project.settings.inviteDesc')}- </p>+ <p className='mt-2 text-base text-gray-700 dark:text-gray-200'>{t('project.settings.inviteDesc')}</p><p className='mt-2 text-base text-gray-700 dark:text-gray-200'>{t('project.settings.inviteExpity', { amount: INVITATION_EXPIRES_IN })}</p>@@ -428,9 +438,22 @@ const People: React.FunctionComponent<IPeopleProps> = ({<label className='block text-sm font-medium text-gray-700 dark:text-gray-300' htmlFor='role'>{t('project.settings.role')}</label>- <div className={cx('mt-1 bg-white rounded-md -space-y-px dark:bg-slate-900', { 'border-red-300 border': errors.role })}>+ <div+ className={cx('mt-1 bg-white rounded-md -space-y-px dark:bg-slate-900', {+ 'border-red-300 border': errors.role,+ })}+ >{/* eslint-disable-next-line jsx-a11y/label-has-associated-control */}- <label className={cx('dark:border-gray-500 rounded-tl-md rounded-tr-md relative border p-4 flex cursor-pointer border-gray-200', { 'bg-indigo-50 border-indigo-200 dark:bg-indigo-500 dark:border-indigo-800 z-10': form.role === roleAdmin.role, 'border-gray-200': form.role !== roleAdmin.role })}>+ <label+ className={cx(+ 'dark:border-gray-500 rounded-tl-md rounded-tr-md relative border p-4 flex cursor-pointer border-gray-200',+ {+ 'bg-indigo-50 border-indigo-200 dark:bg-indigo-500 dark:border-indigo-800 z-10':+ form.role === roleAdmin.role,+ 'border-gray-200': form.role !== roleAdmin.role,+ },+ )}+ ><inputname='role'className='focus:ring-indigo-500 h-4 w-4 text-indigo-600 border-gray-300'@@ -440,16 +463,35 @@ const People: React.FunctionComponent<IPeopleProps> = ({onChange={handleInput}/><div className='ml-3 flex flex-col'>- <span className={cx('block text-sm font-medium', { 'text-indigo-900 dark:text-white': form.role === roleAdmin.role, 'text-gray-700 dark:text-gray-200': form.role !== roleAdmin.role })}>+ <span+ className={cx('block text-sm font-medium', {+ 'text-indigo-900 dark:text-white': form.role === roleAdmin.role,+ 'text-gray-700 dark:text-gray-200': form.role !== roleAdmin.role,+ })}+ >{t('project.settings.roles.admin.name')}</span>- <span className={cx('block text-sm', { 'text-indigo-700 dark:text-gray-100': form.role === roleAdmin.role, 'text-gray-700 dark:text-gray-200': form.role !== roleAdmin.role })}>+ <span+ className={cx('block text-sm', {+ 'text-indigo-700 dark:text-gray-100': form.role === roleAdmin.role,+ 'text-gray-700 dark:text-gray-200': form.role !== roleAdmin.role,+ })}+ >{t('project.settings.roles.admin.desc')}</span></div></label>{/* eslint-disable-next-line jsx-a11y/label-has-associated-control */}- <label className={cx('dark:border-gray-500 rounded-bl-md rounded-br-md relative border p-4 flex cursor-pointer border-gray-200', { 'bg-indigo-50 border-indigo-200 dark:bg-indigo-500 dark:border-indigo-800 z-10': form.role === roleViewer.role, 'border-gray-200': form.role !== roleViewer.role })}>+ <label+ className={cx(+ 'dark:border-gray-500 rounded-bl-md rounded-br-md relative border p-4 flex cursor-pointer border-gray-200',+ {+ 'bg-indigo-50 border-indigo-200 dark:bg-indigo-500 dark:border-indigo-800 z-10':+ form.role === roleViewer.role,+ 'border-gray-200': form.role !== roleViewer.role,+ },+ )}+ ><inputname='role'className='focus:ring-indigo-500 h-4 w-4 text-indigo-600 border-gray-300'@@ -459,21 +501,33 @@ const People: React.FunctionComponent<IPeopleProps> = ({onChange={handleInput}/><div className='ml-3 flex flex-col'>- <span className={cx('block text-sm font-medium', { 'text-indigo-900 dark:text-white': form.role === roleViewer.role, 'text-gray-700 dark:text-gray-200': form.role !== roleViewer.role })}>+ <span+ className={cx('block text-sm font-medium', {+ 'text-indigo-900 dark:text-white': form.role === roleViewer.role,+ 'text-gray-700 dark:text-gray-200': form.role !== roleViewer.role,+ })}+ >{t('project.settings.roles.viewer.name')}</span>- <span className={cx('block text-sm', { 'text-indigo-700 dark:text-gray-100': form.role === roleViewer.role, 'text-gray-700 dark:text-gray-200': form.role !== roleViewer.role })}>+ <span+ className={cx('block text-sm', {+ 'text-indigo-700 dark:text-gray-100': form.role === roleViewer.role,+ 'text-gray-700 dark:text-gray-200': form.role !== roleViewer.role,+ })}+ >{t('project.settings.roles.viewer.desc')}</span></div></label></div>{errors.role && (- <p className='mt-2 text-sm text-red-600 dark:text-red-500' id='email-error'>{errors.role}</p>+ <p className='mt-2 text-sm text-red-600 dark:text-red-500' id='email-error'>+ {errors.role}+ </p>)}</fieldset></div>- )}+ }isOpened={showModal}/></div>diff --git a/app/pages/Project/Settings/ProjectSettings.container.tsx b/app/pages/Project/Settings/ProjectSettings.container.tsxindex bbe028065..62899a2c1 100644--- a/app/pages/Project/Settings/ProjectSettings.container.tsx+++ b/app/pages/Project/Settings/ProjectSettings.container.tsx@@ -21,64 +21,78 @@ const mapStateToProps = (state: StateType) => ({const mapDispatchToProps = (dispatch: AppDispatch) => ({updateProjectFailed: (message: string) => {- dispatch(errorsActions.updateProjectFailed({- message,- }))+ dispatch(+ errorsActions.updateProjectFailed({+ message,+ }),+ )},createNewProjectFailed: (message: string) => {- dispatch(errorsActions.createNewProjectFailed({- message,- }))+ dispatch(+ errorsActions.createNewProjectFailed({+ message,+ }),+ )},generateAlerts: (message: string) => {- dispatch(alertsActions.generateAlerts({- message,- type: 'success',- }))+ dispatch(+ alertsActions.generateAlerts({+ message,+ type: 'success',+ }),+ )},projectDeleted: (message: string) => {- dispatch(alertsActions.generateAlerts({- message,- type: 'success',- }))+ dispatch(+ alertsActions.generateAlerts({+ message,+ type: 'success',+ }),+ )},deleteProjectFailed: (message: string) => {- dispatch(errorsActions.deleteProjectFailed({- message,- }))+ dispatch(+ errorsActions.deleteProjectFailed({+ message,+ }),+ )},loadProjects: (shared: boolean, skip: number) => {if (shared) {- dispatch(sagaActions.loadSharedProjects(- skip,- ))+ dispatch(sagaActions.loadSharedProjects(skip))} else {- dispatch(sagaActions.loadProjects(- skip,- ))+ dispatch(sagaActions.loadProjects(skip))}},removeProject: (pid: string, shared: boolean) => {- dispatch(UIActions.removeProject({- pid,- shared,- }))+ dispatch(+ UIActions.removeProject({+ pid,+ shared,+ }),+ )},deleteProjectCache: (pid: string) => {- dispatch(UIActions.deleteProjectCache({- pid,- }))+ dispatch(+ UIActions.deleteProjectCache({+ pid,+ }),+ )},showError: (message: string) => {- dispatch(errorsActions.genericError({- message,- }))+ dispatch(+ errorsActions.genericError({+ message,+ }),+ )},setProjectProtectedPassword(id: string, password: string) {- dispatch(UIActions.setProjectProtectedPassword({- id,- password,- }))+ dispatch(+ UIActions.setProjectProtectedPassword({+ id,+ password,+ }),+ )},})diff --git a/app/pages/Project/Settings/ProjectSettings.tsx b/app/pages/Project/Settings/ProjectSettings.tsxindex 44dc8b9ff..d46842552 100644--- a/app/pages/Project/Settings/ProjectSettings.tsx+++ b/app/pages/Project/Settings/ProjectSettings.tsx@@ -1,7 +1,5 @@/* eslint-disable react/forbid-prop-types */-import React, {- useState, useEffect, useMemo, memo,-} from 'react'+import React, { useState, useEffect, useMemo, memo } from 'react'import { useNavigate, useParams } from '@remix-run/react'import { useTranslation } from 'react-i18next'import cx from 'clsx'@@ -21,14 +19,19 @@ import PropTypes from 'prop-types'import { ExclamationTriangleIcon, TrashIcon, RocketLaunchIcon } from '@heroicons/react/24/outline'import { withAuthentication, auth } from 'hoc/protected'-import {- isSelfhosted, TITLE_SUFFIX, ENTRIES_PER_PAGE_DASHBOARD, FILTERS_PANELS_ORDER,-} from 'redux/constants'+import { isSelfhosted, TITLE_SUFFIX, ENTRIES_PER_PAGE_DASHBOARD, FILTERS_PANELS_ORDER } from 'redux/constants'import { IProject } from 'redux/models/IProject'import { IUser } from 'redux/models/IUser'import { IProjectForShared, ISharedProject } from 'redux/models/ISharedProject'import {- createProject, updateProject, deleteProject, resetProject, transferProject, deletePartially, getFilters, resetFilters,+ createProject,+ updateProject,+ deleteProject,+ resetProject,+ transferProject,+ deletePartially,+ getFilters,+ resetFilters,} from 'api'import Input from 'ui/Input'import Button from 'ui/Button'@@ -67,21 +70,34 @@ const tabDeleteDataModal = []const ModalMessage = ({- dateRange, setDateRange, setTab, t, tab, pid, activeFilter, setActiveFilter, filterType, setFilterType, language,+ dateRange,+ setDateRange,+ setTab,+ t,+ tab,+ pid,+ activeFilter,+ setActiveFilter,+ filterType,+ setFilterType,+ language,}: {- dateRange: Date[],- setDateRange: (a: Date[]) => void,- setTab: (i: string) => void,- t: (key: string, options?: {- [key: string]: string | number | null- }) => string,- tab: string,- pid: string,+ dateRange: Date[]+ setDateRange: (a: Date[]) => void+ setTab: (i: string) => void+ t: (+ key: string,+ options?: {+ [key: string]: string | number | null+ },+ ) => string+ tab: string+ pid: stringactiveFilter: string[]- setActiveFilter: any,- filterType: string,- setFilterType: (a: string) => void,- language: string,+ setActiveFilter: any+ filterType: string+ setFilterType: (a: string) => void+ language: string}): JSX.Element => {const [filterList, setFilterList] = useState<string[]>([])const [searchList, setSearchList] = useState<string[]>([])@@ -104,9 +120,7 @@ const ModalMessage = ({return (<>- <p className='text-gray-500 dark:text-gray-300 italic mt-1 mb-4 text-sm'>- {t('project.settings.resetHint')}- </p>+ <p className='text-gray-500 dark:text-gray-300 italic mt-1 mb-4 text-sm'>{t('project.settings.resetHint')}</p><div className='mt-6'><nav className='-mb-px flex space-x-6'>{_map(tabDeleteDataModal, (tabDelete) => (@@ -116,7 +130,8 @@ const ModalMessage = ({onClick={() => setTab(tabDelete.name)}className={cx('whitespace-nowrap pb-2 px-1 border-b-2 font-medium text-md', {'border-indigo-500 text-indigo-600 dark:text-gray-50 dark:border-gray-50': tabDelete.name === tab,- 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300 dark:text-gray-400 dark:hover:text-gray-300 dark:hover:border-gray-300': tab !== tabDelete.name,+ 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300 dark:text-gray-400 dark:hover:text-gray-300 dark:hover:border-gray-300':+ tab !== tabDelete.name,})}>{t(tabDelete.title)}@@ -132,11 +147,15 @@ const ModalMessage = ({<p className='text-gray-500 dark:text-gray-300 italic mt-1 mb-2 text-sm'>{t('project.settings.reseted.partiallyHint')}</p>- <input type='text' className='h-0 w-0 border-0 p-0 m-0 focus:text-transparent focus:border-transparent focus:shadow-none focus:ring-transparent' />+ <input+ type='text'+ className='h-0 w-0 border-0 p-0 m-0 focus:text-transparent focus:border-transparent focus:shadow-none focus:ring-transparent'+ /><FlatPickeronChange={(date) => setDateRange(date)}options={{- altInputClass: 'shadow-sm focus:ring-indigo-500 focus:border-indigo-500 block w-full sm:text-sm border-gray-300 dark:text-gray-50 dark:placeholder-gray-400 dark:border-gray-800 dark:bg-slate-800 rounded-md',+ altInputClass:+ 'shadow-sm focus:ring-indigo-500 focus:border-indigo-500 block w-full sm:text-sm border-gray-300 dark:text-gray-50 dark:placeholder-gray-400 dark:border-gray-800 dark:bg-slate-800 rounded-md',}}value={dateRange}/>@@ -155,14 +174,16 @@ const ModalMessage = ({<div><DropdownclassName='min-w-[160px]'- title={!_isEmpty(filterType) ? t(`project.mapping.${filterType}`) : t('project.settings.reseted.selectFilters')}+ title={+ !_isEmpty(filterType) ? t(`project.mapping.${filterType}`) : t('project.settings.reseted.selectFilters')+ }items={FILTERS_PANELS_ORDER}labelExtractor={(item) => t(`project.mapping.${item}`)}keyExtractor={(item) => item}onSelect={(item) => setFilterType(item)}/><div className='h-2' />- {(filterType && !_isEmpty(filterList)) ? (+ {filterType && !_isEmpty(filterList) ? (<MultiSelectclassName='max-w-max'items={searchList}@@ -188,7 +209,11 @@ const ModalMessage = ({onSearch={(search: string) => {if (search.length > 0) {if (filterType === 'cc') {- setSearchList(_filter(filterList, (item) => _includes(_toUpper(countries.getName(item, language)), _toUpper(search))))+ setSearchList(+ _filter(filterList, (item) =>+ _includes(_toUpper(countries.getName(item, language)), _toUpper(search)),+ ),+ )return}@@ -198,13 +223,17 @@ const ModalMessage = ({}}}placholder={t('project.settings.reseted.filtersPlaceholder')}- onSelect={(item: string) => setActiveFilter((oldItems: string[]) => {- if (_includes(oldItems, item)) {- return _filter(oldItems, (i) => i !== item)- }- return [...oldItems, item]- })}- onRemove={(item: string) => setActiveFilter((oldItems: string[]) => _filter(oldItems, (i) => i !== item))}+ onSelect={(item: string) =>+ setActiveFilter((oldItems: string[]) => {+ if (_includes(oldItems, item)) {+ return _filter(oldItems, (i) => i !== item)+ }+ return [...oldItems, item]+ })+ }+ onRemove={(item: string) =>+ setActiveFilter((oldItems: string[]) => _filter(oldItems, (i) => i !== item))+ }/>) : (<p className='text-gray-500 dark:text-gray-300 italic mt-4 mb-4 text-sm'>@@ -219,53 +248,81 @@ const ModalMessage = ({}interface IForm extends Partial<IProject> {- origins: string | null,- ipBlacklist: string | null,+ origins: string | null+ ipBlacklist: string | null}const DEFAULT_PROJECT_NAME = 'Untitled Project'interface IProjectSettings {- updateProjectFailed: (message: string) => void,- createNewProjectFailed: (message: string) => void,- generateAlerts: (message: string) => void,- projectDeleted: (message: string) => void,- deleteProjectFailed: (message: string) => void,- loadProjects: (shared: boolean, skip: number) => void,- isLoading: boolean,- projects: IProject[],- showError: (message: string) => void,- removeProject: (pid: string, shared: boolean) => void,- user: IUser,- isSharedProject: boolean,- sharedProjects: ISharedProject[],- deleteProjectCache: (pid: string) => void,- setProjectProtectedPassword: (pid: string, password: string) => void,- dashboardPaginationPage: number,- dashboardPaginationPageShared: number,- loading: boolean,- isSettings: boolean,+ updateProjectFailed: (message: string) => void+ createNewProjectFailed: (message: string) => void+ generateAlerts: (message: string) => void+ projectDeleted: (message: string) => void+ deleteProjectFailed: (message: string) => void+ loadProjects: (shared: boolean, skip: number) => void+ isLoading: boolean+ projects: IProject[]+ showError: (message: string) => void+ removeProject: (pid: string, shared: boolean) => void+ user: IUser+ isSharedProject: boolean+ sharedProjects: ISharedProject[]+ deleteProjectCache: (pid: string) => void+ setProjectProtectedPassword: (pid: string, password: string) => void+ dashboardPaginationPage: number+ dashboardPaginationPageShared: number+ loading: boolean+ isSettings: boolean}const ProjectSettings = ({- updateProjectFailed, createNewProjectFailed, generateAlerts, projectDeleted, deleteProjectFailed,- loadProjects, isLoading, projects, showError, removeProject, user, isSharedProject, sharedProjects,- deleteProjectCache, setProjectProtectedPassword, dashboardPaginationPage, dashboardPaginationPageShared,- loading, isSettings,+ updateProjectFailed,+ createNewProjectFailed,+ generateAlerts,+ projectDeleted,+ deleteProjectFailed,+ loadProjects,+ isLoading,+ projects,+ showError,+ removeProject,+ user,+ isSharedProject,+ sharedProjects,+ deleteProjectCache,+ setProjectProtectedPassword,+ dashboardPaginationPage,+ dashboardPaginationPageShared,+ loading,+ isSettings,}: IProjectSettings) => {- const { t, i18n: { language } }: {- t: (key: string, options?: {- [key: string]: string | number | null- }) => string,+ const {+ t,+ i18n: { language },+ }: {+ t: (+ key: string,+ options?: {+ [key: string]: string | number | null+ },+ ) => stringi18n: {- language: string,- },+ language: string+ }} = useTranslation('common')// @ts-ignore- const { id }: {- id: string,+ const {+ id,+ }: {+ id: string} = useParams()- const project: IProjectForShared = useMemo(() => _find([...projects, ..._map(sharedProjects, (item) => item.project)], p => p.id === id) || {} as IProjectForShared, [projects, id, sharedProjects])+ const project: IProjectForShared = useMemo(+ () =>+ _find([...projects, ..._map(sharedProjects, (item) => item.project)], (p) => p.id === id) ||+ ({} as IProjectForShared),+ [projects, id, sharedProjects],+ )const navigate = useNavigate()const [form, setForm] = useState<IForm>({@@ -277,10 +334,10 @@ const ProjectSettings = ({})const [validated, setValidated] = useState<boolean>(false)const [errors, setErrors] = useState<{- name?: string,- origins?: string,- ipBlacklist?: string,- password?: string,+ name?: string+ origins?: string+ ipBlacklist?: string+ password?: string}>({})const [beenSubmitted, setBeenSubmitted] = useState<boolean>(false)const [showDelete, setShowDelete] = useState<boolean>(false)@@ -298,7 +355,9 @@ const ProjectSettings = ({const [activeFilter, setActiveFilter] = useState<string[]>([])const [filterType, setFilterType] = useState<string>('')- const paginationSkip: number = isSharedProject ? dashboardPaginationPageShared * ENTRIES_PER_PAGE_DASHBOARD : dashboardPaginationPage * ENTRIES_PER_PAGE_DASHBOARD+ const paginationSkip: number = isSharedProject+ ? dashboardPaginationPageShared * ENTRIES_PER_PAGE_DASHBOARD+ : dashboardPaginationPage * ENTRIES_PER_PAGE_DASHBOARDuseEffect(() => {if (loading) {@@ -330,16 +389,18 @@ const ProjectSettings = ({try {const formalisedData = {...data,- origins: _isEmpty(data.origins) ? null : _map(_split(data.origins, ','), (origin) => {- try {- if (_includes(origin, 'localhost')) {- return origin- }- return new URL(origin).host- } catch (e) {- return origin- }- }),+ origins: _isEmpty(data.origins)+ ? null+ : _map(_split(data.origins, ','), (origin) => {+ try {+ if (_includes(origin, 'localhost')) {+ return origin+ }+ return new URL(origin).host+ } catch (e) {+ return origin+ }+ }),ipBlacklist: _isEmpty(data.ipBlacklist) ? null : _split(data.ipBlacklist, ','),}if (isSettings) {@@ -423,10 +484,10 @@ const ProjectSettings = ({const validate = () => {const allErrors: {- name?: string,- origins?: string,- ipBlacklist?: string,- password?: string,+ name?: string+ origins?: string+ ipBlacklist?: string+ password?: string} = {}if (_isEmpty(form.name)) {@@ -459,7 +520,7 @@ const ProjectSettings = ({const { target } = eventconst value = target.type === 'checkbox' ? target.checked : target.value- setForm(oldForm => ({+ setForm((oldForm) => ({...oldForm,[target.name]: value,}))@@ -535,12 +596,8 @@ const ProjectSettings = ({})}><form className='max-w-7xl w-full mx-auto' onSubmit={handleSubmit}>- <h2 className='mt-2 text-3xl font-bold text-gray-900 dark:text-gray-50'>- {title}- </h2>- <h3 className='mt-2 text-lg font-bold text-gray-900 dark:text-gray-50'>- {t('profileSettings.general')}- </h3>+ <h2 className='mt-2 text-3xl font-bold text-gray-900 dark:text-gray-50'>{title}</h2>+ <h3 className='mt-2 text-lg font-bold text-gray-900 dark:text-gray-50'>{t('profileSettings.general')}</h3><Inputname='name'id='name'@@ -636,7 +693,12 @@ const ProjectSettings = ({)}<div className='flex flex-wrap justify-center sm:justify-between gap-2 mt-8'><div className='flex flex-wrap items-center gap-2'>- <Button className='border-indigo-100 dark:text-gray-50 dark:border-slate-700/50 dark:bg-slate-800 dark:hover:bg-slate-700' onClick={onCancel} secondary regular>+ <Button+ className='border-indigo-100 dark:text-gray-50 dark:border-slate-700/50 dark:bg-slate-800 dark:hover:bg-slate-700'+ onClick={onCancel}+ secondary+ regular+ >{t('common.cancel')}</Button><Button type='submit' loading={projectSaving} primary regular>@@ -653,13 +715,23 @@ const ProjectSettings = ({</></Button>)}- <Button onClick={() => !projectResetting && setShowReset(true)} loading={projectDeleting} semiDanger semiSmall>+ <Button+ onClick={() => !projectResetting && setShowReset(true)}+ loading={projectDeleting}+ semiDanger+ semiSmall+ ><><TrashIcon className='w-5 h-5 mr-1' />{t('project.settings.reset')}</></Button>- <Button onClick={() => !projectDeleting && setShowDelete(true)} loading={projectDeleting} danger semiSmall>+ <Button+ onClick={() => !projectDeleting && setShowDelete(true)}+ loading={projectDeleting}+ danger+ semiSmall+ ><><ExclamationTriangleIcon className='w-5 h-5 mr-1' />{t('project.settings.delete')}@@ -689,7 +761,12 @@ const ProjectSettings = ({{!isSettings && (<div>- <Button className='mr-2 border-indigo-100 dark:text-gray-50 dark:border-slate-700/50 dark:bg-slate-800 dark:hover:bg-slate-700' onClick={onCancel} secondary regular>+ <Button+ className='mr-2 border-indigo-100 dark:text-gray-50 dark:border-slate-700/50 dark:bg-slate-800 dark:hover:bg-slate-700'+ onClick={onCancel}+ secondary+ regular+ >{t('common.cancel')}</Button><Button type='submit' loading={projectSaving} primary regular>@@ -716,7 +793,21 @@ const ProjectSettings = ({submitText={t('project.settings.reset')}closeText={t('common.close')}title={t('project.settings.qReset')}- message={<ModalMessage setDateRange={setDateRange} dateRange={dateRange} setTab={setTab} tab={tab} t={t} pid={id} activeFilter={activeFilter} setActiveFilter={setActiveFilter} filterType={filterType} setFilterType={setFilterType} language={language} />}+ message={+ <ModalMessage+ setDateRange={setDateRange}+ dateRange={dateRange}+ setTab={setTab}+ tab={tab}+ t={t}+ pid={id}+ activeFilter={activeFilter}+ setActiveFilter={setActiveFilter}+ filterType={filterType}+ setFilterType={setFilterType}+ language={language}+ />+ }submitType='danger'type='error'isOpened={showReset}@@ -727,11 +818,9 @@ const ProjectSettings = ({submitText={t('common.save')}closeText={t('common.cancel')}title={t('project.settings.protected')}- message={(+ message={<div>- <p className='text-gray-500 dark:text-gray-300 mt-1 mb-4 text-sm'>- {t('project.settings.protectedHint')}- </p>+ <p className='text-gray-500 dark:text-gray-300 mt-1 mb-4 text-sm'>{t('project.settings.protectedHint')}</p><Inputname='password'id='password'@@ -743,7 +832,7 @@ const ProjectSettings = ({error={beenSubmitted ? errors.password : null}/></div>- )}+ }isOpened={showProtected}/><Modal@@ -752,11 +841,9 @@ const ProjectSettings = ({}}submitText={t('project.settings.transfer')}closeText={t('common.cancel')}- message={(+ message={<div>- <h2 className='text-xl font-bold text-gray-700 dark:text-gray-200'>- {t('project.settings.transferTo')}- </h2>+ <h2 className='text-xl font-bold text-gray-700 dark:text-gray-200'>{t('project.settings.transferTo')}</h2><p className='mt-2 text-base text-gray-700 dark:text-gray-200'>{t('project.settings.transferHint', {name: form.name || DEFAULT_PROJECT_NAME,@@ -773,7 +860,7 @@ const ProjectSettings = ({onChange={(e) => setTransferEmail(e.target.value)}/></div>- )}+ }isOpened={showTransfer}onSubmit={onTransfer}/>diff --git a/app/pages/Project/Settings/TransferProject/TransferProjectConfirm.tsx b/app/pages/Project/Settings/TransferProject/TransferProjectConfirm.tsxindex 2d51b167d..525b72370 100644--- a/app/pages/Project/Settings/TransferProject/TransferProjectConfirm.tsx+++ b/app/pages/Project/Settings/TransferProject/TransferProjectConfirm.tsx@@ -9,7 +9,9 @@ import { confirmTransferProject } from 'api'import routes from 'routesPath'const TransferProjectConfirm = (): JSX.Element => {- const { t }: {+ const {+ t,+ }: {t: (key: string) => string} = useTranslation('common')const [loading, setLoading] = useState<boolean>(true)diff --git a/app/pages/Project/Settings/TransferProject/TransferProjectReject.tsx b/app/pages/Project/Settings/TransferProject/TransferProjectReject.tsxindex 989fd488d..3256736da 100644--- a/app/pages/Project/Settings/TransferProject/TransferProjectReject.tsx+++ b/app/pages/Project/Settings/TransferProject/TransferProjectReject.tsx@@ -9,7 +9,9 @@ import { rejectTransferProject } from 'api'import routes from 'routesPath'const TransferProjectReject = (): JSX.Element => {- const { t }: {+ const {+ t,+ }: {t: (key: string) => string} = useTranslation('common')const [loading, setLoading] = useState<boolean>(true)diff --git a/app/pages/Project/View/Panels.tsx b/app/pages/Project/View/Panels.tsxindex d9544c3df..fe91b2590 100644--- a/app/pages/Project/View/Panels.tsx+++ b/app/pages/Project/View/Panels.tsx@@ -1,13 +1,15 @@-import React, {- memo, useState, useEffect, useMemo, Fragment,-} from 'react'+import React, { memo, useState, useEffect, useMemo, Fragment } from 'react'import InnerHTML from 'dangerously-set-html-content'-import {- ArrowLongRightIcon, ArrowLongLeftIcon,-} from '@heroicons/react/24/solid'+import { ArrowLongRightIcon, ArrowLongLeftIcon } from '@heroicons/react/24/solid'import { ChevronUpIcon, ChevronDownIcon } from '@heroicons/react/20/solid'import {- FunnelIcon, MapIcon, Bars4Icon, ArrowsPointingOutIcon, ChartPieIcon, PuzzlePieceIcon, RectangleGroupIcon,+ FunnelIcon,+ MapIcon,+ Bars4Icon,+ ArrowsPointingOutIcon,+ ChartPieIcon,+ PuzzlePieceIcon,+ RectangleGroupIcon,} from '@heroicons/react/24/outline'import cx from 'clsx'import PropTypes from 'prop-types'@@ -94,29 +96,41 @@ const removeDuplicates = (arr: any[], keys: string[]) => {}interface IPanelContainer {- name: string | JSX.Element,- children?: React.ReactNode,- noSwitch?: boolean,- icon?: React.ReactNode,- type: string,- onExpandClick?: () => void,- activeFragment: number | string,- setActiveFragment: (arg: number) => void,- customTabs?: any,- activeTab?: string,+ name: string | JSX.Element+ children?: React.ReactNode+ noSwitch?: boolean+ icon?: React.ReactNode+ type: string+ onExpandClick?: () => void+ activeFragment: number | string+ setActiveFragment: (arg: number) => void+ customTabs?: any+ activeTab?: stringisCustomContent?: boolean}// noSwitch - 'previous' and 'next' buttonsconst PanelContainer = ({- name, children, noSwitch, icon, type, activeFragment, setActiveFragment,- customTabs, activeTab, isCustomContent, onExpandClick,+ name,+ children,+ noSwitch,+ icon,+ type,+ activeFragment,+ setActiveFragment,+ customTabs,+ activeTab,+ isCustomContent,+ onExpandClick,}: IPanelContainer): JSX.Element => (<div- className={cx('relative bg-white dark:bg-slate-800/25 dark:border dark:border-slate-800/50 pt-5 px-4 min-h-72 max-h-96 sm:pt-6 sm:px-6 shadow rounded-lg overflow-hidden', {- 'pb-12': !noSwitch,- 'pb-5': noSwitch,- })}+ className={cx(+ 'relative bg-white dark:bg-slate-800/25 dark:border dark:border-slate-800/50 pt-5 px-4 min-h-72 max-h-96 sm:pt-6 sm:px-6 shadow rounded-lg overflow-hidden',+ {+ 'pb-12': !noSwitch,+ 'pb-5': noSwitch,+ },+ )}><div className='flex items-center justify-between mb-2'><h3 className='flex items-center text-lg leading-6 font-semibold text-gray-900 dark:text-gray-50'>@@ -158,7 +172,7 @@ const PanelContainer = ({</>)}- {(type === 'pg' && activeTab !== PROJECT_TABS.performance) && (+ {type === 'pg' && activeTab !== PROJECT_TABS.performance && (<><RectangleGroupIconclassName={cx(iconClassName, 'ml-2 cursor-pointer', {@@ -227,10 +241,11 @@ const PanelContainer = ({</div></div>{/* for other tabs */}- <div className={cx('flex flex-col h-full scroll-auto', {- 'overflow-auto': !(type === 'pg' && activeTab !== PROJECT_TABS.performance && activeFragment === 1),- relative: isCustomContent,- })}+ <div+ className={cx('flex flex-col h-full scroll-auto', {+ 'overflow-auto': !(type === 'pg' && activeTab !== PROJECT_TABS.performance && activeFragment === 1),+ relative: isCustomContent,+ })}>{children}</div>@@ -238,9 +253,7 @@ const PanelContainer = ({)PanelContainer.propTypes = {- name: PropTypes.oneOfType([- PropTypes.string, PropTypes.node,- ]).isRequired,+ name: PropTypes.oneOfType([PropTypes.string, PropTypes.node]).isRequired,children: PropTypes.node.isRequired,noSwitch: PropTypes.bool,activeFragment: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),@@ -253,8 +266,8 @@ PanelContainer.defaultProps = {icon: null,noSwitch: false,activeFragment: 0,- setActiveFragment: () => { },- onExpandClick: () => { },+ setActiveFragment: () => {},+ onExpandClick: () => {},customTabs: [],activeTab: '',isCustomContent: false,@@ -324,23 +337,25 @@ interface IKVTable {loading: boolean}-const KVTable = ({- data, t, uniques, loading,-}: IKVTable) => {+const KVTable = ({ data, t, uniques, loading }: IKVTable) => {// @ts-ignoreconst processed: any[] = useMemo(() => {- return _reduce(data, (acc: any, curr: any) => {- if (!acc[curr.key]) {- acc[curr.key] = []- }+ return _reduce(+ data,+ (acc: any, curr: any) => {+ if (!acc[curr.key]) {+ acc[curr.key] = []+ }- acc[curr.key].push({- value: curr.value,- count: curr.count,- })+ acc[curr.key].push({+ value: curr.value,+ count: curr.count,+ })- return acc- }, {})+ return acc+ },+ {},+ )}, [data])if (loading) {@@ -352,11 +367,7 @@ const KVTable = ({}if (_isEmpty(data)) {- return (- <p className='text-gray-600 dark:text-gray-200 mb-2'>- {t('project.noData')}- </p>- )+ return <p className='text-gray-600 dark:text-gray-200 mb-2'>{t('project.noData')}</p>}return _map(processed, (value, key) => {@@ -364,18 +375,12 @@ const KVTable = ({<table key={key} className='table-fixed w-full mb-2'><thead><tr className='text-gray-600 dark:text-gray-200'>- <th className='w-2/5 sm:w-4/6 text-left flex items-center'>- {key}- </th>+ <th className='w-2/5 sm:w-4/6 text-left flex items-center'>{key}</th><th className='w-[30%] sm:w-1/6'>- <p className='flex justify-end items-center'>- {t('project.quantity')}- </p>+ <p className='flex justify-end items-center'>{t('project.quantity')}</p></th><th className='w-[30%] sm:w-1/6'>- <p className='flex justify-end items-center'>- {t('project.conversion')}- </p>+ <p className='flex justify-end items-center'>{t('project.conversion')}</p></th></tr></thead>@@ -385,17 +390,12 @@ const KVTable = ({key={nestedValue}className='text-gray-900 dark:text-gray-50 group hover:bg-gray-100 hover:dark:bg-slate-700 py-3'>- <td className='text-left flex items-center'>- {nestedValue}- </td>+ <td className='text-left flex items-center'>{nestedValue}</td><td className='text-right'>{count} </td>- <td className='text-right'>- {uniques === 0 ? 100 : _round((count / uniques) * 100, 2)}- %- </td>+ <td className='text-right'>{uniques === 0 ? 100 : _round((count / uniques) * 100, 2)}%</td></tr>))}</tbody>@@ -405,9 +405,7 @@ const KVTable = ({}// Tabs with custom events like submit form, press button, go to the link rate etc.-const CustomEvents = ({- customs, chartData, onFilter, t, customTabs, getCustomEventMetadata,-}: ICustomEvents) => {+const CustomEvents = ({ customs, chartData, onFilter, t, customTabs, getCustomEventMetadata }: ICustomEvents) => {const [page, setPage] = useState(0)const [modal, setModal] = useState(false)const [activeEvents, setActiveEvents] = useState<any>({})@@ -416,7 +414,10 @@ const CustomEvents = ({const [customsEventsData, setCustomsEventsData] = useState<any>(customs)const currentIndex = page * ENTRIES_PER_CUSTOM_EVENTS_PANELconst keys = _keys(customsEventsData)- const keysToDisplay = useMemo(() => _slice(keys, currentIndex, currentIndex + ENTRIES_PER_CUSTOM_EVENTS_PANEL), [keys, currentIndex])+ const keysToDisplay = useMemo(+ () => _slice(keys, currentIndex, currentIndex + ENTRIES_PER_CUSTOM_EVENTS_PANEL),+ [keys, currentIndex],+ )const uniques = _sum(chartData.uniques)const [chartOptions, setChartOptions] = useState<any>({})const [activeFragment, setActiveFragment] = useState<number>(0)@@ -467,9 +468,11 @@ const CustomEvents = ({return _fromPairs(_sortBy(_toPairs(obj), (pair) => pair[0]))}- return _fromPairs(_toPairs(obj).sort((a: any, b: any) => {- return b[1] - a[1]- }))+ return _fromPairs(+ _toPairs(obj).sort((a: any, b: any) => {+ return b[1] - a[1]+ }),+ )}const sortedDesc = (obj: any, sortByKeys?: boolean) => {@@ -477,9 +480,11 @@ const CustomEvents = ({return _fromPairs(_reverse(_sortBy(_toPairs(obj), (pair) => pair[0])))}- return _fromPairs(_toPairs(obj).sort((a: any, b: any) => {- return a[1] - b[1]- }))+ return _fromPairs(+ _toPairs(obj).sort((a: any, b: any) => {+ return a[1] - b[1]+ }),+ )}const toggleEventMetadata = (ev: string) => async (e: any) => {@@ -578,24 +583,22 @@ const CustomEvents = ({onExpandClick={() => setModal(true)}>{_isEmpty(chartData) ? (- <p className='mt-1 text-base text-gray-700 dark:text-gray-300'>- {t('project.noParamData')}- </p>+ <p className='mt-1 text-base text-gray-700 dark:text-gray-300'>{t('project.noParamData')}</p>) : (- <Chart- options={chartOptions}- current='panels-ce'- />+ <Chart options={chartOptions} current='panels-ce' />)}<ModalonClose={onModalClose}isOpened={modal}title={t('project.customEv')}- message={(+ message={<table className='table-fixed w-full'><thead><tr className='text-gray-900 dark:text-gray-50 text-base'>- <th className='w-2/5 sm:w-4/6 text-left flex items-center cursor-pointer hover:opacity-90' onClick={() => onSortBy('event')}>+ <th+ className='w-2/5 sm:w-4/6 text-left flex items-center cursor-pointer hover:opacity-90'+ onClick={() => onSortBy('event')}+ >{t('project.event')}<SortclassName='ml-1'@@ -604,7 +607,10 @@ const CustomEvents = ({/></th><th className='w-[30%] sm:w-1/6'>- <p className='flex justify-end items-center cursor-pointer hover:opacity-90' onClick={() => onSortBy('quantity')}>+ <p+ className='flex justify-end items-center cursor-pointer hover:opacity-90'+ onClick={() => onSortBy('quantity')}+ >{t('project.quantity')}<SortclassName='ml-1'@@ -615,7 +621,10 @@ const CustomEvents = ({</p></th><th className='w-[30%] sm:w-1/6'>- <p className='flex justify-end items-center cursor-pointer hover:opacity-90' onClick={() => onSortBy('conversion')}>+ <p+ className='flex justify-end items-center cursor-pointer hover:opacity-90'+ onClick={() => onSortBy('conversion')}+ >{t('project.conversion')}<SortclassName='ml-1'@@ -653,19 +662,13 @@ const CustomEvents = ({ </td><td className='text-right'>- {uniques === 0 ? 100 : _round((customsEventsData[ev] / uniques) * 100, 2)}- %+ {uniques === 0 ? 100 : _round((customsEventsData[ev] / uniques) * 100, 2)}%</td></tr>{activeEvents[ev] && (<tr><td className='pl-9' colSpan={3}>- <KVTable- data={eventsMetadata[ev]}- t={t}- uniques={uniques}- loading={loadingEvents[ev]}- />+ <KVTable data={eventsMetadata[ev]} t={t} uniques={uniques} loading={loadingEvents[ev]} /></td></tr>)}@@ -673,7 +676,7 @@ const CustomEvents = ({))}</tbody></table>- )}+ }size='large'/></PanelContainer>@@ -683,9 +686,7 @@ const CustomEvents = ({// Showing custom tabs (Extensions Marketplace)// todo: check activeFragment for being equal to customTabs -> extensionID + panelIDif (!_isEmpty(customTabs) && typeof activeFragment === 'string') {- const {- tabContent,- } = _find(customTabs, (tab) => tab.extensionID === activeFragment)+ const { tabContent } = _find(customTabs, (tab) => tab.extensionID === activeFragment)return (<PanelContainer@@ -694,13 +695,11 @@ const CustomEvents = ({activeFragment={activeFragment}setActiveFragment={setActiveFragment}customTabs={customTabs}- onExpandClick={() => { }}+ onExpandClick={() => {}}isCustomContent>{/* Using this instead of dangerouslySetInnerHTML to support script tags */}- {tabContent && (- <InnerHTML className='absolute overflow-auto' html={tabContent} />- )}+ {tabContent && <InnerHTML className='absolute overflow-auto' html={tabContent} />}</PanelContainer>)}@@ -717,7 +716,10 @@ const CustomEvents = ({<table className='table-fixed'><thead><tr className='text-gray-900 dark:text-gray-50'>- <th className='w-4/6 text-left flex items-center cursor-pointer hover:opacity-90' onClick={() => onSortBy('event')}>+ <th+ className='w-4/6 text-left flex items-center cursor-pointer hover:opacity-90'+ onClick={() => onSortBy('event')}+ >{t('project.event')}<SortclassName='ml-1'@@ -768,8 +770,7 @@ const CustomEvents = ({Added a uniques === 0 check because uniques value may be zero and dividing by zero will cause anInfinity% value to be displayed.*/}- {uniques === 0 ? 100 : _round((customsEventsData[ev] / uniques) * 100, 2)}- %+ {uniques === 0 ? 100 : _round((customsEventsData[ev] / uniques) * 100, 2)}%</td></tr>))}@@ -781,28 +782,21 @@ const CustomEvents = ({<div className='flex justify-between select-none mb-2'><div><span className='text-gray-500 dark:text-gray-200 font-light lowercase text-xs'>- {_size(keys)}- {' '}- {t('project.results')}+ {_size(keys)} {t('project.results')}</span><span className='text-gray-500 dark:text-gray-200 font-light text-xs'>- .- {' '}- {t('project.page')}- {' '}- {page + 1}- {' '}- /- {' '}- {totalPages}+ . {t('project.page')} {page + 1} / {totalPages}</span></div><div className='flex justify-between w-[4.5rem]'><Button- className={cx('text-gray-500 dark:text-gray-200 font-light shadow bg-gray-100 dark:bg-slate-800 border-none px-1.5 py-0.5', {- 'opacity-50 cursor-not-allowed': !canGoPrev(),- 'hover:bg-gray-200 hover:dark:bg-slate-700': canGoPrev(),- })}+ className={cx(+ 'text-gray-500 dark:text-gray-200 font-light shadow bg-gray-100 dark:bg-slate-800 border-none px-1.5 py-0.5',+ {+ 'opacity-50 cursor-not-allowed': !canGoPrev(),+ 'hover:bg-gray-200 hover:dark:bg-slate-700': canGoPrev(),+ },+ )}type='button'onClick={onPrevious}disabled={!canGoPrev()}@@ -811,10 +805,13 @@ const CustomEvents = ({<ArrowLongLeftIcon className='w-5 h-5' /></Button><Button- className={cx('text-gray-500 dark:text-gray-200 font-light shadow bg-gray-100 dark:bg-slate-800 border-none px-1.5 py-0.5', {- 'opacity-50 cursor-not-allowed': !canGoNext(),- 'hover:bg-gray-200 hover:dark:bg-slate-700': canGoNext(),- })}+ className={cx(+ 'text-gray-500 dark:text-gray-200 font-light shadow bg-gray-100 dark:bg-slate-800 border-none px-1.5 py-0.5',+ {+ 'opacity-50 cursor-not-allowed': !canGoNext(),+ 'hover:bg-gray-200 hover:dark:bg-slate-700': canGoNext(),+ },+ )}onClick={onNext}disabled={!canGoNext()}type='button'@@ -830,11 +827,14 @@ const CustomEvents = ({onClose={onModalClose}isOpened={modal}title={t('project.customEv')}- message={(+ message={<table className='table-fixed w-full'><thead><tr className='text-gray-900 dark:text-gray-50 text-base'>- <th className='w-2/5 sm:w-4/6 text-left flex items-center cursor-pointer hover:opacity-90' onClick={() => onSortBy('event')}>+ <th+ className='w-2/5 sm:w-4/6 text-left flex items-center cursor-pointer hover:opacity-90'+ onClick={() => onSortBy('event')}+ >{t('project.event')}<SortclassName='ml-1'@@ -843,7 +843,10 @@ const CustomEvents = ({/></th><th className='w-[30%] sm:w-1/6'>- <p className='flex justify-end items-center cursor-pointer hover:opacity-90' onClick={() => onSortBy('quantity')}>+ <p+ className='flex justify-end items-center cursor-pointer hover:opacity-90'+ onClick={() => onSortBy('quantity')}+ >{t('project.quantity')}<SortclassName='ml-1'@@ -854,7 +857,10 @@ const CustomEvents = ({</p></th><th className='w-[30%] sm:w-1/6'>- <p className='flex justify-end items-center cursor-pointer hover:opacity-90' onClick={() => onSortBy('conversion')}>+ <p+ className='flex justify-end items-center cursor-pointer hover:opacity-90'+ onClick={() => onSortBy('conversion')}+ >{t('project.conversion')}<SortclassName='ml-1'@@ -892,19 +898,13 @@ const CustomEvents = ({ </td><td className='text-right'>- {uniques === 0 ? 100 : _round((customsEventsData[ev] / uniques) * 100, 2)}- %+ {uniques === 0 ? 100 : _round((customsEventsData[ev] / uniques) * 100, 2)}%</td></tr>{activeEvents[ev] && (<tr><td className='pl-9' colSpan={3}>- <KVTable- data={eventsMetadata[ev]}- t={t}- uniques={uniques}- loading={loadingEvents[ev]}- />+ <KVTable data={eventsMetadata[ev]} t={t} uniques={uniques} loading={loadingEvents[ev]} /></td></tr>)}@@ -912,7 +912,7 @@ const CustomEvents = ({))}</tbody></table>- )}+ }size='large'/></PanelContainer>@@ -959,8 +959,27 @@ interface IPanel {}const Panel = ({- name, data, rowMapper, valueMapper, capitalize, linkContent, t, icon, id, hideFilters,- onFilter, customTabs, pid, period, timeBucket, from, to, timezone, activeTab, onFragmentChange, filters,+ name,+ data,+ rowMapper,+ valueMapper,+ capitalize,+ linkContent,+ t,+ icon,+ id,+ hideFilters,+ onFilter,+ customTabs,+ pid,+ period,+ timeBucket,+ from,+ to,+ timezone,+ activeTab,+ onFragmentChange,+ filters,projectPassword,}: IPanel): JSX.Element => {const [page, setPage] = useState(0)@@ -975,7 +994,7 @@ const Panel = ({const canGoPrev = () => page > 0const canGoNext = () => page < _floor((_size(entries) - 1) / ENTRIES_PER_PANEL)- const _onFilter = hideFilters ? () => { } : onFilter+ const _onFilter = hideFilters ? () => {} : onFilteruseEffect(() => {const sizeKeys = _size(entries)@@ -1021,22 +1040,12 @@ const Panel = ({onExpandClick={() => setModal(true)}customTabs={customTabs}>- <InteractiveMap- data={data}- total={total}- onClickCountry={(key) => _onFilter(id, key)}- />+ <InteractiveMap data={data} total={total} onClickCountry={(key) => _onFilter(id, key)} /><ModalonClose={() => setModal(false)}closeText={t('common.close')}isOpened={modal}- message={(- <InteractiveMap- data={data}- total={total}- onClickCountry={(key) => _onFilter(id, key)}- />- )}+ message={<InteractiveMap data={data} total={total} onClickCountry={(key) => _onFilter(id, key)} />}size='large'/></PanelContainer>@@ -1074,7 +1083,7 @@ const Panel = ({onClose={() => setModal(false)}closeText={t('common.close')}isOpened={modal}- customButtons={(+ customButtons={<buttontype='button'onClick={() => setIsReversedUserFlow(!isReversedUserFlow)}@@ -1082,8 +1091,8 @@ const Panel = ({>{t('project.reverse')}</button>- )}- message={(+ }+ message={<div className='h-[500px] dark:text-gray-800'>{/* @ts-ignore */}<UserFlow@@ -1099,7 +1108,7 @@ const Panel = ({t={t}/></div>- )}+ }size='large'/></PanelContainer>@@ -1156,14 +1165,9 @@ const Panel = ({activeTab={activeTab}>{_isEmpty(data) ? (- <p className='mt-1 text-base text-gray-700 dark:text-gray-300'>- {t('project.noParamData')}- </p>+ <p className='mt-1 text-base text-gray-700 dark:text-gray-300'>{t('project.noParamData')}</p>) : (- <Chart- options={options}- current={`Panels-${id}`}- />+ <Chart options={options} current={`Panels-${id}`} />)}</PanelContainer>)@@ -1172,9 +1176,7 @@ const Panel = ({// Showing custom tabs (Extensions Marketplace)// todo: check activeFragment for being equal to customTabs -> extensionID + panelIDif (!_isEmpty(customTabs) && typeof activeFragment === 'string' && !_isEmpty(data)) {- const {- tabContent,- } = _find(customTabs, (tab) => tab.extensionID === activeFragment)+ const { tabContent } = _find(customTabs, (tab) => tab.extensionID === activeFragment)return (<PanelContainer@@ -1195,90 +1197,90 @@ const Panel = ({}return (- <PanelContainer name={name} icon={icon} type={id} activeFragment={activeFragment} setActiveFragment={_setActiveFragment} customTabs={customTabs} activeTab={activeTab}>+ <PanelContainer+ name={name}+ icon={icon}+ type={id}+ activeFragment={activeFragment}+ setActiveFragment={_setActiveFragment}+ customTabs={customTabs}+ activeTab={activeTab}+ >{_isEmpty(data) ? (- <p className='mt-1 text-base text-gray-700 dark:text-gray-300'>- {t('project.noParamData')}- </p>- ) : _map(entriesToDisplay, entry => {- const {- count, name: entryName, cc,- } = entry- const perc = _round((count / total) * 100, 2)- const rowData = rowMapper(entry)- const valueData = valueMapper(count)-- return (- <Fragment key={`${id}-${entryName}-${cc}`}>- <div- className={cx('flex justify-between mt-[0.32rem] first:mt-0 dark:text-gray-50 rounded', {- 'group hover:bg-gray-100 hover:dark:bg-slate-700 cursor-pointer': !hideFilters,- })}- onClick={() => _onFilter(id, entryName)}- >- {linkContent ? (- <a- className={cx('flex items-center label hover:underline text-blue-600 dark:text-blue-500', { capitalize })}- href={rowData}- target='_blank'- rel='noopener noreferrer nofollow'- aria-label={`${rowData} (opens in a new tab)`}- >- {rowData}- {!hideFilters && (- <FunnelIcon className='ml-2 w-4 h-4 text-gray-500 hidden group-hover:block dark:text-gray-300' />- )}- </a>- ) : (- <span className={cx('flex items-center label', { capitalize })}>- {rowData}- {!hideFilters && (- <FunnelIcon className='ml-2 w-4 h-4 text-gray-500 hidden group-hover:block dark:text-gray-300' />- )}- </span>- )}- <span className='ml-3 dark:text-gray-50'>- {activeTab === PROJECT_TABS.traffic ? nFormatter(valueData, 1) : valueData}- - <span className='text-gray-500 dark:text-gray-200 font-light'>- (- {perc}- %)+ <p className='mt-1 text-base text-gray-700 dark:text-gray-300'>{t('project.noParamData')}</p>+ ) : (+ _map(entriesToDisplay, (entry) => {+ const { count, name: entryName, cc } = entry+ const perc = _round((count / total) * 100, 2)+ const rowData = rowMapper(entry)+ const valueData = valueMapper(count)++ return (+ <Fragment key={`${id}-${entryName}-${cc}`}>+ <div+ className={cx('flex justify-between mt-[0.32rem] first:mt-0 dark:text-gray-50 rounded', {+ 'group hover:bg-gray-100 hover:dark:bg-slate-700 cursor-pointer': !hideFilters,+ })}+ onClick={() => _onFilter(id, entryName)}+ >+ {linkContent ? (+ <a+ className={cx('flex items-center label hover:underline text-blue-600 dark:text-blue-500', {+ capitalize,+ })}+ href={rowData}+ target='_blank'+ rel='noopener noreferrer nofollow'+ aria-label={`${rowData} (opens in a new tab)`}+ >+ {rowData}+ {!hideFilters && (+ <FunnelIcon className='ml-2 w-4 h-4 text-gray-500 hidden group-hover:block dark:text-gray-300' />+ )}+ </a>+ ) : (+ <span className={cx('flex items-center label', { capitalize })}>+ {rowData}+ {!hideFilters && (+ <FunnelIcon className='ml-2 w-4 h-4 text-gray-500 hidden group-hover:block dark:text-gray-300' />+ )}+ </span>+ )}+ <span className='ml-3 dark:text-gray-50'>+ {activeTab === PROJECT_TABS.traffic ? nFormatter(valueData, 1) : valueData}+ + <span className='text-gray-500 dark:text-gray-200 font-light'>+ ({perc}+ %)+ </span></span>- </span>- </div>- <Progress now={perc} />- </Fragment>- )- })}+ </div>+ <Progress now={perc} />+ </Fragment>+ )+ })+ )}{/* for pagination in tabs */}{_size(entries) > ENTRIES_PER_PANEL && (<div className='absolute bottom-0 w-card-toggle-sm sm:!w-card-toggle'><div className='flex justify-between select-none mb-2'><div><span className='text-gray-500 dark:text-gray-200 font-light lowercase text-xs'>- {_size(entries)}- {' '}- {t('project.results')}+ {_size(entries)} {t('project.results')}</span><span className='text-gray-500 dark:text-gray-200 font-light text-xs'>- .- {' '}- {t('project.page')}- {' '}- {page + 1}- {' '}- /- {' '}- {totalPages}+ . {t('project.page')} {page + 1} / {totalPages}</span></div><div className='flex justify-between w-[4.5rem]'><Button- className={cx('text-gray-500 dark:text-gray-200 font-light shadow bg-gray-100 dark:bg-slate-800 border-none px-1.5 py-0.5', {- 'opacity-50 cursor-not-allowed': !canGoPrev(),- 'hover:bg-gray-200 hover:dark:bg-slate-700': canGoPrev(),- })}+ className={cx(+ 'text-gray-500 dark:text-gray-200 font-light shadow bg-gray-100 dark:bg-slate-800 border-none px-1.5 py-0.5',+ {+ 'opacity-50 cursor-not-allowed': !canGoPrev(),+ 'hover:bg-gray-200 hover:dark:bg-slate-700': canGoPrev(),+ },+ )}type='button'onClick={onPrevious}disabled={!canGoPrev()}@@ -1287,10 +1289,13 @@ const Panel = ({<ArrowLongLeftIcon className='w-5 h-5' /></Button><Button- className={cx('text-gray-500 dark:text-gray-200 font-light shadow bg-gray-100 dark:bg-slate-800 border-none px-1.5 py-0.5', {- 'opacity-50 cursor-not-allowed': !canGoNext(),- 'hover:bg-gray-200 hover:dark:bg-slate-700': canGoNext(),- })}+ className={cx(+ 'text-gray-500 dark:text-gray-200 font-light shadow bg-gray-100 dark:bg-slate-800 border-none px-1.5 py-0.5',+ {+ 'opacity-50 cursor-not-allowed': !canGoNext(),+ 'hover:bg-gray-200 hover:dark:bg-slate-700': canGoNext(),+ },+ )}onClick={onNext}disabled={!canGoNext()}type='button'@@ -1307,13 +1312,13 @@ const Panel = ({}Panel.propTypes = {- name: PropTypes.oneOfType([- PropTypes.string.isRequired, PropTypes.node,- ]).isRequired,- data: PropTypes.arrayOf(PropTypes.shape({- name: PropTypes.string,- count: PropTypes.number,- })).isRequired,+ name: PropTypes.oneOfType([PropTypes.string.isRequired, PropTypes.node]).isRequired,+ data: PropTypes.arrayOf(+ PropTypes.shape({+ name: PropTypes.string,+ count: PropTypes.number,+ }),+ ).isRequired,id: PropTypes.string,rowMapper: PropTypes.func,valueMapper: PropTypes.func,@@ -1331,7 +1336,7 @@ Panel.defaultProps = {valueMapper: (value: number): number => value,capitalize: false,linkContent: false,- onFilter: () => { },+ onFilter: () => {},hideFilters: false,icon: null,customTabs: [],@@ -1342,14 +1347,11 @@ Panel.defaultProps = {period: null,pid: null,activeTab: null,- onFragmentChange: () => { },+ onFragmentChange: () => {},filters: [],}const PanelMemo = memo(Panel)const CustomEventsMemo = memo(CustomEvents)-export {- PanelMemo as Panel,- CustomEventsMemo as CustomEvents,-}+export { PanelMemo as Panel, CustomEventsMemo as CustomEvents }diff --git a/app/pages/Project/View/ViewProject.container.tsx b/app/pages/Project/View/ViewProject.container.tsxindex 5842a8463..7d4b2fb96 100644--- a/app/pages/Project/View/ViewProject.container.tsx+++ b/app/pages/Project/View/ViewProject.container.tsx@@ -55,83 +55,107 @@ const mapStateToProps = (state: StateType) => {const mapDispatchToProps = (dispatch: AppDispatch) => ({showError: (message: string) => {- dispatch(errorsActions.genericError({- message,- }))+ dispatch(+ errorsActions.genericError({+ message,+ }),+ )},setProjectCache: (pid: string, data: any, key: string) => {- dispatch(UIActions.setProjectCache({- pid,- key,- data,- }))+ dispatch(+ UIActions.setProjectCache({+ pid,+ key,+ data,+ }),+ )},setProjectViewPrefs: (pid: string, period: string, timeBucket: string, rangeDate?: Date[]) => {- dispatch(UIActions.setProjectViewPrefs({- pid,- period,- timeBucket,- rangeDate,- }))+ dispatch(+ UIActions.setProjectViewPrefs({+ pid,+ period,+ timeBucket,+ rangeDate,+ }),+ )},setProjectCachePerf: (pid: string, data: any, key: string) => {- dispatch(UIActions.setProjectCachePerf({- pid,- data,- key,- }))+ dispatch(+ UIActions.setProjectCachePerf({+ pid,+ data,+ key,+ }),+ )},setFunnelsCache: (pid: string, data: any, key: string) => {- dispatch(UIActions.setFunnelsCache({- pid,- data,- key,- }))+ dispatch(+ UIActions.setFunnelsCache({+ pid,+ data,+ key,+ }),+ )},setPublicProject: (project: Partial<IProject | ISharedProject>) => {- dispatch(UIActions.setPublicProject({- project,- }))+ dispatch(+ UIActions.setPublicProject({+ project,+ }),+ )},setProjects: (project: Partial<IProject | ISharedProject>[], shared?: boolean) => {- dispatch(UIActions.setProjects({- projects: project,- shared,- }))+ dispatch(+ UIActions.setProjects({+ projects: project,+ shared,+ }),+ )},updateProject: (pid: string, project: Partial<IProject | ISharedProject>) => {- dispatch(UIActions.updateProject({- pid,- project,- }))+ dispatch(+ UIActions.updateProject({+ pid,+ project,+ }),+ )},setLiveStatsForProject: (id: string, count: number) => {- dispatch(UIActions.setLiveStatsProject({- id,- count,- }))+ dispatch(+ UIActions.setLiveStatsProject({+ id,+ count,+ }),+ )},generateAlert: (message: string, type: string) => {- dispatch(alertsActions.generateAlerts({- message,- type,- }))+ dispatch(+ alertsActions.generateAlerts({+ message,+ type,+ }),+ )},setProjectTab: (tabs: string) => {dispatch(UIActions.setProjectTab(tabs))},setProjectForcastCache: (pid: string, data: any, key: string) => {- dispatch(UIActions.setProjectForecastCache({- pid,- data,- key,- }))+ dispatch(+ UIActions.setProjectForecastCache({+ pid,+ data,+ key,+ }),+ )},setCustomEventsPrefs: (pid: string, data: any) => {- dispatch(UIActions.setCustomEventsPrefs({- pid,- data,- }))+ dispatch(+ UIActions.setCustomEventsPrefs({+ pid,+ data,+ }),+ )},})diff --git a/app/pages/Project/View/ViewProject.helpers.tsx b/app/pages/Project/View/ViewProject.helpers.tsxindex c1cc653ca..94c53228d 100644--- a/app/pages/Project/View/ViewProject.helpers.tsx+++ b/app/pages/Project/View/ViewProject.helpers.tsx@@ -2,14 +2,17 @@ import React from 'react'// @ts-ignoreimport { saveAs } from 'file-saver'import {- GlobeEuropeAfricaIcon, LanguageIcon, DocumentTextIcon, DeviceTabletIcon,- ArrowRightCircleIcon, MagnifyingGlassIcon, ServerIcon,+ GlobeEuropeAfricaIcon,+ LanguageIcon,+ DocumentTextIcon,+ DeviceTabletIcon,+ ArrowRightCircleIcon,+ MagnifyingGlassIcon,+ ServerIcon,} from '@heroicons/react/24/outline'// @ts-ignoreimport dayjs from 'dayjs'-import {- area, areaSpline, spline, bar, line,-} from 'billboard.js'+import { area, areaSpline, spline, bar, line } from 'billboard.js'import _forEach from 'lodash/forEach'import _map from 'lodash/map'import _split from 'lodash/split'@@ -30,11 +33,14 @@ import JSZip from 'jszip'import * as d3 from 'd3'import {- TimeFormat, chartTypes, tbsFormatMapper, tbsFormatMapper24h, tbsFormatMapperTooltip, tbsFormatMapperTooltip24h,+ TimeFormat,+ chartTypes,+ tbsFormatMapper,+ tbsFormatMapper24h,+ tbsFormatMapperTooltip,+ tbsFormatMapperTooltip24h,} from 'redux/constants'-import {- getTimeFromSeconds, getStringFromTime, sumArrays, nFormatter,-} from 'utils/generic'+import { getTimeFromSeconds, getStringFromTime, sumArrays, nFormatter } from 'utils/generic'import countries from 'utils/isoCountries'import { IAnalyticsFunnel } from 'redux/models/IProject'@@ -47,9 +53,7 @@ const getSum = (arr: any) => {return _reduce(arr, (acc, c) => acc + c, 0)}-const transformAIChartData = (data: {- [key: string]: any,-}) => {+const transformAIChartData = (data: { [key: string]: any }) => {const transformedData = {x: [],sdur: [],@@ -134,12 +138,17 @@ const convertToCSV = (array: any[]) => {return str}-const onCSVExportClick = (data: {- data: any,- types: any,-}, pid: string, tnMapping: {- [key: string]: string,-}, language: string) => {+const onCSVExportClick = (+ data: {+ data: any+ types: any+ },+ pid: string,+ tnMapping: {+ [key: string]: string+ },+ language: string,+) => {const { data: rowData, types } = dataconst zip = new JSZip()@@ -156,7 +165,7 @@ const onCSVExportClick = (data: {})const csvData = _map(rowKeys, (e) => {- const perc = _round(((rowData[item][e] / total) * 100) || 0, 2)+ const perc = _round((rowData[item][e] / total) * 100 || 0, 2)if (item === 'cc') {const name = countries.getName(e, language)@@ -196,20 +205,20 @@ const CHART_METRICS_MAPPING_PERF = {}// function to filter the data for the chart-const getColumns = (chart: {- [key: string]: string[],-}, activeChartMetrics: {- [key: string]: boolean,-}, compareChart?: {- [key: string]: string[],-}) => {- const {- views, bounce, viewsPerUnique, unique, trendlines, sessionDuration,- } = activeChartMetrics-- const columns: any[] = [- ['x', ..._map(chart.x, el => dayjs(el).toDate())],- ]+const getColumns = (+ chart: {+ [key: string]: string[]+ },+ activeChartMetrics: {+ [key: string]: boolean+ },+ compareChart?: {+ [key: string]: string[]+ },+) => {+ const { views, bounce, viewsPerUnique, unique, trendlines, sessionDuration } = activeChartMetrics++ const columns: any[] = [['x', ..._map(chart.x, (el) => dayjs(el).toDate())]]if (unique) {columns.push(['unique', ...chart.uniques])@@ -237,9 +246,7 @@ const getColumns = (chart: {const bounceArray = _map(chart.uniques, (el, i) => {return _round((_toNumber(el) * 100) / _toNumber(chart.visits[i]), 1) || 0})- columns.push(- ['bounce', ...bounceArray],- )+ columns.push(['bounce', ...bounceArray])}if (viewsPerUnique) {@@ -263,14 +270,16 @@ const getColumns = (chart: {return columns}-const getColumnsPerf = (chart: {- [key: string]: string[],-}, activeChartMetrics: string, compareChart?: {- [key: string]: string[],-}) => {- const columns: any[] = [- ['x', ..._map(chart.x, el => dayjs(el).toDate())],- ]+const getColumnsPerf = (+ chart: {+ [key: string]: string[]+ },+ activeChartMetrics: string,+ compareChart?: {+ [key: string]: string[]+ },+) => {+ const columns: any[] = [['x', ..._map(chart.x, (el) => dayjs(el).toDate())]]if (activeChartMetrics === CHART_METRICS_MAPPING_PERF.full) {columns.push(['dns', ...chart.dns])@@ -281,7 +290,15 @@ const getColumnsPerf = (chart: {columns.push(['dom_load', ...chart.domLoad])columns.push(['ttfb', ...chart.ttfb])- if (compareChart?.dns && compareChart?.tls && compareChart?.conn && compareChart?.response && compareChart?.render && compareChart?.domLoad && compareChart?.ttfb) {+ if (+ compareChart?.dns &&+ compareChart?.tls &&+ compareChart?.conn &&+ compareChart?.response &&+ compareChart?.render &&+ compareChart?.domLoad &&+ compareChart?.ttfb+ ) {columns.push(['dnsCompare', ...compareChart.dns])columns.push(['tlsCompare', ...compareChart.tls])columns.push(['connCompare', ...compareChart.conn])@@ -297,9 +314,20 @@ const getColumnsPerf = (chart: {columns.push(['network', ...sumArrays(chart.dns, chart.tls, chart.conn, chart.response)])columns.push(['backend', ...chart.ttfb])- if (compareChart?.dns && compareChart?.tls && compareChart?.conn && compareChart?.response && compareChart?.render && compareChart?.domLoad && compareChart?.ttfb) {+ if (+ compareChart?.dns &&+ compareChart?.tls &&+ compareChart?.conn &&+ compareChart?.response &&+ compareChart?.render &&+ compareChart?.domLoad &&+ compareChart?.ttfb+ ) {columns.push(['frontendCompare', ...sumArrays(compareChart.render, compareChart.domLoad)])- columns.push(['networkCompare', ...sumArrays(compareChart.dns, compareChart.tls, compareChart.conn, compareChart.response)])+ columns.push([+ 'networkCompare',+ ...sumArrays(compareChart.dns, compareChart.tls, compareChart.conn, compareChart.response),+ ])columns.push(['backendCompare', ...compareChart.ttfb])}}@@ -339,9 +367,13 @@ const getColumnsPerf = (chart: {return columns}-const getValueForTooltipPerfomance = (chart: {- [key: string]: string[],-}, id: string, index: number) => {+const getValueForTooltipPerfomance = (+ chart: {+ [key: string]: string[]+ },+ id: string,+ index: number,+) => {if (id === 'dns' || id === 'tls' || id === 'conn' || id === 'response' || id === 'render' || id === 'ttfb') {return chart[id] ? chart[id][index] : 0}@@ -384,9 +416,9 @@ const stringToColour = (str: string) => {// Generate 3-byte color code (RRGGBB)for (let i = 0; i < 3; i++) {// Get the next 8 bits of the hash value- const value = (hash >> (i * 8)) & 0xFF+ const value = (hash >> (i * 8)) & 0xff// Convert the value to a 2-digit hex string- const hexString = (`00${value.toString(16)}`).substr(-2)+ const hexString = `00${value.toString(16)}`.substr(-2)// Append the hex string to the color valuecolour += hexString}@@ -403,32 +435,34 @@ const getSettings = (chart: any,timeBucket: string,activeChartMetrics: {- [key: string]: boolean,+ [key: string]: boolean},applyRegions: boolean,timeFormat: string,forecasedChartData: {- [key: string]: string[],+ [key: string]: string[]},rotateXAxis: boolean,chartType: string,customEvents?: {- [key: string]: string[],+ [key: string]: string[]},compareChart?: {- [key: string]: string[],+ [key: string]: string[]},) => {const xAxisSize = _size(chart.x)const lines = []const modifiedChart = { ...chart }let regions- const customEventsToArray = customEvents ? _map(_keys(customEvents), (el) => {- return [el, ...customEvents[el]]- }) : []+ const customEventsToArray = customEvents+ ? _map(_keys(customEvents), (el) => {+ return [el, ...customEvents[el]]+ })+ : []let customEventsColors: {- [key: string]: string,+ [key: string]: string} = {}if (_isEmpty(compareChart)) {@@ -553,7 +587,10 @@ const getSettings = (tick: {fit: true,rotate: rotateXAxis ? 45 : 0,- format: timeFormat === TimeFormat['24-hour'] ? (x: string) => d3.timeFormat(tbsFormatMapper24h[timeBucket])(x) : (x: string) => d3.timeFormat(tbsFormatMapper[timeBucket])(x),+ format:+ timeFormat === TimeFormat['24-hour']+ ? (x: string) => d3.timeFormat(tbsFormatMapper24h[timeBucket])(x)+ : (x: string) => d3.timeFormat(tbsFormatMapper[timeBucket])(x),},localtime: timeFormat === TimeFormat['24-hour'],type: 'timeseries',@@ -568,7 +605,9 @@ const getSettings = (y2: {show: activeChartMetrics.bounce || activeChartMetrics.sessionDuration,tick: {- format: activeChartMetrics.bounce ? (d: string) => `${d}%` : (d: string) => getStringFromTime(getTimeFromSeconds(d)),+ format: activeChartMetrics.bounce+ ? (d: string) => `${d}%`+ : (d: string) => getStringFromTime(getTimeFromSeconds(d)),},min: activeChartMetrics.bounce ? 10 : null,max: activeChartMetrics.bounce ? 100 : null,@@ -578,7 +617,7 @@ const getSettings = (tooltip: {contents: (item: any, _: any, __: any, color: any) => {const typesOptionsToTypesCompare: {- [key: string]: string,+ [key: string]: string} = {unique: 'uniques',total: 'visits',@@ -587,15 +626,13 @@ const getSettings = (if (_isEmpty(compareChart)) {return `<ul class='bg-gray-100 dark:text-gray-50 dark:bg-slate-800 rounded-md shadow-md px-3 py-1'>- <li class='font-semibold'>${timeFormat === TimeFormat['24-hour'] ? d3.timeFormat(tbsFormatMapperTooltip24h[timeBucket])(item[0].x) : d3.timeFormat(tbsFormatMapperTooltip[timeBucket])(item[0].x)}</li>+ <li class='font-semibold'>${+ timeFormat === TimeFormat['24-hour']+ ? d3.timeFormat(tbsFormatMapperTooltip24h[timeBucket])(item[0].x)+ : d3.timeFormat(tbsFormatMapperTooltip[timeBucket])(item[0].x)+ }</li><hr class='border-gray-200 dark:border-gray-600' />- ${_map(item, (el: {- id: string,- index: number,- name: string,- value: string,- x: Date,- }) => {+ ${_map(item, (el: { id: string; index: number; name: string; value: string; x: Date }) => {if (el.id === 'sessionDuration') {return `<li class='flex justify-between'>@@ -626,27 +663,33 @@ const getSettings = (return `<ul class='bg-gray-100 dark:text-gray-50 dark:bg-slate-800 rounded-md shadow-md px-3 py-1'>- ${_map(item, (el: {- id: string,- index: number,- name: string,- value: string,- x: Date,- }) => {- const {- id, index, name, value, x,- } = el-- const xDataValueCompare = timeFormat === TimeFormat['24-hour'] ? d3.timeFormat(tbsFormatMapperTooltip24h[timeBucket])(dayjs(compareChart?.x[index]).toDate()) : d3.timeFormat(tbsFormatMapperTooltip[timeBucket])(dayjs(compareChart?.x[index]).toDate())- const xDataValue = timeFormat === TimeFormat['24-hour'] ? d3.timeFormat(tbsFormatMapperTooltip24h[timeBucket])(x) : d3.timeFormat(tbsFormatMapperTooltip[timeBucket])(x)- const valueCompare = id === 'sessionDuration' ? getStringFromTime(getTimeFromSeconds(compareChart?.[typesOptionsToTypesCompare?.[id]]?.[index])) : compareChart?.[typesOptionsToTypesCompare[id]]?.[index]-- if (id === 'uniqueCompare' || id === 'totalCompare' || id === 'bounceCompare' || id === 'sessionDurationCompare') {- return ''- }+ ${_map(item, (el: { id: string; index: number; name: string; value: string; x: Date }) => {+ const { id, index, name, value, x } = el++ const xDataValueCompare =+ timeFormat === TimeFormat['24-hour']+ ? d3.timeFormat(tbsFormatMapperTooltip24h[timeBucket])(dayjs(compareChart?.x[index]).toDate())+ : d3.timeFormat(tbsFormatMapperTooltip[timeBucket])(dayjs(compareChart?.x[index]).toDate())+ const xDataValue =+ timeFormat === TimeFormat['24-hour']+ ? d3.timeFormat(tbsFormatMapperTooltip24h[timeBucket])(x)+ : d3.timeFormat(tbsFormatMapperTooltip[timeBucket])(x)+ const valueCompare =+ id === 'sessionDuration'+ ? getStringFromTime(getTimeFromSeconds(compareChart?.[typesOptionsToTypesCompare?.[id]]?.[index]))+ : compareChart?.[typesOptionsToTypesCompare[id]]?.[index]++ if (+ id === 'uniqueCompare' ||+ id === 'totalCompare' ||+ id === 'bounceCompare' ||+ id === 'sessionDurationCompare'+ ) {+ return ''+ }- if (id === 'sessionDuration') {- return `+ if (id === 'sessionDuration') {+ return `<div class='flex justify-between'><div class='flex justify-items-start'><div class='w-3 h-3 rounded-sm mt-1.5 mr-2' style=background-color:${color(id)}></div>@@ -659,15 +702,19 @@ const getSettings = (<span>${xDataValue}</span> -<span>${getStringFromTime(getTimeFromSeconds(value))}</span></p>- ${(valueCompare && Number(compareChart?.[typesOptionsToTypesCompare?.[id]]?.[index]) > 0) ? `<p>+ ${+ valueCompare && Number(compareChart?.[typesOptionsToTypesCompare?.[id]]?.[index]) > 0+ ? `<p><span>${xDataValueCompare}</span> -<span>${valueCompare}</span>- </p>` : ''}+ </p>`+ : ''+ }</li>`- }+ }- return `+ return `<div class='flex justify-between'><div class='flex justify-items-start'><div class='w-3 h-3 rounded-sm mt-1.5 mr-2' style=background-color:${color(id)}></div>@@ -679,13 +726,17 @@ const getSettings = (<p><span>${xDataValue}</span> - <span>${value}</span></p>- ${valueCompare ? `<p>+ ${+ valueCompare+ ? `<p><span>${xDataValueCompare}</span> -<span>${valueCompare}</span>- </p>` : ''}+ </p>`+ : ''+ }</li>`- }).join('')}+ }).join('')}</ul>`},},@@ -693,9 +744,7 @@ const getSettings = (focus: {only: xAxisSize > 1,},- pattern: [- 'circle',- ],+ pattern: ['circle'],r: 3,},legend: {@@ -717,7 +766,6 @@ const getSettings = (}}-// function to get the settings and data for the session inspector chartconst getSettingsSession = (chart: any,@@ -764,7 +812,10 @@ const getSettingsSession = (tick: {fit: true,rotate: rotateXAxis ? 45 : 0,- format: timeFormat === TimeFormat['24-hour'] ? (x: string) => d3.timeFormat(tbsFormatMapper24h[timeBucket])(x) : (x: string) => d3.timeFormat(tbsFormatMapper[timeBucket])(x),+ format:+ timeFormat === TimeFormat['24-hour']+ ? (x: string) => d3.timeFormat(tbsFormatMapper24h[timeBucket])(x)+ : (x: string) => d3.timeFormat(tbsFormatMapper[timeBucket])(x),},localtime: timeFormat === TimeFormat['24-hour'],type: 'timeseries',@@ -780,17 +831,15 @@ const getSettingsSession = (tooltip: {contents: (item: any, _: any, __: any, color: any) => {return `<ul class='bg-gray-100 dark:text-gray-50 dark:bg-slate-800 rounded-md shadow-md px-3 py-1'>- <li class='font-semibold'>${timeFormat === TimeFormat['24-hour'] ? d3.timeFormat(tbsFormatMapperTooltip24h[timeBucket])(item[0].x) : d3.timeFormat(tbsFormatMapperTooltip[timeBucket])(item[0].x)}</li>+ <li class='font-semibold'>${+ timeFormat === TimeFormat['24-hour']+ ? d3.timeFormat(tbsFormatMapperTooltip24h[timeBucket])(item[0].x)+ : d3.timeFormat(tbsFormatMapperTooltip[timeBucket])(item[0].x)+ }</li><hr class='border-gray-200 dark:border-gray-600' />- ${_map(item, (el: {- id: string,- index: number,- name: string,- value: string,- x: Date,- }) => {- if (el.id === 'sessionDuration') {- return `+ ${_map(item, (el: { id: string; index: number; name: string; value: string; x: Date }) => {+ if (el.id === 'sessionDuration') {+ return `<li class='flex justify-between'><div class='flex justify-items-start'><div class='w-3 h-3 rounded-sm mt-1.5 mr-2' style=background-color:${color(el.id)}></div>@@ -799,13 +848,13 @@ const getSettingsSession = (<span class='pl-4'>${getStringFromTime(getTimeFromSeconds(el.value))}</span></li>`- }+ }- if (el.id === 'trendlineUnique' || el.id === 'trendlineTotal') {- return ''- }+ if (el.id === 'trendlineUnique' || el.id === 'trendlineTotal') {+ return ''+ }- return `+ return `<li class='flex justify-between'><div class='flex justify-items-start'><div class='w-3 h-3 rounded-sm mt-1.5 mr-2' style=background-color:${color(el.id)}></div>@@ -814,16 +863,14 @@ const getSettingsSession = (<span class='pl-4'>${el.value}</span></li>`- }).join('')}`+ }).join('')}`},},point: {focus: {only: xAxisSize > 1,},- pattern: [- 'circle',- ],+ pattern: ['circle'],r: 3,},legend: {@@ -877,9 +924,7 @@ const getSettingsFunnels = (events: '#2563eb', // blue-600dropoff: 'rgba(37, 99, 235, 0.2)', // blue-600 + opacity},- groups: [- ['events', 'dropoff'],- ],+ groups: [['events', 'dropoff']],order: (a: any, b: any) => {return a.id < b.id},@@ -908,9 +953,11 @@ const getSettingsFunnels = (const stepTitle = values[index]const prevStepTitle = values[index - 1]- const prevStepHtml = prevStepTitle ? `+ const prevStepHtml = prevStepTitle+ ? `<span>${prevStepTitle}</span>- ` : ''+ `+ : ''const title = `<p class='font-semibold flex space-x-2 items-center tracking-tight'>@@ -942,7 +989,9 @@ const getSettingsFunnels = (const dropoff = `<tr class='tracking-tight'><td class='pr-7'>- <div class='w-3 h-3 rounded-sm mr-1 float-left mt-1.5' style="background-color:${color('dropoff')}"}></div>+ <div class='w-3 h-3 rounded-sm mr-1 float-left mt-1.5' style="background-color:${color(+ 'dropoff',+ )}"}></div><span class='font-semibold'>${index === 0 ? t('project.neverEnteredTheFunnel') : t('project.dropoff')}</span>@@ -951,7 +1000,9 @@ const getSettingsFunnels = (${index === 0 ? totalPageviews - step.events : step.dropoff}</td><td class='text-right'>- ${index === 0 ? _round(((totalPageviews - step.events) / totalPageviews) * 100, 2) : step.dropoffPercStep}%+ ${+ index === 0 ? _round(((totalPageviews - step.events) / totalPageviews) * 100, 2) : step.dropoffPercStep+ }%</td></tr>`@@ -987,7 +1038,18 @@ const getSettingsFunnels = (}}-const perfomanceChartCompare = ['dnsCompare', 'tlsCompare', 'connCompare', 'responseCompare', 'renderCompare', 'dom_loadCompare', 'ttfbCompare', 'frontendCompare', 'networkCompare', 'backendCompare']+const perfomanceChartCompare = [+ 'dnsCompare',+ 'tlsCompare',+ 'connCompare',+ 'responseCompare',+ 'renderCompare',+ 'dom_loadCompare',+ 'ttfbCompare',+ 'frontendCompare',+ 'networkCompare',+ 'backendCompare',+]const getSettingsPerf = (chart: {@@ -999,7 +1061,7 @@ const getSettingsPerf = (chartType: string,timeFormat: string,compareChart?: {- [key: string]: string[],+ [key: string]: string[]},) => {const xAxisSize = _size(chart.x)@@ -1055,7 +1117,18 @@ const getSettingsPerf = (},groups: [['dns', 'tls', 'conn', 'response', 'render', 'dom_load', 'ttfb', 'frontend', 'network', 'backend'],- ['dnsCompare', 'tlsCompare', 'connCompare', 'responseCompare', 'renderCompare', 'dom_loadCompare', 'ttfbCompare', 'frontendCompare', 'networkCompare', 'backendCompare'],+ [+ 'dnsCompare',+ 'tlsCompare',+ 'connCompare',+ 'responseCompare',+ 'renderCompare',+ 'dom_loadCompare',+ 'ttfbCompare',+ 'frontendCompare',+ 'networkCompare',+ 'backendCompare',+ ],],},axis: {@@ -1064,7 +1137,10 @@ const getSettingsPerf = (tick: {fit: true,rotate: rotateXAxis ? 45 : 0,- format: timeFormat === TimeFormat['24-hour'] ? (x: string) => d3.timeFormat(tbsFormatMapper24h[timeBucket])(x) : (x: string) => d3.timeFormat(tbsFormatMapper[timeBucket])(x),+ format:+ timeFormat === TimeFormat['24-hour']+ ? (x: string) => d3.timeFormat(tbsFormatMapper24h[timeBucket])(x)+ : (x: string) => d3.timeFormat(tbsFormatMapper[timeBucket])(x),},localtime: timeFormat === TimeFormat['24-hour'],type: 'timeseries',@@ -1086,17 +1162,14 @@ const getSettingsPerf = (contents: (item: any, _: any, __: any, color: any) => {if (_isEmpty(compareChart)) {return `<ul class='bg-gray-100 dark:text-gray-50 dark:bg-slate-800 rounded-md shadow-md px-3 py-1'>- <li class='font-semibold'>${timeFormat === TimeFormat['24-hour'] ? d3.timeFormat(tbsFormatMapperTooltip24h[timeBucket])(item[0].x) : d3.timeFormat(tbsFormatMapperTooltip[timeBucket])(item[0].x)- }</li>+ <li class='font-semibold'>${+ timeFormat === TimeFormat['24-hour']+ ? d3.timeFormat(tbsFormatMapperTooltip24h[timeBucket])(item[0].x)+ : d3.timeFormat(tbsFormatMapperTooltip[timeBucket])(item[0].x)+ }</li><hr class='border-gray-200 dark:border-gray-600' />- ${_map(item, (el: {- id: string,- index: number,- name: string,- value: string,- x: Date,- }) => {- return `+ ${_map(item, (el: { id: string; index: number; name: string; value: string; x: Date }) => {+ return `<li class='flex justify-between'><div class='flex justify-items-start'><div class='w-3 h-3 rounded-sm mt-1.5 mr-2' style=background-color:${color(el.id)}></div>@@ -1105,24 +1178,22 @@ const getSettingsPerf = (<span class='pl-4'>${getStringFromTime(getTimeFromSeconds(el.value), true)}</span></li>`- }).join('')}`+ }).join('')}`}return `<ul class='bg-gray-100 dark:text-gray-50 dark:bg-slate-800 rounded-md shadow-md px-3 py-1'>- ${_map(item, (el: {- id: string,- index: number,- name: string,- value: string,- x: Date,- }) => {- const {- id, index, name, value, x,- } = el-- const xDataValueCompare = timeFormat === TimeFormat['24-hour'] ? d3.timeFormat(tbsFormatMapperTooltip24h[timeBucket])(dayjs(compareChart?.x[index]).toDate()) : d3.timeFormat(tbsFormatMapperTooltip[timeBucket])(dayjs(compareChart?.x[index]).toDate())- const xDataValue = timeFormat === TimeFormat['24-hour'] ? d3.timeFormat(tbsFormatMapperTooltip24h[timeBucket])(x) : d3.timeFormat(tbsFormatMapperTooltip[timeBucket])(x)+ ${_map(item, (el: { id: string; index: number; name: string; value: string; x: Date }) => {+ const { id, index, name, value, x } = el++ const xDataValueCompare =+ timeFormat === TimeFormat['24-hour']+ ? d3.timeFormat(tbsFormatMapperTooltip24h[timeBucket])(dayjs(compareChart?.x[index]).toDate())+ : d3.timeFormat(tbsFormatMapperTooltip[timeBucket])(dayjs(compareChart?.x[index]).toDate())+ const xDataValue =+ timeFormat === TimeFormat['24-hour']+ ? d3.timeFormat(tbsFormatMapperTooltip24h[timeBucket])(x)+ : d3.timeFormat(tbsFormatMapperTooltip[timeBucket])(x)const valueCompare = getValueForTooltipPerfomance(compareChart, id, index)if (_includes(perfomanceChartCompare, id)) {@@ -1141,10 +1212,14 @@ const getSettingsPerf = (<p><span>${xDataValue}</span> - <span>${getStringFromTime(getTimeFromSeconds(value), true)}</span></p>- ${valueCompare ? `<p>+ ${+ valueCompare+ ? `<p><span>${xDataValueCompare}</span> -<span>${getStringFromTime(getTimeFromSeconds(valueCompare), true)}</span>- </p>` : ''}+ </p>`+ : ''+ }</li>`}).join('')}@@ -1155,9 +1230,7 @@ const getSettingsPerf = (focus: {only: xAxisSize > 1,},- pattern: [- 'circle',- ],+ pattern: ['circle'],r: 3,},legend: {@@ -1185,22 +1258,30 @@ const validFilters = ['cc', 'rg', 'ct', 'pg', 'lc', 'ref', 'dv', 'br', 'os', 'soexport const filterInvalidViewPrefs = (prefs: any): any => {const pids = _keys(prefs)- const filtered = _reduce(pids, (prev: string[], curr: string) => {- const { period, timeBucket } = prefs[curr]-- if (!_includes(validPeriods, period) || !_includes(validTimeBacket, timeBucket)) {- return prev- }+ const filtered = _reduce(+ pids,+ (prev: string[], curr: string) => {+ const { period, timeBucket } = prefs[curr]- return [...prev, curr]- }, [])+ if (!_includes(validPeriods, period) || !_includes(validTimeBacket, timeBucket)) {+ return prev+ }- return _reduce(filtered, (prev: any, curr: string) => {- return {- ...prev,- [curr]: prefs[curr],- }- }, {})+ return [...prev, curr]+ },+ [],+ )++ return _reduce(+ filtered,+ (prev: any, curr: string) => {+ return {+ ...prev,+ [curr]: prefs[curr],+ }+ },+ {},+ )}const typeNameMapping = (t: (str: string) => string) => ({@@ -1264,21 +1345,41 @@ const getFormatDate = (date: Date) => {]*/const convertFilters = (filters: any) => {- return _reduce(filters, (prev: any, curr: any) => {- const { column, filter } = curr- const converted = _map(filter, (el: any) => ({- column,- filter: el,- }))-- return [...prev, ...converted]- }, [])+ return _reduce(+ filters,+ (prev: any, curr: any) => {+ const { column, filter } = curr+ const converted = _map(filter, (el: any) => ({+ column,+ filter: el,+ }))++ return [...prev, ...converted]+ },+ [],+ )}export {- iconClassName, getFormatDate, panelIconMapping, typeNameMapping, validFilters,- validPeriods, validTimeBacket, noRegionPeriods, getSettings,- getExportFilename, getColumns, onCSVExportClick, CHART_METRICS_MAPPING,- CHART_METRICS_MAPPING_PERF, getColumnsPerf, getSettingsPerf, transformAIChartData, FILTER_CHART_METRICS_MAPPING_FOR_COMPARE,- getSettingsFunnels, getSettingsSession, convertFilters,+ iconClassName,+ getFormatDate,+ panelIconMapping,+ typeNameMapping,+ validFilters,+ validPeriods,+ validTimeBacket,+ noRegionPeriods,+ getSettings,+ getExportFilename,+ getColumns,+ onCSVExportClick,+ CHART_METRICS_MAPPING,+ CHART_METRICS_MAPPING_PERF,+ getColumnsPerf,+ getSettingsPerf,+ transformAIChartData,+ FILTER_CHART_METRICS_MAPPING_FOR_COMPARE,+ getSettingsFunnels,+ getSettingsSession,+ convertFilters,}diff --git a/app/pages/Project/View/ViewProject.tsx b/app/pages/Project/View/ViewProject.tsxindex 09d34f72a..20af74a62 100644--- a/app/pages/Project/View/ViewProject.tsx+++ b/app/pages/Project/View/ViewProject.tsx@@ -1,7 +1,5 @@/* eslint-disable react/forbid-prop-types, react/no-unstable-nested-components, react/display-name */-import React, {- useState, useEffect, useMemo, memo, useRef, useCallback,-} from 'react'+import React, { useState, useEffect, useMemo, memo, useRef, useCallback } from 'react'import { ClientOnly } from 'remix-utils'import useSize from 'hooks/useSize'import { useNavigate, useParams, Link } from '@remix-run/react'@@ -11,8 +9,18 @@ import domToImage from 'dom-to-image'import { saveAs } from 'file-saver'import bb from 'billboard.js'import {- ArrowDownTrayIcon, Cog8ToothIcon, ArrowPathIcon, ChartBarIcon, BoltIcon, BellIcon,- NoSymbolIcon, MagnifyingGlassIcon, FunnelIcon, ChevronLeftIcon, GlobeAltIcon, UsersIcon,+ ArrowDownTrayIcon,+ Cog8ToothIcon,+ ArrowPathIcon,+ ChartBarIcon,+ BoltIcon,+ BellIcon,+ NoSymbolIcon,+ MagnifyingGlassIcon,+ FunnelIcon,+ ChevronLeftIcon,+ GlobeAltIcon,+ UsersIcon,} from '@heroicons/react/24/outline'import cx from 'clsx'import dayjs from 'dayjs'@@ -47,14 +55,50 @@ import { getTimeFromSeconds, getStringFromTime } from 'utils/generic'import { getItem, setItem, removeItem } from 'utils/localstorage'import EventsRunningOutBanner from 'components/EventsRunningOutBanner'import {- tbPeriodPairs, getProjectCacheKey, LIVE_VISITORS_UPDATE_INTERVAL, DEFAULT_TIMEZONE, CDN_URL, isDevelopment,- timeBucketToDays, getProjectCacheCustomKey, MAX_MONTHS_IN_PAST, PROJECT_TABS, TimeFormat, getProjectForcastCacheKey, chartTypes, roleAdmin,- TRAFFIC_PANELS_ORDER, PERFORMANCE_PANELS_ORDER, isSelfhosted, tbPeriodPairsCompare, PERIOD_PAIRS_COMPARE, filtersPeriodPairs, IS_ACTIVE_COMPARE,- PROJECTS_PROTECTED, getProjectCacheCustomKeyPerf, isBrowser, TITLE_SUFFIX, FILTERS_PANELS_ORDER, KEY_FOR_ALL_TIME, MARKETPLACE_URL,- getFunnelsCacheKey, getFunnelsCacheCustomKey, BROWSER_LOGO_MAP, OS_LOGO_MAP, OS_LOGO_MAP_DARK, ITBPeriodPairs,+ tbPeriodPairs,+ getProjectCacheKey,+ LIVE_VISITORS_UPDATE_INTERVAL,+ DEFAULT_TIMEZONE,+ CDN_URL,+ isDevelopment,+ timeBucketToDays,+ getProjectCacheCustomKey,+ MAX_MONTHS_IN_PAST,+ PROJECT_TABS,+ TimeFormat,+ getProjectForcastCacheKey,+ chartTypes,+ roleAdmin,+ TRAFFIC_PANELS_ORDER,+ PERFORMANCE_PANELS_ORDER,+ isSelfhosted,+ tbPeriodPairsCompare,+ PERIOD_PAIRS_COMPARE,+ filtersPeriodPairs,+ IS_ACTIVE_COMPARE,+ PROJECTS_PROTECTED,+ getProjectCacheCustomKeyPerf,+ isBrowser,+ TITLE_SUFFIX,+ FILTERS_PANELS_ORDER,+ KEY_FOR_ALL_TIME,+ MARKETPLACE_URL,+ getFunnelsCacheKey,+ getFunnelsCacheCustomKey,+ BROWSER_LOGO_MAP,+ OS_LOGO_MAP,+ OS_LOGO_MAP_DARK,+ ITBPeriodPairs,} from 'redux/constants'import { IUser } from 'redux/models/IUser'-import { IProject, ILiveStats, IFunnel, IAnalyticsFunnel, IOverallObject, IOverallPerformanceObject } from 'redux/models/IProject'+import {+ IProject,+ ILiveStats,+ IFunnel,+ IAnalyticsFunnel,+ IOverallObject,+ IOverallPerformanceObject,+} from 'redux/models/IProject'import { IProjectForShared, ISharedProject } from 'redux/models/ISharedProject'import { ICountryEntry } from 'redux/models/IEntry'import Loader from 'ui/Loader'@@ -71,16 +115,42 @@ import routes from 'routesPath'import Header from 'components/Header'import Footer from 'components/Footer'import {- getProjectData, getProject, getOverallStats, getLiveVisitors, getPerfData, getProjectDataCustomEvents,- getProjectCompareData, checkPassword, getCustomEventsMetadata, addFunnel, updateFunnel, deleteFunnel,- getFunnelData, getFunnels, getPerformanceOverallStats, getSessions, getSession,+ getProjectData,+ getProject,+ getOverallStats,+ getLiveVisitors,+ getPerfData,+ getProjectDataCustomEvents,+ getProjectCompareData,+ checkPassword,+ getCustomEventsMetadata,+ addFunnel,+ updateFunnel,+ deleteFunnel,+ getFunnelData,+ getFunnels,+ getPerformanceOverallStats,+ getSessions,+ getSession,} from 'api'import { getChartPrediction } from 'api/ai'import { Panel, CustomEvents } from './Panels'import {- onCSVExportClick, getFormatDate, panelIconMapping, typeNameMapping, validFilters, validPeriods,- validTimeBacket, noRegionPeriods, getSettings, getColumns, CHART_METRICS_MAPPING,- CHART_METRICS_MAPPING_PERF, getSettingsPerf, transformAIChartData, FILTER_CHART_METRICS_MAPPING_FOR_COMPARE,+ onCSVExportClick,+ getFormatDate,+ panelIconMapping,+ typeNameMapping,+ validFilters,+ validPeriods,+ validTimeBacket,+ noRegionPeriods,+ getSettings,+ getColumns,+ CHART_METRICS_MAPPING,+ CHART_METRICS_MAPPING_PERF,+ getSettingsPerf,+ transformAIChartData,+ FILTER_CHART_METRICS_MAPPING_FOR_COMPARE,getSettingsFunnels,convertFilters,} from './ViewProject.helpers'@@ -108,72 +178,105 @@ const CUSTOM_EV_DROPDOWN_MAX_VISIBLE_LENGTH = 32const SESSIONS_TAKE = 30interface IViewProject {- projects: IProject[],- extensions: any,- isLoading: boolean,- showError: (message: string) => void,- cache: any,- cachePerf: any,- setProjectCache: (pid: string, data: any, key: string) => void,+ projects: IProject[]+ extensions: any+ isLoading: boolean+ showError: (message: string) => void+ cache: any+ cachePerf: any+ setProjectCache: (pid: string, data: any, key: string) => voidprojectViewPrefs: {[key: string]: {- period: string,- timeBucket: string,- rangeDate?: Date[],- },- } | null,- setProjectViewPrefs: (pid: string, period: string, timeBucket: string, rangeDate?: Date[]) => void,- setPublicProject: (project: Partial<IProject | ISharedProject>) => void,- setLiveStatsForProject: (id: string, count: number) => void,- generateAlert: (message: string, type: string) => void,- setProjectCachePerf: (pid: string, data: any, key: string) => void,- setProjectForcastCache: (pid: string, data: any, key: string) => void,- authenticated: boolean,- user: IUser,- timezone: string,- sharedProjects: ISharedProject[],- projectTab: string,- setProjectTab: (tab: string) => void,+ period: string+ timeBucket: string+ rangeDate?: Date[]+ }+ } | null+ setProjectViewPrefs: (pid: string, period: string, timeBucket: string, rangeDate?: Date[]) => void+ setPublicProject: (project: Partial<IProject | ISharedProject>) => void+ setLiveStatsForProject: (id: string, count: number) => void+ generateAlert: (message: string, type: string) => void+ setProjectCachePerf: (pid: string, data: any, key: string) => void+ setProjectForcastCache: (pid: string, data: any, key: string) => void+ authenticated: boolean+ user: IUser+ timezone: string+ sharedProjects: ISharedProject[]+ projectTab: string+ setProjectTab: (tab: string) => void// eslint-disable-next-line no-unused-vars, no-shadow- setProjects: (projects: Partial<IProject | ISharedProject>[]) => void,- customEventsPrefs: any,- setCustomEventsPrefs: (pid: string, data: any) => void,- liveStats: ILiveStats,+ setProjects: (projects: Partial<IProject | ISharedProject>[]) => void+ customEventsPrefs: any+ setCustomEventsPrefs: (pid: string, data: any) => void+ liveStats: ILiveStatspassword: {- [key: string]: string,- },- theme: 'dark' | 'light',- ssrTheme: 'dark' | 'light',- embedded: boolean,- ssrAuthenticated: boolean,- queryPassword: string | null,- authLoading: boolean,- cacheFunnels: any,- setFunnelsCache: (pid: string, data: any, key: string) => void,- updateProject: (pid: string, project: Partial<IProject | ISharedProject>) => void,- projectQueryTabs: string[],+ [key: string]: string+ }+ theme: 'dark' | 'light'+ ssrTheme: 'dark' | 'light'+ embedded: boolean+ ssrAuthenticated: boolean+ queryPassword: string | null+ authLoading: boolean+ cacheFunnels: any+ setFunnelsCache: (pid: string, data: any, key: string) => void+ updateProject: (pid: string, project: Partial<IProject | ISharedProject>) => void+ projectQueryTabs: string[]}const ViewProject = ({- projects, isLoading: _isLoading, showError, cache, cachePerf, setProjectCache, projectViewPrefs, setProjectViewPrefs, setPublicProject,- setLiveStatsForProject, authenticated: csrAuthenticated, timezone, user, sharedProjects, extensions, generateAlert, setProjectCachePerf,- projectTab, setProjectTab, setProjects, setProjectForcastCache, customEventsPrefs, setCustomEventsPrefs, liveStats, password, theme,- ssrTheme, embedded, ssrAuthenticated, queryPassword, authLoading, cacheFunnels, setFunnelsCache, updateProject, projectQueryTabs,+ projects,+ isLoading: _isLoading,+ showError,+ cache,+ cachePerf,+ setProjectCache,+ projectViewPrefs,+ setProjectViewPrefs,+ setPublicProject,+ setLiveStatsForProject,+ authenticated: csrAuthenticated,+ timezone,+ user,+ sharedProjects,+ extensions,+ generateAlert,+ setProjectCachePerf,+ projectTab,+ setProjectTab,+ setProjects,+ setProjectForcastCache,+ customEventsPrefs,+ setCustomEventsPrefs,+ liveStats,+ password,+ theme,+ ssrTheme,+ embedded,+ ssrAuthenticated,+ queryPassword,+ authLoading,+ cacheFunnels,+ setFunnelsCache,+ updateProject,+ projectQueryTabs,}: IViewProject) => {- const authenticated = isBrowser- ? authLoading- ? ssrAuthenticated- : csrAuthenticated- : ssrAuthenticated+ const authenticated = isBrowser ? (authLoading ? ssrAuthenticated : csrAuthenticated) : ssrAuthenticated// t is used for translation- const { t, i18n: { language } }: {- t: (key: string, options?: {- [key: string]: string | number | null,- }) => string,+ const {+ t,+ i18n: { language },+ }: {+ t: (+ key: string,+ options?: {+ [key: string]: string | number | null+ },+ ) => stringi18n: {- language: string,- },+ language: string+ }} = useTranslation('common')const _theme = isBrowser ? theme : ssrTheme@@ -196,22 +299,34 @@ const ViewProject = ({// { id } is a project id from url// @ts-ignore- const { id }: {+ const {+ id,+ }: {id: string} = useParams()// history is a history from react-router-domconst navigate = useNavigate()// find project by id from url from state in redux projects and sharedProjects. projects and sharedProjects loading from api in Saga on page load- const project: IProjectForShared = useMemo(() => _find([...projects, ..._map(sharedProjects, (item) => ({ ...item.project, role: item.role }))], p => p.id === id) || {} as IProjectForShared, [projects, id, sharedProjects])+ const project: IProjectForShared = useMemo(+ () =>+ _find(+ [...projects, ..._map(sharedProjects, (item) => ({ ...item.project, role: item.role }))],+ (p) => p.id === id,+ ) || ({} as IProjectForShared),+ [projects, id, sharedProjects],+ )- const projectPassword: string = useMemo(() => password[id] || (getItem(PROJECTS_PROTECTED)?.[id] as string) || queryPassword || '', [id, password, queryPassword])+ const projectPassword: string = useMemo(+ () => password[id] || (getItem(PROJECTS_PROTECTED)?.[id] as string) || queryPassword || '',+ [id, password, queryPassword],+ )/* isSharedProject is a boolean check if project is shared. If isSharedProject is true,we used role and other colummn from sharedProjects.And it is used for remove settings button when user have role viewer or logic with Alert tabs */const isSharedProject = useMemo(() => {- const foundProject = _find([..._map(sharedProjects, (item) => item.project)], p => p.id === id)+ const foundProject = _find([..._map(sharedProjects, (item) => item.project)], (p) => p.id === id)return !_isEmpty(foundProject)}, [id, sharedProjects])@@ -238,11 +353,15 @@ const ViewProject = ({// analyticsLoading is a boolean for show loader on chartconst [analyticsLoading, setAnalyticsLoading] = useState<boolean>(true)// period using for logic with update data on chart. Set when user change period in dropdown and when we parse query params from url- const [period, setPeriod] = useState<string>(projectViewPrefs ? projectViewPrefs[id]?.period || periodPairs[4].period : periodPairs[4].period)+ const [period, setPeriod] = useState<string>(+ projectViewPrefs ? projectViewPrefs[id]?.period || periodPairs[4].period : periodPairs[4].period,+ )// timeBucket using for logic with update data on chart. Set when user change timeBucket in dropdown and when we parse query params from url- const [timeBucket, setTimebucket] = useState<string>(projectViewPrefs ? projectViewPrefs[id]?.timeBucket || periodPairs[4].tbs[1] : periodPairs[4].tbs[1])+ const [timeBucket, setTimebucket] = useState<string>(+ projectViewPrefs ? projectViewPrefs[id]?.timeBucket || periodPairs[4].tbs[1] : periodPairs[4].tbs[1],+ )// activeTab using for change tabs and display other data on chart. Like performance, traffic, custom events- const activePeriod = useMemo(() => _find(periodPairs, p => p.period === period), [period, periodPairs])+ const activePeriod = useMemo(() => _find(periodPairs, (p) => p.period === period), [period, periodPairs])// chartData is a data for chart. It is a main data for chartconst [chartData, setChartData] = useState<any>({})// mainChart is a ref for chart@@ -265,7 +384,10 @@ const ViewProject = ({// similar activeChartMetrics but using for performance tabconst [activeChartMetricsPerf, setActiveChartMetricsPerf] = useState<string>(CHART_METRICS_MAPPING_PERF.timing)// checkIfAllMetricsAreDisabled when all metrics are disabled, we are hidden chart- const checkIfAllMetricsAreDisabled = useMemo(() => !_some({ ...activeChartMetrics, ...activeChartMetricsCustomEvents }, (value) => value), [activeChartMetrics, activeChartMetricsCustomEvents])+ const checkIfAllMetricsAreDisabled = useMemo(+ () => !_some({ ...activeChartMetrics, ...activeChartMetricsCustomEvents }, (value) => value),+ [activeChartMetrics, activeChartMetricsCustomEvents],+ )// filters - when we change filters we loading new data from api, update query url and update chartconst [filters, setFilters] = useState<any[]>([])// similar filters but using for performance tab@@ -288,7 +410,9 @@ const ViewProject = ({// localStorageDateRange is a date range from local storageconst localStorageDateRange = projectViewPrefs ? projectViewPrefs[id]?.rangeDate : null// dateRange is a date range for calendar- const [dateRange, setDateRange] = useState<null | Date[]>(localStorageDateRange ? [new Date(localStorageDateRange[0]), new Date(localStorageDateRange[1])] : null)+ const [dateRange, setDateRange] = useState<null | Date[]>(+ localStorageDateRange ? [new Date(localStorageDateRange[0]), new Date(localStorageDateRange[1])] : null,+ )// activeTab traffic, performance, alertsconst [activeTab, setActiveTab] = useState<string>(() => {// first we check if we have activeTab in url@@ -419,17 +543,25 @@ const ViewProject = ({// ref, size using for logic with responsive chartconst [ref, size] = useSize() as any// rotateXAxias using for logic with responsive chart- const rotateXAxis = useMemo(() => (size.width > 0 && size.width < 500), [size])+ const rotateXAxis = useMemo(() => size.width > 0 && size.width < 500, [size])// customEventsChartData is a data for custom events on a chart- const customEventsChartData = useMemo(() => _pickBy(customEventsPrefs[id], (value, keyCustomEvents) => _includes(activeChartMetricsCustomEvents, keyCustomEvents)), [customEventsPrefs, id, activeChartMetricsCustomEvents])+ const customEventsChartData = useMemo(+ () =>+ _pickBy(customEventsPrefs[id], (value, keyCustomEvents) =>+ _includes(activeChartMetricsCustomEvents, keyCustomEvents),+ ),+ [customEventsPrefs, id, activeChartMetricsCustomEvents],+ )// chartType is a type of chart, bar or line- const [chartType, setChartType] = useState<string>(getItem('chartType') as string || chartTypes.line)+ const [chartType, setChartType] = useState<string>((getItem('chartType') as string) || chartTypes.line)// similar to periodPairs but using for compare- const [periodPairsCompare, setPeriodPairsCompare] = useState<{- label: string- period: string- }[]>(tbPeriodPairsCompare(t, undefined, language))+ const [periodPairsCompare, setPeriodPairsCompare] = useState<+ {+ label: string+ period: string+ }[]+ >(tbPeriodPairsCompare(t, undefined, language))// similar to isActive but using for compareconst [isActiveCompare, setIsActiveCompare] = useState<boolean>(() => {const activeCompare = getItem(IS_ACTIVE_COMPARE)@@ -447,7 +579,10 @@ const ViewProject = ({// similar to activePeriod but using for compareconst [activePeriodCompare, setActivePeriodCompare] = useState<string>(periodPairsCompare[0].period)// activeDropdownLabelCompare is a label using for overview panels and dropdown- const activeDropdownLabelCompare = useMemo(() => _find(periodPairsCompare, p => p.period === activePeriodCompare)?.label, [periodPairsCompare, activePeriodCompare])+ const activeDropdownLabelCompare = useMemo(+ () => _find(periodPairsCompare, (p) => p.period === activePeriodCompare)?.label,+ [periodPairsCompare, activePeriodCompare],+ )// dateRangeCompare is a date range for calendar when compare is enabledconst [dateRangeCompare, setDateRangeCompare] = useState<null | Date[]>(null)// dataChartCompare is a data for chart when compare is enabled@@ -462,7 +597,7 @@ const ViewProject = ({return 0}- const findActivePeriod = _find(periodPairs, p => p.period === period)+ const findActivePeriod = _find(periodPairs, (p) => p.period === period)if (findActivePeriod?.period === 'custom' && dateRange) {return dayjs.utc(dateRange[1]).diff(dayjs.utc(dateRange[0]), 'day')@@ -494,7 +629,7 @@ const ViewProject = ({}, [name, user, liveStats, id, t])// sharedRoles is a role for shared project- const sharedRoles = useMemo(() => _find(user.sharedProjects, p => p.project.id === id)?.role || {}, [user, id])+ const sharedRoles = useMemo(() => _find(user.sharedProjects, (p) => p.project.id === id)?.role || {}, [user, id])// for search filtersconst [showFiltersSearch, setShowFiltersSearch] = useState(false)@@ -581,7 +716,7 @@ const ViewProject = ({// chartMetricsCustomEvents is a list of custom events for dropdownconst chartMetricsCustomEvents = useMemo(() => {if (!_isEmpty(panelsData.customs)) {- return _map(_keys(panelsData.customs), key => ({+ return _map(_keys(panelsData.customs), (key) => ({id: key,label: key,active: _includes(activeChartMetricsCustomEvents, key),@@ -599,36 +734,45 @@ const ViewProject = ({}, [panelsData])// dataNames is a list of metrics for chart- const dataNames = useMemo(() => ({- unique: t('project.unique'),- total: t('project.total'),- bounce: `${t('dashboard.bounceRate')} (%)`,- viewsPerUnique: t('dashboard.viewsPerUnique'),- trendlineTotal: t('project.trendlineTotal'),- trendlineUnique: t('project.trendlineUnique'),- sessionDuration: t('dashboard.sessionDuration'),- ...dataNamesCustomEvents,- }), [t, dataNamesCustomEvents])+ const dataNames = useMemo(+ () => ({+ unique: t('project.unique'),+ total: t('project.total'),+ bounce: `${t('dashboard.bounceRate')} (%)`,+ viewsPerUnique: t('dashboard.viewsPerUnique'),+ trendlineTotal: t('project.trendlineTotal'),+ trendlineUnique: t('project.trendlineUnique'),+ sessionDuration: t('dashboard.sessionDuration'),+ ...dataNamesCustomEvents,+ }),+ [t, dataNamesCustomEvents],+ )// dataNamesPerf is a list of metrics for chart in performance tab- const dataNamesPerf = useMemo(() => ({- full: t('dashboard.timing'),- network: t('dashboard.network'),- frontend: t('dashboard.frontend'),- backend: t('dashboard.backend'),- dns: t('dashboard.dns'),- tls: t('dashboard.tls'),- conn: t('dashboard.conn'),- response: t('dashboard.response'),- render: t('dashboard.render'),- dom_load: t('dashboard.domLoad'),- ttfb: t('dashboard.ttfb'),- }), [t])-- const dataNamesFunnel = useMemo(() => ({- dropoff: t('project.dropoff'),- events: t('project.visitors'),- }), [t])+ const dataNamesPerf = useMemo(+ () => ({+ full: t('dashboard.timing'),+ network: t('dashboard.network'),+ frontend: t('dashboard.frontend'),+ backend: t('dashboard.backend'),+ dns: t('dashboard.dns'),+ tls: t('dashboard.tls'),+ conn: t('dashboard.conn'),+ response: t('dashboard.response'),+ render: t('dashboard.render'),+ dom_load: t('dashboard.domLoad'),+ ttfb: t('dashboard.ttfb'),+ }),+ [t],+ )++ const dataNamesFunnel = useMemo(+ () => ({+ dropoff: t('project.dropoff'),+ events: t('project.visitors'),+ }),+ [t],+ )// tabs is a tabs for projectconst tabs: {@@ -649,19 +793,19 @@ const ViewProject = ({},]- const adminTabs = (project?.isOwner || sharedRoles === roleAdmin.role) ? [- {- id: 'settings',- label: t('common.settings'),- icon: Cog8ToothIcon,- },- ] : []+ const adminTabs =+ project?.isOwner || sharedRoles === roleAdmin.role+ ? [+ {+ id: 'settings',+ label: t('common.settings'),+ icon: Cog8ToothIcon,+ },+ ]+ : []if (isSelfhosted) {- return [- ...selfhostedOnly,- ...adminTabs,- ]+ return [...selfhostedOnly, ...adminTabs]}const newTabs = [@@ -692,17 +836,20 @@ const ViewProject = ({}, [t, sharedRoles, project, projectQueryTabs])// activeTabLabel is a label for active tab. Using for title in dropdown- const activeTabLabel = useMemo(() => _find(tabs, tab => tab.id === activeTab)?.label, [tabs, activeTab])+ const activeTabLabel = useMemo(() => _find(tabs, (tab) => tab.id === activeTab)?.label, [tabs, activeTab])// switchActiveChartMetric is a function for change activeChartMetrics// eslint-disable-next-line react-hooks/exhaustive-deps- const switchActiveChartMetric = useCallback(_debounce((pairID) => {- if (activeTab === PROJECT_TABS.performance) {- setActiveChartMetricsPerf(pairID)- } else {- setActiveChartMetrics(prev => ({ ...prev, [pairID]: !prev[pairID] }))- }- }, 0), [activeTab])+ const switchActiveChartMetric = useCallback(+ _debounce((pairID) => {+ if (activeTab === PROJECT_TABS.performance) {+ setActiveChartMetricsPerf(pairID)+ } else {+ setActiveChartMetrics((prev) => ({ ...prev, [pairID]: !prev[pairID] }))+ }+ }, 0),+ [activeTab],+ )// onErrorLoading is a function for redirect to dashboard when project do not existconst onErrorLoading = () => {@@ -759,10 +906,30 @@ const ViewProject = ({// check if activePeriod is customif (period === 'custom' && dateRange) {// activePeriod is custom- data = await getProjectDataCustomEvents(id, timeBucket, '', filters, from, to, timezone, activeChartMetricsCustomEvents, projectPassword)+ data = await getProjectDataCustomEvents(+ id,+ timeBucket,+ '',+ filters,+ from,+ to,+ timezone,+ activeChartMetricsCustomEvents,+ projectPassword,+ )} else {// activePeriod is not custom- data = await getProjectDataCustomEvents(id, timeBucket, period, filters, '', '', timezone, activeChartMetricsCustomEvents, projectPassword)+ data = await getProjectDataCustomEvents(+ id,+ timeBucket,+ period,+ filters,+ '',+ '',+ timezone,+ activeChartMetricsCustomEvents,+ projectPassword,+ )}}@@ -772,7 +939,17 @@ const ViewProject = ({const applyRegions = !_includes(noRegionPeriods, activePeriod?.period)// render new settings for chart- const bbSettings = getSettings(chartData, timeBucket, activeChartMetrics, applyRegions, timeFormat, forecasedChartData, rotateXAxis, chartType, events)+ const bbSettings = getSettings(+ chartData,+ timeBucket,+ activeChartMetrics,+ applyRegions,+ timeFormat,+ forecasedChartData,+ rotateXAxis,+ chartType,+ events,+ )// set chart datasetMainChart(() => {// @ts-ignore@@ -814,7 +991,14 @@ const ViewProject = ({setDataLoading(true)try {- let data: { timeBucket?: any; chart?: any; params?: any; customs?: any; appliedFilters?: any; overall?: IOverallObject }+ let data: {+ timeBucket?: any+ chart?: any+ params?: any+ customs?: any+ appliedFilters?: any+ overall?: IOverallObject+ }let dataComparelet key = ''let keyCompare = ''@@ -870,8 +1054,27 @@ const ViewProject = ({if (!_isEmpty(cache[id]) && !_isEmpty(cache[id][keyCompare])) {dataCompare = cache[id][keyCompare]} else {- dataCompare = (await getProjectCompareData(id, timeBucket, '', newFilters || filters, fromCompare, toCompare, timezone, projectPassword, mode)) || {}- const compareOverall = await getOverallStats([id], 'custom', fromCompare, toCompare, timezone, newFilters || filters, projectPassword)+ dataCompare =+ (await getProjectCompareData(+ id,+ timeBucket,+ '',+ newFilters || filters,+ fromCompare,+ toCompare,+ timezone,+ projectPassword,+ mode,+ )) || {}+ const compareOverall = await getOverallStats(+ [id],+ 'custom',+ fromCompare,+ toCompare,+ timezone,+ newFilters || filters,+ projectPassword,+ )dataCompare.overall = compareOverall[id]}}@@ -889,18 +1092,58 @@ const ViewProject = ({}// check if we need to load new data or we have data in redux/localstorage- if ((!forced && !_isEmpty(cache[id]) && !_isEmpty(cache[id][key]))) {+ if (!forced && !_isEmpty(cache[id]) && !_isEmpty(cache[id][key])) {data = cache[id][key]// @ts-ignoresetOverall(data.overall)} else {if (period === 'custom' && dateRange) {- data = await getProjectData(id, timeBucket, '', newFilters || filters, from, to, timezone, projectPassword, mode)- customEventsChart = await getProjectDataCustomEvents(id, timeBucket, '', filters, from, to, timezone, activeChartMetricsCustomEvents, projectPassword)+ data = await getProjectData(+ id,+ timeBucket,+ '',+ newFilters || filters,+ from,+ to,+ timezone,+ projectPassword,+ mode,+ )+ customEventsChart = await getProjectDataCustomEvents(+ id,+ timeBucket,+ '',+ filters,+ from,+ to,+ timezone,+ activeChartMetricsCustomEvents,+ projectPassword,+ )rawOverall = await getOverallStats([id], period, from, to, timezone, newFilters || filters, projectPassword)} else {- data = await getProjectData(id, timeBucket, period, newFilters || filters, '', '', timezone, projectPassword, mode)- customEventsChart = await getProjectDataCustomEvents(id, timeBucket, period, filters, '', '', timezone, activeChartMetricsCustomEvents, projectPassword)+ data = await getProjectData(+ id,+ timeBucket,+ period,+ newFilters || filters,+ '',+ '',+ timezone,+ projectPassword,+ mode,+ )+ customEventsChart = await getProjectDataCustomEvents(+ id,+ timeBucket,+ period,+ filters,+ '',+ '',+ timezone,+ activeChartMetricsCustomEvents,+ projectPassword,+ )rawOverall = await getOverallStats([id], period, '', '', timezone, newFilters || filters, projectPassword)}@@ -934,9 +1177,7 @@ const ViewProject = ({return}- const {- chart, params, customs, appliedFilters,- } = data+ const { chart, params, customs, appliedFilters } = datalet newTimebucket = timeBucketsdkInstance?._emitEvent('load', sdkData)@@ -977,7 +1218,18 @@ const ViewProject = ({setIsPanelsDataEmpty(true)} else {const applyRegions = !_includes(noRegionPeriods, activePeriod?.period)- const bbSettings = getSettings(chart, newTimebucket, activeChartMetrics, applyRegions, timeFormat, forecasedChartData, rotateXAxis, chartType, customEventsChart, dataCompare?.chart)+ const bbSettings = getSettings(+ chart,+ newTimebucket,+ activeChartMetrics,+ applyRegions,+ timeFormat,+ forecasedChartData,+ rotateXAxis,+ chartType,+ customEventsChart,+ dataCompare?.chart,+ )setChartData(chart)setPanelsData({@@ -1011,7 +1263,16 @@ const ViewProject = ({const getCustomEventMetadata = async (event: string) => {if (period === 'custom' && dateRange) {- return getCustomEventsMetadata(id, event, timeBucket, '', getFormatDate(dateRange[0]), getFormatDate(dateRange[1]), timezone, projectPassword)+ return getCustomEventsMetadata(+ id,+ event,+ timeBucket,+ '',+ getFormatDate(dateRange[0]),+ getFormatDate(dateRange[1]),+ timezone,+ projectPassword,+ )}return getCustomEventsMetadata(id, event, timeBucket, period, '', '', timezone, projectPassword)@@ -1050,6 +1311,7 @@ const ViewProject = ({if (PROJECT_TABS[tab]) {setActiveTab(tab)}+ // eslint-disable-next-line react-hooks/exhaustive-deps}, [])const loadSessions = async () => {@@ -1060,7 +1322,7 @@ const ViewProject = ({setSessionsLoading(true)try {- let dataSessions: { sessions: ISession[], appliedFilters: any[] }+ let dataSessions: { sessions: ISession[]; appliedFilters: any[] }let fromlet to@@ -1070,9 +1332,29 @@ const ViewProject = ({}if (period === 'custom' && dateRange) {- dataSessions = await getSessions(id, '', filtersSessions, from, to, SESSIONS_TAKE, sessionsSkip, timezone, projectPassword)+ dataSessions = await getSessions(+ id,+ '',+ filtersSessions,+ from,+ to,+ SESSIONS_TAKE,+ sessionsSkip,+ timezone,+ projectPassword,+ )} else {- dataSessions = await getSessions(id, period, filtersSessions, '', '', SESSIONS_TAKE, sessionsSkip, timezone, projectPassword)+ dataSessions = await getSessions(+ id,+ period,+ filtersSessions,+ '',+ '',+ SESSIONS_TAKE,+ sessionsSkip,+ timezone,+ projectPassword,+ )}setSessions((prev) => [...prev, ...(dataSessions?.sessions || [])])@@ -1152,8 +1434,25 @@ const ViewProject = ({if (!_isEmpty(cache[id]) && !_isEmpty(cache[id][keyCompare])) {dataCompare = cache[id][keyCompare]} else {- dataCompare = await getPerfData(id, timeBucket, '', newFilters || filtersPerf, fromCompare, toCompare, timezone, projectPassword)- const compareOverall = await getPerformanceOverallStats([id], 'custom', fromCompare, toCompare, timezone, newFilters || filters, projectPassword)+ dataCompare = await getPerfData(+ id,+ timeBucket,+ '',+ newFilters || filtersPerf,+ fromCompare,+ toCompare,+ timezone,+ projectPassword,+ )+ const compareOverall = await getPerformanceOverallStats(+ [id],+ 'custom',+ fromCompare,+ toCompare,+ timezone,+ newFilters || filters,+ projectPassword,+ )dataCompare.overall = compareOverall[id]}}@@ -1175,11 +1474,37 @@ const ViewProject = ({setOverallPerformance(dataPerf.overall)} else {if (period === 'custom' && dateRange) {- dataPerf = await getPerfData(id, timeBucket, '', newFilters || filtersPerf, from, to, timezone, projectPassword)+ dataPerf = await getPerfData(+ id,+ timeBucket,+ '',+ newFilters || filtersPerf,+ from,+ to,+ timezone,+ projectPassword,+ )rawOverall = await getOverallStats([id], period, from, to, timezone, newFilters || filters, projectPassword)} else {- dataPerf = await getPerfData(id, timeBucket, period, newFilters || filtersPerf, '', '', timezone, projectPassword)- rawOverall = await getPerformanceOverallStats([id], period, '', '', timezone, newFilters || filters, projectPassword)+ dataPerf = await getPerfData(+ id,+ timeBucket,+ period,+ newFilters || filtersPerf,+ '',+ '',+ timezone,+ projectPassword,+ )+ rawOverall = await getPerformanceOverallStats(+ [id],+ period,+ '',+ '',+ timezone,+ newFilters || filters,+ projectPassword,+ )}// @ts-ignore@@ -1189,9 +1514,7 @@ const ViewProject = ({setOverallPerformance(rawOverall[id])}- const {- appliedFilters,- } = dataPerf+ const { appliedFilters } = dataPerfif (!_isEmpty(appliedFilters)) {setFiltersPerf(appliedFilters)@@ -1216,7 +1539,10 @@ const ViewProject = ({if (item.period === KEY_FOR_ALL_TIME) {return {...item,- tbs: dataPerf.timeBucket.length > 2 ? [dataPerf.timeBucket[0], dataPerf.timeBucket[1]] : dataPerf.timeBucket,+ tbs:+ dataPerf.timeBucket.length > 2+ ? [dataPerf.timeBucket[0], dataPerf.timeBucket[1]]+ : dataPerf.timeBucket,}}return item@@ -1231,7 +1557,6 @@ const ViewProject = ({setDataChartPerfCompare(dataCompare.chart)}-if (!_isEmpty(dataCompare?.overall)) {setOverallPerformanceCompare(dataCompare.overall)}@@ -1241,7 +1566,15 @@ const ViewProject = ({setIsPanelsDataEmptyPerf(true)} else {const { chart: chartPerf } = dataPerf- const bbSettings = getSettingsPerf(chartPerf, timeBucket, activeChartMetricsPerf, rotateXAxis, chartType, timeFormat, dataCompare?.chart)+ const bbSettings = getSettingsPerf(+ chartPerf,+ timeBucket,+ activeChartMetricsPerf,+ rotateXAxis,+ chartType,+ timeFormat,+ dataCompare?.chart,+ )setChartDataPerf(chartPerf)setPanelsDataPerf({@@ -1272,65 +1605,83 @@ const ViewProject = ({}}- const loadFunnelsData = useCallback(async (forced = false) => {- if (!activeFunnel) {- return- }-- if (!forced && (isLoading || _isEmpty(project) || dataLoading)) {- return- }+ const loadFunnelsData = useCallback(+ async (forced = false) => {+ if (!activeFunnel) {+ return+ }- setDataLoading(true)+ if (!forced && (isLoading || _isEmpty(project) || dataLoading)) {+ return+ }- try {- let dataFunnel: { funnel: IAnalyticsFunnel[], totalPageviews: number }- let key- let from- let to+ setDataLoading(true)- if (dateRange) {- from = getFormatDate(dateRange[0])- to = getFormatDate(dateRange[1])- key = getFunnelsCacheCustomKey(id, activeFunnel.id, from, to)- } else {- key = getFunnelsCacheKey(id, activeFunnel.id, period)- }+ try {+ let dataFunnel: { funnel: IAnalyticsFunnel[]; totalPageviews: number }+ let key+ let from+ let to++ if (dateRange) {+ from = getFormatDate(dateRange[0])+ to = getFormatDate(dateRange[1])+ key = getFunnelsCacheCustomKey(id, activeFunnel.id, from, to)+ } else {+ key = getFunnelsCacheKey(id, activeFunnel.id, period)+ }- if (!forced && !_isEmpty(cacheFunnels[id]) && !_isEmpty(cacheFunnels[id][key])) {- dataFunnel = cacheFunnels[id][key]- } else {- if (period === 'custom' && dateRange) {- dataFunnel = await getFunnelData(id, '', from, to, timezone, activeFunnel.id, projectPassword)+ if (!forced && !_isEmpty(cacheFunnels[id]) && !_isEmpty(cacheFunnels[id][key])) {+ dataFunnel = cacheFunnels[id][key]} else {- dataFunnel = await getFunnelData(id, period, '', '', timezone, activeFunnel.id, projectPassword)+ if (period === 'custom' && dateRange) {+ dataFunnel = await getFunnelData(id, '', from, to, timezone, activeFunnel.id, projectPassword)+ } else {+ dataFunnel = await getFunnelData(id, period, '', '', timezone, activeFunnel.id, projectPassword)+ }++ setFunnelsCache(id, dataFunnel || {}, key)}- setFunnelsCache(id, dataFunnel || {}, key)- }+ const { funnel, totalPageviews } = dataFunnel- const { funnel, totalPageviews } = dataFunnel+ const bbSettings = getSettingsFunnels(funnel, totalPageviews, t)- const bbSettings = getSettingsFunnels(funnel, totalPageviews, t)+ if (activeTab === PROJECT_TABS.funnels) {+ setMainChart(() => {+ // @ts-ignore+ const generate = bb.generate(bbSettings)+ generate.data.names(dataNamesFunnel)+ return generate+ })+ }- if (activeTab === PROJECT_TABS.funnels) {- setMainChart(() => {- // @ts-ignore- const generate = bb.generate(bbSettings)- generate.data.names(dataNamesFunnel)- return generate- })+ setAnalyticsLoading(false)+ setDataLoading(false)+ } catch (e) {+ setAnalyticsLoading(false)+ setDataLoading(false)+ console.error('[ERROR](loadFunnelsData) Loading funnels data failed')+ console.error(e)}-- setAnalyticsLoading(false)- setDataLoading(false)- } catch (e) {- setAnalyticsLoading(false)- setDataLoading(false)- console.error('[ERROR](loadFunnelsData) Loading funnels data failed')- console.error(e)- }- }, [activeFunnel, activeTab, cacheFunnels, dataLoading, dateRange, id, isLoading, period, project, projectPassword, timezone, setFunnelsCache, t, dataNamesFunnel])+ },+ [+ activeFunnel,+ activeTab,+ cacheFunnels,+ dataLoading,+ dateRange,+ id,+ isLoading,+ period,+ project,+ projectPassword,+ timezone,+ setFunnelsCache,+ t,+ dataNamesFunnel,+ ],+ )// this funtion is used for requesting the data from the API when the filter is changedconst filterHandler = (column: string, filter: any, isExclusive = false) => {@@ -1351,10 +1702,7 @@ const ViewProject = ({navigate(`${pathname}${search}`)setFiltersPerf(newFiltersPerf)} else {- newFiltersPerf = [- ...filtersPerf,- { column, filter, isExclusive },- ]+ newFiltersPerf = [...filtersPerf, { column, filter, isExclusive }]// @ts-ignoreconst url = new URL(window.location)@@ -1376,10 +1724,7 @@ const ViewProject = ({navigate(`${pathname}${search}`)setFiltersSessions(newFiltersSessions)} else {- newFiltersSessions = [- ...filtersSessions,- { column, filter, isExclusive },- ]+ newFiltersSessions = [...filtersSessions, { column, filter, isExclusive }]// @ts-ignoreconst url = new URL(window.location)@@ -1407,10 +1752,7 @@ const ViewProject = ({} else {// selected filter is not present in the filters array -> applying it// sroting filter in the state- newFilters = [- ...filters,- { column, filter, isExclusive },- ]+ newFilters = [...filters, { column, filter, isExclusive }]setFilters(newFilters)// storing filter in the page URL@@ -1433,10 +1775,13 @@ const ViewProject = ({}}- const onFilterSearch = (items: {- column: string- filter: string[]- }[], override: boolean) => {+ const onFilterSearch = (+ items: {+ column: string+ filter: string[]+ }[],+ override: boolean,+ ) => {const newFilters = _filter(items, (item) => {return !_isEmpty(item.filter)})@@ -1465,14 +1810,8 @@ const ViewProject = ({navigate(`${pathname}${search}`)if (!override) {- loadAnalyticsPerf(true, [- ...filtersPerf,- ...newFilters,- ])- setFiltersPerf([- ...filtersPerf,- ...newFilters,- ])+ loadAnalyticsPerf(true, [...filtersPerf, ...newFilters])+ setFiltersPerf([...filtersPerf, ...newFilters])return}@@ -1503,10 +1842,7 @@ const ViewProject = ({resetSessions()if (!override) {- setFiltersSessions([- ...filters,- ...converted,- ])+ setFiltersSessions([...filters, ...converted])return}@@ -1533,14 +1869,8 @@ const ViewProject = ({navigate(`${pathname}${search}`)if (!override) {- loadAnalytics(true, [- ...filters,- ...newFilters,- ])- setFilters([- ...filters,- ...newFilters,- ])+ loadAnalytics(true, [...filters, ...newFilters])+ setFilters([...filters, ...newFilters])return}@@ -1694,16 +2024,42 @@ const ViewProject = ({// this useEffect is used for update chart settings when activeChartMetrics changed also using for perfomance tabuseEffect(() => {if (activeTab === PROJECT_TABS.traffic) {- if ((!isLoading && !_isEmpty(chartData) && !_isEmpty(mainChart)) || (isActiveCompare && !_isEmpty(dataChartCompare) && !_isEmpty(mainChart))) {- if (activeChartMetrics.views || activeChartMetrics.unique || activeChartMetrics.viewsPerUnique || activeChartMetrics.trendlines) {+ if (+ (!isLoading && !_isEmpty(chartData) && !_isEmpty(mainChart)) ||+ (isActiveCompare && !_isEmpty(dataChartCompare) && !_isEmpty(mainChart))+ ) {+ if (+ activeChartMetrics.views ||+ activeChartMetrics.unique ||+ activeChartMetrics.viewsPerUnique ||+ activeChartMetrics.trendlines+ ) {mainChart.load({columns: getColumns(chartData, activeChartMetrics),})}- if (activeChartMetrics.bounce || activeChartMetrics.sessionDuration || activeChartMetrics.views || activeChartMetrics.unique || !activeChartMetrics.bounce || !activeChartMetrics.sessionDuration) {+ if (+ activeChartMetrics.bounce ||+ activeChartMetrics.sessionDuration ||+ activeChartMetrics.views ||+ activeChartMetrics.unique ||+ !activeChartMetrics.bounce ||+ !activeChartMetrics.sessionDuration+ ) {const applyRegions = !_includes(noRegionPeriods, activePeriod?.period)- const bbSettings = getSettings(chartData, timeBucket, activeChartMetrics, applyRegions, timeFormat, forecasedChartData, rotateXAxis, chartType, customEventsChartData, dataChartCompare)+ const bbSettings = getSettings(+ chartData,+ timeBucket,+ activeChartMetrics,+ applyRegions,+ timeFormat,+ forecasedChartData,+ rotateXAxis,+ chartType,+ customEventsChartData,+ dataChartCompare,+ )setMainChart(() => {// @ts-ignore@@ -1732,7 +2088,15 @@ const ViewProject = ({}}} else if (!isLoading && !_isEmpty(chartDataPerf) && !_isEmpty(mainChart)) {- const bbSettings = getSettingsPerf(chartDataPerf, timeBucket, activeChartMetricsPerf, rotateXAxis, chartType, timeFormat, dataChartPerfCompare)+ const bbSettings = getSettingsPerf(+ chartDataPerf,+ timeBucket,+ activeChartMetricsPerf,+ rotateXAxis,+ chartType,+ timeFormat,+ dataChartPerfCompare,+ )setMainChart(() => {// @ts-ignore@@ -1759,52 +2123,63 @@ const ViewProject = ({})// @ts-ignore- sdk = new SwetrixSDK(processedExtensions, {- debug: isDevelopment,- }, {- onAddExportDataRow: (label: any, onClick: (e: any) => void) => {- setCustomExportTypes((prev) => {- // TODO: Fix this- // A temporary measure to prevent duplicate items stored here (for some reason, SDK is initialised two times)- return _uniqBy([- {- label,- onClick,- },- ...prev,- ], 'label')- })- },- onRemoveExportDataRow: (label: any) => {- setCustomExportTypes((prev) => _filter(prev, (row) => row.label !== label))- },- onAddPanelTab: (extensionID: string, panelID: string, tabContent: any, onOpen: (a: any) => void) => {- setCustomPanelTabs((prev) => [- ...prev,- {- extensionID,- panelID,- tabContent,- onOpen,- },- ])+ sdk = new SwetrixSDK(+ processedExtensions,+ {+ debug: isDevelopment,},- onUpdatePanelTab: (extensionID: string, panelID: string, tabContent: any) => {- setCustomPanelTabs((prev) => _map(prev, (row) => {- if (row.extensionID === extensionID && row.panelID === panelID) {- return {- ...row,+ {+ onAddExportDataRow: (label: any, onClick: (e: any) => void) => {+ setCustomExportTypes((prev) => {+ // TODO: Fix this+ // A temporary measure to prevent duplicate items stored here (for some reason, SDK is initialised two times)+ return _uniqBy(+ [+ {+ label,+ onClick,+ },+ ...prev,+ ],+ 'label',+ )+ })+ },+ onRemoveExportDataRow: (label: any) => {+ setCustomExportTypes((prev) => _filter(prev, (row) => row.label !== label))+ },+ onAddPanelTab: (extensionID: string, panelID: string, tabContent: any, onOpen: (a: any) => void) => {+ setCustomPanelTabs((prev) => [+ ...prev,+ {+ extensionID,+ panelID,tabContent,- }- }-- return row- }))- },- onRemovePanelTab: (extensionID: string, panelID: string) => {- setCustomPanelTabs((prev) => _filter(prev, (row) => row.extensionID !== extensionID && row.panelID !== panelID))+ onOpen,+ },+ ])+ },+ onUpdatePanelTab: (extensionID: string, panelID: string, tabContent: any) => {+ setCustomPanelTabs((prev) =>+ _map(prev, (row) => {+ if (row.extensionID === extensionID && row.panelID === panelID) {+ return {+ ...row,+ tabContent,+ }+ }++ return row+ }),+ )+ },+ onRemovePanelTab: (extensionID: string, panelID: string) => {+ setCustomPanelTabs((prev) =>+ _filter(prev, (row) => row.extensionID !== extensionID && row.panelID !== panelID),+ )+ },},- })+ )setSdkInstance(sdk)}@@ -1838,12 +2213,14 @@ const ViewProject = ({return}- const {- active: isActive, created, public: isPublic,- } = project+ const { active: isActive, created, public: isPublic } = projectsdkInstance?._emitEvent('projectinfo', {- id, name, isActive, created, isPublic,+ id,+ name,+ isActive,+ created,+ isPublic,})}, [sdkInstance, name]) // eslint-disable-line@@ -2038,7 +2415,22 @@ const ViewProject = ({if (areFiltersPerfParsed && areTimeBucketParsed && arePeriodParsed && activeTab === PROJECT_TABS.performance) {loadAnalyticsPerf()}- }, [project, period, chartType, filters, forecasedChartData, timeBucket, periodPairs, areFiltersParsed, areTimeBucketParsed, arePeriodParsed, t, activeTab, areFiltersPerfParsed]) // eslint-disable-line+ // eslint-disable-next-line react-hooks/exhaustive-deps+ }, [+ project,+ period,+ chartType,+ filters,+ forecasedChartData,+ timeBucket,+ periodPairs,+ areFiltersParsed,+ areTimeBucketParsed,+ arePeriodParsed,+ t,+ activeTab,+ areFiltersPerfParsed,+ ])useEffect(() => {if (activeTab === PROJECT_TABS.sessions && areFiltersSessionsParsed) {@@ -2059,7 +2451,18 @@ const ViewProject = ({loadAnalyticsPerf()}// eslint-disable-next-line react-hooks/exhaustive-deps- }, [project, period, chartType, filters, forecasedChartData, areFiltersParsed, areTimeBucketParsed, arePeriodParsed, activeTab, areFiltersPerfParsed])+ }, [+ project,+ period,+ chartType,+ filters,+ forecasedChartData,+ areFiltersParsed,+ areTimeBucketParsed,+ arePeriodParsed,+ activeTab,+ areFiltersPerfParsed,+ ])useEffect(() => {if (!project || !activeFunnel) {@@ -2108,7 +2511,7 @@ const ViewProject = ({}getProject(id, false, projectPassword)- .then(projectRes => {+ .then((projectRes) => {if (_isEmpty(projectRes)) {onErrorLoading()}@@ -2126,26 +2529,23 @@ const ViewProject = ({} else {setProjects([...(projects as any[]), projectRes])getLiveVisitors([id], projectPassword)- .then(res => {+ .then((res) => {setLiveStatsForProject(id, res[id])})- .catch(e => {+ .catch((e) => {console.error('[ERROR] (getProject -> getLiveVisitors)', e)onErrorLoading()})}})- .catch(e => {+ .catch((e) => {console.error('[ERROR] (getProject)', e)onErrorLoading()})}, [isLoading, project, id, setPublicProject]) // eslint-disable-line// updatePeriod using for update period and timeBucket also update url- const updatePeriod = (newPeriod: {- period: string- label?: string- }) => {+ const updatePeriod = (newPeriod: { period: string; label?: string }) => {const newPeriodFull = _find(periodPairs, (el) => el.period === newPeriod.period)let tb = timeBucket// @ts-ignore@@ -2225,7 +2625,9 @@ const ViewProject = ({// @ts-ignoreconst url = new URL(window.location)const { searchParams } = url- const intialPeriod = projectViewPrefs ? searchParams.get('period') || projectViewPrefs[id]?.period : searchParams.get('period') || '7d'+ const intialPeriod = projectViewPrefs+ ? searchParams.get('period') || projectViewPrefs[id]?.period+ : searchParams.get('period') || '7d'const tab = searchParams.get('tab')if (tab === PROJECT_TABS.performance) {@@ -2261,10 +2663,12 @@ const ViewProject = ({// check for conflicts in chart metrics in dropdown if conflicted disable some column of dropdownconst isConflicted = (conflicts: string[]) => {- const conflicted = conflicts && _some(conflicts, (conflict) => {- const conflictPair = _find(chartMetrics, (metric) => metric.id === conflict)- return conflictPair && conflictPair.active- })+ const conflicted =+ conflicts &&+ _some(conflicts, (conflict) => {+ const conflictPair = _find(chartMetrics, (metric) => metric.id === conflict)+ return conflictPair && conflictPair.active+ })return conflicted}@@ -2334,9 +2738,7 @@ const ViewProject = ({if (!isLoading) {return (<>- {!embedded && (- <Header ssrTheme={ssrTheme} authenticated={authenticated} />- )}+ {!embedded && <Header ssrTheme={ssrTheme} authenticated={authenticated} />}<EventsRunningOutBanner /><divref={ref}@@ -2345,13 +2747,10 @@ const ViewProject = ({})}><div- className={cx(- 'max-w-[1584px] w-full mx-auto py-6 px-2 sm:px-4 lg:px-8',- {- 'min-h-min-footer': !embedded,- 'min-h-[100vh]': embedded,- },- )}+ className={cx('max-w-[1584px] w-full mx-auto py-6 px-2 sm:px-4 lg:px-8', {+ 'min-h-min-footer': !embedded,+ 'min-h-[100vh]': embedded,+ })}ref={dashboardRef}>{/* Tabs selector */}@@ -2380,37 +2779,41 @@ const ViewProject = ({<div className='hidden sm:block'><div><nav className='-mb-px flex space-x-4 overflow-x-auto' aria-label='Tabs'>- {_map(tabs, tab => {+ {_map(tabs, (tab) => {const isCurrent = tab.id === activeTabconst isSettings = tab.id === 'settings'const onClick = isSettings? openSettingsHandler: () => {- setProjectTab(tab.id)- setActiveTab(tab.id)- }+ setProjectTab(tab.id)+ setActiveTab(tab.id)+ }return (<divkey={tab.id}onClick={onClick}- className={cx('group inline-flex items-center whitespace-nowrap py-2 px-1 border-b-2 font-bold text-md cursor-pointer', {- 'border-slate-900 text-slate-900 dark:text-gray-50 dark:border-gray-50': isCurrent,- 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300 dark:text-gray-400 dark:hover:border-gray-300 dark:hover:text-gray-300': !isCurrent,- })}+ className={cx(+ 'group inline-flex items-center whitespace-nowrap py-2 px-1 border-b-2 font-bold text-md cursor-pointer',+ {+ 'border-slate-900 text-slate-900 dark:text-gray-50 dark:border-gray-50': isCurrent,+ 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300 dark:text-gray-400 dark:hover:border-gray-300 dark:hover:text-gray-300':+ !isCurrent,+ },+ )}aria-current={isCurrent ? 'page' : undefined}><tab.iconclassName={cx(- isCurrent ? 'text-slate-900 dark:text-gray-50' : 'text-gray-500 group-hover:text-gray-500 dark:text-gray-400 dark:group-hover:text-gray-300',+ isCurrent+ ? 'text-slate-900 dark:text-gray-50'+ : 'text-gray-500 group-hover:text-gray-500 dark:text-gray-400 dark:group-hover:text-gray-300','-ml-0.5 mr-2 h-5 w-5',)}aria-hidden='true'/>- <span>- {tab.label}- </span>+ <span>{tab.label}</span></div>)})}@@ -2418,374 +2821,424 @@ const ViewProject = ({</div></div></div>- {activeTab !== PROJECT_TABS.alerts && (activeTab !== PROJECT_TABS.sessions || !activeSession) && (activeFunnel || activeTab !== PROJECT_TABS.funnels) && (- <>- <div className='flex flex-col lg:flex-row items-center lg:items-start justify-between mt-2'>- <div className='flex items-center space-x-5 flex-wrap'>- <h2 className='text-xl font-bold text-gray-900 dark:text-gray-50 break-words break-all'>- {/* If tab is funnels - then display a funnel name, otherwise a project name */}- {activeTab === PROJECT_TABS.funnels ? activeFunnel?.name : name}- </h2>- {activeTab !== PROJECT_TABS.funnels && (- <LiveVisitorsDropdown projectId={project.id} live={liveStats[id]} projectPassword={projectPassword} />- )}- </div>- <div className='flex items-center mt-3 lg:mt-0 max-w-[420px] flex-wrap sm:flex-nowrap sm:max-w-none justify-center sm:justify-between w-full sm:w-auto mx-auto sm:mx-0 space-x-2 gap-y-1'>- {activeTab !== PROJECT_TABS.funnels && (- <>- <div>- <button- type='button'- title={t('project.refreshStats')}- onClick={refreshStats}- className={cx('relative rounded-md p-2 bg-gray-50 text-sm font-medium hover:bg-white hover:shadow-sm dark:bg-slate-900 dark:hover:bg-slate-800 focus:z-10 focus:outline-none focus:ring-1 focus:ring-indigo-500 focus:border-indigo-500 focus:dark:ring-gray-200 focus:dark:border-gray-200', {- 'cursor-not-allowed opacity-50': isLoading || dataLoading,- })}- >- <ArrowPathIcon className='w-5 h-5 stroke-2 text-gray-700 dark:text-gray-50' />- </button>- </div>- {(!isSelfhosted && !isActiveCompare) && (+ {activeTab !== PROJECT_TABS.alerts &&+ (activeTab !== PROJECT_TABS.sessions || !activeSession) &&+ (activeFunnel || activeTab !== PROJECT_TABS.funnels) && (+ <>+ <div className='flex flex-col lg:flex-row items-center lg:items-start justify-between mt-2'>+ <div className='flex items-center space-x-5 flex-wrap'>+ <h2 className='text-xl font-bold text-gray-900 dark:text-gray-50 break-words break-all'>+ {/* If tab is funnels - then display a funnel name, otherwise a project name */}+ {activeTab === PROJECT_TABS.funnels ? activeFunnel?.name : name}+ </h2>+ {activeTab !== PROJECT_TABS.funnels && (+ <LiveVisitorsDropdown+ projectId={project.id}+ live={liveStats[id]}+ projectPassword={projectPassword}+ />+ )}+ </div>+ <div className='flex items-center mt-3 lg:mt-0 max-w-[420px] flex-wrap sm:flex-nowrap sm:max-w-none justify-center sm:justify-between w-full sm:w-auto mx-auto sm:mx-0 space-x-2 gap-y-1'>+ {activeTab !== PROJECT_TABS.funnels && (+ <>+ <div>+ <button+ type='button'+ title={t('project.refreshStats')}+ onClick={refreshStats}+ className={cx(+ 'relative rounded-md p-2 bg-gray-50 text-sm font-medium hover:bg-white hover:shadow-sm dark:bg-slate-900 dark:hover:bg-slate-800 focus:z-10 focus:outline-none focus:ring-1 focus:ring-indigo-500 focus:border-indigo-500 focus:dark:ring-gray-200 focus:dark:border-gray-200',+ {+ 'cursor-not-allowed opacity-50': isLoading || dataLoading,+ },+ )}+ >+ <ArrowPathIcon className='w-5 h-5 stroke-2 text-gray-700 dark:text-gray-50' />+ </button>+ </div>+ {!isSelfhosted && !isActiveCompare && (+ <div+ className={cx({+ hidden: activeTab !== PROJECT_TABS.traffic || _isEmpty(chartData),+ })}+ >+ <button+ type='button'+ title={t('modals.forecast.title')}+ onClick={onForecastOpen}+ disabled={!_isEmpty(filters)}+ className={cx(+ 'relative rounded-md p-2 bg-gray-50 text-sm font-medium hover:bg-white hover:shadow-sm dark:bg-slate-900 dark:hover:bg-slate-800 focus:z-10 focus:outline-none focus:ring-1 focus:ring-indigo-500 focus:border-indigo-500 focus:dark:ring-gray-200 focus:dark:border-gray-200',+ {+ 'cursor-not-allowed opacity-50': isLoading || dataLoading || !_isEmpty(filters),+ '!bg-gray-200 dark:!bg-gray-600 !border dark:!border-gray-500 !border-gray-300':+ !_isEmpty(forecasedChartData),+ },+ )}+ >+ <Robot+ theme={_theme}+ containerClassName='w-5 h-5'+ className='text-gray-700 dark:text-gray-50 stroke-2'+ />+ </button>+ </div>+ )}<div- className={cx({- hidden: activeTab !== PROJECT_TABS.traffic || _isEmpty(chartData),+ className={cx('border-gray-200 dark:border-gray-600', {+ 'lg:border-r': activeTab === PROJECT_TABS.funnels,})}><buttontype='button'- title={t('modals.forecast.title')}- onClick={onForecastOpen}- disabled={!_isEmpty(filters)}- className={cx('relative rounded-md p-2 bg-gray-50 text-sm font-medium hover:bg-white hover:shadow-sm dark:bg-slate-900 dark:hover:bg-slate-800 focus:z-10 focus:outline-none focus:ring-1 focus:ring-indigo-500 focus:border-indigo-500 focus:dark:ring-gray-200 focus:dark:border-gray-200', {- 'cursor-not-allowed opacity-50': isLoading || dataLoading || !_isEmpty(filters),- '!bg-gray-200 dark:!bg-gray-600 !border dark:!border-gray-500 !border-gray-300': !_isEmpty(forecasedChartData),- })}+ title={t('project.search')}+ onClick={() => setShowFiltersSearch(true)}+ className={cx(+ 'relative rounded-md p-2 bg-gray-50 text-sm font-medium hover:bg-white hover:shadow-sm dark:bg-slate-900 dark:hover:bg-slate-800 focus:z-10 focus:outline-none focus:ring-1 focus:ring-indigo-500 focus:border-indigo-500 focus:dark:ring-gray-200 focus:dark:border-gray-200',+ {+ 'cursor-not-allowed opacity-50': isLoading || dataLoading,+ },+ )}>- <Robot theme={_theme} containerClassName='w-5 h-5' className='text-gray-700 dark:text-gray-50 stroke-2' />+ <MagnifyingGlassIcon className='w-5 h-5 stroke-2 text-gray-700 dark:text-gray-50' /></button></div>- )}- <div- className={cx('border-gray-200 dark:border-gray-600', {- 'lg:border-r': activeTab === PROJECT_TABS.funnels,- })}- >- <button- type='button'- title={t('project.search')}- onClick={() => setShowFiltersSearch(true)}- className={cx('relative rounded-md p-2 bg-gray-50 text-sm font-medium hover:bg-white hover:shadow-sm dark:bg-slate-900 dark:hover:bg-slate-800 focus:z-10 focus:outline-none focus:ring-1 focus:ring-indigo-500 focus:border-indigo-500 focus:dark:ring-gray-200 focus:dark:border-gray-200', {- 'cursor-not-allowed opacity-50': isLoading || dataLoading,- })}+ {activeTab !== PROJECT_TABS.funnels && activeTab !== PROJECT_TABS.sessions && (+ <Dropdown+ header={t('project.exportData')}+ items={[+ ...exportTypes,+ ...customExportTypes,+ { label: t('project.lookingForMore'), lookingForMore: true, onClick: () => {} },+ ]}+ title={[<ArrowDownTrayIcon key='download-icon' className='w-5 h-5' />]}+ labelExtractor={(item) => {+ const { label, lookingForMore } = item++ if (lookingForMore) {+ return (+ <a href={MARKETPLACE_URL} target='_blank' rel='noreferrer'>+ {label}+ </a>+ )+ }++ return label+ }}+ keyExtractor={(item) => item.label}+ onSelect={(item) => item.onClick(panelsData, t)}+ chevron='mini'+ buttonClassName='!p-2 rounded-md hover:bg-white hover:shadow-sm dark:hover:bg-slate-800 focus:z-10 focus:outline-none focus:ring-1 focus:ring-indigo-500 focus:border-indigo-500 focus:dark:ring-gray-200 focus:dark:border-gray-200'+ headless+ />+ )}+ <div+ className={cx(+ 'border-gray-200 dark:border-gray-600 lg:px-3 sm:mr-3 space-x-2 lg:border-x',+ {+ hidden:+ isPanelsDataEmpty ||+ analyticsLoading ||+ checkIfAllMetricsAreDisabled ||+ activeTab === PROJECT_TABS.sessions,+ },+ )}>- <MagnifyingGlassIcon className='w-5 h-5 stroke-2 text-gray-700 dark:text-gray-50' />- </button>- </div>- {activeTab !== PROJECT_TABS.funnels && activeTab !== PROJECT_TABS.sessions && (- <Dropdown- header={t('project.exportData')}- items={[...exportTypes, ...customExportTypes, { label: t('project.lookingForMore'), lookingForMore: true, onClick: () => { } }]}- title={[- <ArrowDownTrayIcon key='download-icon' className='w-5 h-5' />,- ]}- labelExtractor={item => {- const { label, lookingForMore } = item-- if (lookingForMore) {+ <button+ type='button'+ title={t('project.barChart')}+ onClick={() => setChartTypeOnClick(chartTypes.bar)}+ className={cx(+ 'relative fill-gray-700 dark:fill-gray-50 rounded-md p-2 text-sm font-medium focus:z-10 focus:outline-none focus:ring-1 focus:ring-indigo-500 focus:border-indigo-500 focus:dark:ring-gray-200 focus:dark:border-gray-200',+ {+ 'bg-white dark:bg-slate-800 stroke-white dark:stroke-slate-800 shadow-sm':+ chartType === chartTypes.bar,+ 'bg-gray-50 stroke-gray-50 dark:bg-slate-900 dark:stroke-slate-900 [&_svg]:hover:fill-gray-500 [&_svg]:hover:dark:fill-gray-200':+ chartType !== chartTypes.bar,+ },+ )}+ >+ <BarChart className='w-5 h-5 [&_path]:stroke-[3.5%]' />+ </button>+ <button+ type='button'+ title={t('project.lineChart')}+ onClick={() => setChartTypeOnClick(chartTypes.line)}+ className={cx(+ 'relative fill-gray-700 dark:fill-gray-50 rounded-md p-2 text-sm font-medium focus:z-10 focus:outline-none focus:ring-1 focus:ring-indigo-500 focus:border-indigo-500 focus:dark:ring-gray-200 focus:dark:border-gray-200',+ {+ 'bg-white dark:bg-slate-800 stroke-white dark:stroke-slate-800 shadow-sm':+ chartType === chartTypes.line,+ 'bg-gray-50 stroke-gray-50 dark:bg-slate-900 dark:stroke-slate-900 [&_svg]:hover:fill-gray-500 [&_svg]:hover:dark:fill-gray-200':+ chartType !== chartTypes.line,+ },+ )}+ >+ <LineChart className='w-5 h-5 [&_path]:stroke-[3.5%]' />+ </button>+ </div>+ </>+ )}+ {activeTab === PROJECT_TABS.traffic && !isPanelsDataEmpty && (+ <Dropdown+ items={+ isActiveCompare+ ? _filter(chartMetrics, (el) => {+ return !_includes(FILTER_CHART_METRICS_MAPPING_FOR_COMPARE, el.id)+ })+ : chartMetrics+ }+ title={t('project.metricVis')}+ labelExtractor={(pair) => {+ const { label, id: pairID, active, conflicts } = pair++ const conflicted = isConflicted(conflicts)++ if (pairID === CHART_METRICS_MAPPING.customEvents) {+ if (_isEmpty(panelsData.customs)) {return (- <a href={MARKETPLACE_URL} target='_blank' rel='noreferrer'>+ <span className='px-4 py-2 flex items-center cursor-not-allowed'>+ <NoSymbolIcon className='w-5 h-5 mr-1' />{label}- </a>+ </span>)}- return label- }}- keyExtractor={item => item.label}- onSelect={item => item.onClick(panelsData, t)}- chevron='mini'- buttonClassName='!p-2 rounded-md hover:bg-white hover:shadow-sm dark:hover:bg-slate-800 focus:z-10 focus:outline-none focus:ring-1 focus:ring-indigo-500 focus:border-indigo-500 focus:dark:ring-gray-200 focus:dark:border-gray-200'- headless- />- )}- <div- className={cx('border-gray-200 dark:border-gray-600 lg:px-3 sm:mr-3 space-x-2 lg:border-x', {- hidden: isPanelsDataEmpty || analyticsLoading || checkIfAllMetricsAreDisabled || activeTab === PROJECT_TABS.sessions,- })}- >- <button- type='button'- title={t('project.barChart')}- onClick={() => setChartTypeOnClick(chartTypes.bar)}- className={cx('relative fill-gray-700 dark:fill-gray-50 rounded-md p-2 text-sm font-medium focus:z-10 focus:outline-none focus:ring-1 focus:ring-indigo-500 focus:border-indigo-500 focus:dark:ring-gray-200 focus:dark:border-gray-200', {- 'bg-white dark:bg-slate-800 stroke-white dark:stroke-slate-800 shadow-sm': chartType === chartTypes.bar,- 'bg-gray-50 stroke-gray-50 dark:bg-slate-900 dark:stroke-slate-900 [&_svg]:hover:fill-gray-500 [&_svg]:hover:dark:fill-gray-200': chartType !== chartTypes.bar,- })}- >- <BarChart className='w-5 h-5 [&_path]:stroke-[3.5%]' />- </button>- <button- type='button'- title={t('project.lineChart')}- onClick={() => setChartTypeOnClick(chartTypes.line)}- className={cx('relative fill-gray-700 dark:fill-gray-50 rounded-md p-2 text-sm font-medium focus:z-10 focus:outline-none focus:ring-1 focus:ring-indigo-500 focus:border-indigo-500 focus:dark:ring-gray-200 focus:dark:border-gray-200', {- 'bg-white dark:bg-slate-800 stroke-white dark:stroke-slate-800 shadow-sm': chartType === chartTypes.line,- 'bg-gray-50 stroke-gray-50 dark:bg-slate-900 dark:stroke-slate-900 [&_svg]:hover:fill-gray-500 [&_svg]:hover:dark:fill-gray-200': chartType !== chartTypes.line,- })}- >- <LineChart className='w-5 h-5 [&_path]:stroke-[3.5%]' />- </button>- </div>- </>- )}- {activeTab === PROJECT_TABS.traffic && !isPanelsDataEmpty && (- <Dropdown- items={isActiveCompare ? _filter(chartMetrics, (el) => {- return !_includes(FILTER_CHART_METRICS_MAPPING_FOR_COMPARE, el.id)- }) : chartMetrics}- title={t('project.metricVis')}- labelExtractor={(pair) => {- const {- label, id: pairID, active, conflicts,- } = pair-- const conflicted = isConflicted(conflicts)-- if (pairID === CHART_METRICS_MAPPING.customEvents) {- if (_isEmpty(panelsData.customs)) {return (- <span className='px-4 py-2 flex items-center cursor-not-allowed'>- <NoSymbolIcon className='w-5 h-5 mr-1' />- {label}- </span>+ <Dropdown+ menuItemsClassName='max-w-[300px] max-h-[300px] overflow-auto'+ items={chartMetricsCustomEvents}+ title={label}+ labelExtractor={(event) => (+ <Checkbox+ className={cx({ hidden: isPanelsDataEmpty || analyticsLoading })}+ label={+ _size(event.label) > CUSTOM_EV_DROPDOWN_MAX_VISIBLE_LENGTH ? (+ <span title={event.label}>+ {_truncate(event.label, { length: CUSTOM_EV_DROPDOWN_MAX_VISIBLE_LENGTH })}+ </span>+ ) : (+ event.label+ )+ }+ id={event.id}+ onChange={() => {}}+ checked={event.active}+ />+ )}+ buttonClassName='group-hover:bg-gray-200 dark:group-hover:bg-slate-700 px-4 py-2 inline-flex w-full bg-white text-sm font-medium text-gray-700 dark:text-gray-50 dark:border-gray-800 dark:bg-slate-800'+ keyExtractor={(event) => event.id}+ onSelect={(event, e) => {+ e?.stopPropagation()+ e?.preventDefault()++ setActiveChartMetricsCustomEvents((prev) => {+ const newActiveChartMetricsCustomEvents = [...prev]+ const index = _findIndex(prev, (item) => item === event.id)+ if (index === -1) {+ newActiveChartMetricsCustomEvents.push(event.id)+ } else {+ newActiveChartMetricsCustomEvents.splice(index, 1)+ }+ return newActiveChartMetricsCustomEvents+ })+ }}+ headless+ />)}return (- <Dropdown- menuItemsClassName='max-w-[300px] max-h-[300px] overflow-auto'- items={chartMetricsCustomEvents}- title={label}- labelExtractor={(event) => (- <Checkbox- className={cx({ hidden: isPanelsDataEmpty || analyticsLoading })}- label={_size(event.label) > CUSTOM_EV_DROPDOWN_MAX_VISIBLE_LENGTH ? (- <span title={event.label}>- {_truncate(event.label, { length: CUSTOM_EV_DROPDOWN_MAX_VISIBLE_LENGTH })}- </span>- ) : event.label}- id={event.id}- onChange={() => { }}- checked={event.active}- />- )}- buttonClassName='group-hover:bg-gray-200 dark:group-hover:bg-slate-700 px-4 py-2 inline-flex w-full bg-white text-sm font-medium text-gray-700 dark:text-gray-50 dark:border-gray-800 dark:bg-slate-800'- keyExtractor={(event) => event.id}- onSelect={(event, e) => {- e?.stopPropagation()- e?.preventDefault()-- setActiveChartMetricsCustomEvents((prev) => {- const newActiveChartMetricsCustomEvents = [...prev]- const index = _findIndex(prev, (item) => item === event.id)- if (index === -1) {- newActiveChartMetricsCustomEvents.push(event.id)- } else {- newActiveChartMetricsCustomEvents.splice(index, 1)- }- return newActiveChartMetricsCustomEvents- })- }}- headless+ <Checkbox+ className={cx('px-4 py-2', { hidden: isPanelsDataEmpty || analyticsLoading })}+ label={label}+ disabled={conflicted}+ id={pairID}+ checked={active}/>)- }-- return (- <Checkbox- className={cx('px-4 py-2', { hidden: isPanelsDataEmpty || analyticsLoading })}- label={label}- disabled={conflicted}- id={pairID}- checked={active}- />- )- }}- selectItemClassName='group text-gray-700 dark:text-gray-50 dark:border-gray-800 dark:bg-slate-800 block text-sm cursor-pointer hover:bg-gray-200 dark:hover:bg-slate-700'- keyExtractor={(pair) => pair.id}- onSelect={({ id: pairID, conflicts }) => {- if (isConflicted(conflicts)) {- generateAlert(t('project.conflictMetric'), 'error')- return- }-- if (pairID === CHART_METRICS_MAPPING.customEvents) {- return- }-- switchActiveChartMetric(pairID)- }}- chevron='mini'- headless- />- )}- {activeTab === PROJECT_TABS.funnels && (- <button- type='button'- title={t('project.refreshStats')}- onClick={refreshStats}- className={cx('relative rounded-md p-2 bg-gray-50 text-sm font-medium hover:bg-white hover:shadow-sm dark:bg-slate-900 dark:hover:bg-slate-800 focus:z-10 focus:outline-none focus:ring-1 focus:ring-indigo-500 focus:border-indigo-500 focus:dark:ring-gray-200 focus:dark:border-gray-200', {- 'cursor-not-allowed opacity-50': isLoading || dataLoading,- })}- >- <ArrowPathIcon className='w-5 h-5 text-gray-700 dark:text-gray-50' />- </button>- )}- {activeTab === PROJECT_TABS.performance && !isPanelsDataEmptyPerf && (- <Dropdown- items={chartMetricsPerf}- className='min-w-[170px] xs:min-w-0'- title={(- <p>- {_find(chartMetricsPerf, ({ id: chartId }) => chartId === activeChartMetricsPerf)?.label}- </p>- )}- labelExtractor={(pair) => pair.label}- keyExtractor={(pair) => pair.id}- onSelect={({ id: pairID }) => {- switchActiveChartMetric(pairID)- }}- chevron='mini'- headless- />- )}- <ClientOnly- fallback={(- <div className='w-44' />- )}- >- {() => (- <TBPeriodSelector- activePeriod={activePeriod}- updateTimebucket={updateTimebucket}- timeBucket={timeBucket}- items={isActiveCompare ? _filter(periodPairs, (el) => {- return _includes(filtersPeriodPairs, el.period)- }) : _includes(filtersPeriodPairs, period) ? periodPairs : _filter(periodPairs, (el) => {- return el.period !== PERIOD_PAIRS_COMPARE.COMPARE- })}- title={activePeriod?.label}- onSelect={(pair) => {- if (pair.period === PERIOD_PAIRS_COMPARE.COMPARE) {- if (activeTab === PROJECT_TABS.alerts) {- return- }-- if (isActiveCompare) {- compareDisable()- } else {- setIsActiveCompare(true)- }-+ }}+ selectItemClassName='group text-gray-700 dark:text-gray-50 dark:border-gray-800 dark:bg-slate-800 block text-sm cursor-pointer hover:bg-gray-200 dark:hover:bg-slate-700'+ keyExtractor={(pair) => pair.id}+ onSelect={({ id: pairID, conflicts }) => {+ if (isConflicted(conflicts)) {+ generateAlert(t('project.conflictMetric'), 'error')return}- if (pair.isCustomDate) {- setTimeout(() => {- // @ts-ignore- refCalendar.current.openCalendar()- }, 100)- } else {- setPeriodPairs(tbPeriodPairs(t, undefined, undefined, language))- setDateRange(null)- updatePeriod(pair)+ if (pairID === CHART_METRICS_MAPPING.customEvents) {+ return}++ switchActiveChartMetric(pairID)}}+ chevron='mini'+ headless/>)}- </ClientOnly>- {isActiveCompare && (- <>- <div className='mx-2 text-md font-medium text-gray-600 whitespace-pre-line dark:text-gray-200'>- vs- </div>+ {activeTab === PROJECT_TABS.funnels && (+ <button+ type='button'+ title={t('project.refreshStats')}+ onClick={refreshStats}+ className={cx(+ 'relative rounded-md p-2 bg-gray-50 text-sm font-medium hover:bg-white hover:shadow-sm dark:bg-slate-900 dark:hover:bg-slate-800 focus:z-10 focus:outline-none focus:ring-1 focus:ring-indigo-500 focus:border-indigo-500 focus:dark:ring-gray-200 focus:dark:border-gray-200',+ {+ 'cursor-not-allowed opacity-50': isLoading || dataLoading,+ },+ )}+ >+ <ArrowPathIcon className='w-5 h-5 text-gray-700 dark:text-gray-50' />+ </button>+ )}+ {activeTab === PROJECT_TABS.performance && !isPanelsDataEmptyPerf && (<Dropdown- items={periodPairsCompare}- title={activeDropdownLabelCompare}+ items={chartMetricsPerf}+ className='min-w-[170px] xs:min-w-0'+ title={+ <p>+ {_find(chartMetricsPerf, ({ id: chartId }) => chartId === activeChartMetricsPerf)?.label}+ </p>+ }labelExtractor={(pair) => pair.label}- keyExtractor={(pair) => pair.label}- onSelect={(pair) => {- if (pair.period === PERIOD_PAIRS_COMPARE.DISABLE) {- compareDisable()- return- }-- if (pair.period === PERIOD_PAIRS_COMPARE.CUSTOM) {- setTimeout(() => {- // @ts-ignore- refCalendarCompare.current.openCalendar()- }, 100)- } else {- setPeriodPairsCompare(tbPeriodPairsCompare(t, undefined, language))- setDateRangeCompare(null)- setActivePeriodCompare(pair.period)- }+ keyExtractor={(pair) => pair.id}+ onSelect={({ id: pairID }) => {+ switchActiveChartMetric(pairID)}}chevron='mini'headless/>- </>- )}- <FlatPicker- className='!mx-0'- ref={refCalendar}- onChange={setDateRange}- value={dateRange || []}- maxDateMonths={MAX_MONTHS_IN_PAST}- maxRange={0}- />- <FlatPicker- className='!mx-0'- ref={refCalendarCompare}- onChange={(date) => {- setDateRangeCompare(date)- setActivePeriodCompare(PERIOD_PAIRS_COMPARE.CUSTOM)- setPeriodPairsCompare(tbPeriodPairsCompare(t, date, language))- }}- value={dateRangeCompare || []}- maxDateMonths={MAX_MONTHS_IN_PAST}- maxRange={maxRangeCompare}- />+ )}+ <ClientOnly fallback={<div className='w-44' />}>+ {() => (+ <TBPeriodSelector+ activePeriod={activePeriod}+ updateTimebucket={updateTimebucket}+ timeBucket={timeBucket}+ items={+ isActiveCompare+ ? _filter(periodPairs, (el) => {+ return _includes(filtersPeriodPairs, el.period)+ })+ : _includes(filtersPeriodPairs, period)+ ? periodPairs+ : _filter(periodPairs, (el) => {+ return el.period !== PERIOD_PAIRS_COMPARE.COMPARE+ })+ }+ title={activePeriod?.label}+ onSelect={(pair) => {+ if (pair.period === PERIOD_PAIRS_COMPARE.COMPARE) {+ if (activeTab === PROJECT_TABS.alerts) {+ return+ }++ if (isActiveCompare) {+ compareDisable()+ } else {+ setIsActiveCompare(true)+ }++ return+ }++ if (pair.isCustomDate) {+ setTimeout(() => {+ // @ts-ignore+ refCalendar.current.openCalendar()+ }, 100)+ } else {+ setPeriodPairs(tbPeriodPairs(t, undefined, undefined, language))+ setDateRange(null)+ updatePeriod(pair)+ }+ }}+ />+ )}+ </ClientOnly>+ {isActiveCompare && (+ <>+ <div className='mx-2 text-md font-medium text-gray-600 whitespace-pre-line dark:text-gray-200'>+ vs+ </div>+ <Dropdown+ items={periodPairsCompare}+ title={activeDropdownLabelCompare}+ labelExtractor={(pair) => pair.label}+ keyExtractor={(pair) => pair.label}+ onSelect={(pair) => {+ if (pair.period === PERIOD_PAIRS_COMPARE.DISABLE) {+ compareDisable()+ return+ }++ if (pair.period === PERIOD_PAIRS_COMPARE.CUSTOM) {+ setTimeout(() => {+ // @ts-ignore+ refCalendarCompare.current.openCalendar()+ }, 100)+ } else {+ setPeriodPairsCompare(tbPeriodPairsCompare(t, undefined, language))+ setDateRangeCompare(null)+ setActivePeriodCompare(pair.period)+ }+ }}+ chevron='mini'+ headless+ />+ </>+ )}+ <FlatPicker+ className='!mx-0'+ ref={refCalendar}+ onChange={setDateRange}+ value={dateRange || []}+ maxDateMonths={MAX_MONTHS_IN_PAST}+ maxRange={0}+ />+ <FlatPicker+ className='!mx-0'+ ref={refCalendarCompare}+ onChange={(date) => {+ setDateRangeCompare(date)+ setActivePeriodCompare(PERIOD_PAIRS_COMPARE.CUSTOM)+ setPeriodPairsCompare(tbPeriodPairsCompare(t, date, language))+ }}+ value={dateRangeCompare || []}+ maxDateMonths={MAX_MONTHS_IN_PAST}+ maxRange={maxRangeCompare}+ />+ </div></div>- </div>- {activeTab === PROJECT_TABS.funnels && (- <button- onClick={() => setActiveFunnel(null)}- className='flex items-center text-base font-normal underline decoration-dashed hover:decoration-solid mb-4 mx-auto lg:mx-0 mt-2 lg:mt-0 text-gray-900 dark:text-gray-100'- >- <ChevronLeftIcon className='w-4 h-4' />- {t('project.backToFunnels')}- </button>- )}- </>- )}- {(activeTab === PROJECT_TABS.alerts && (isSharedProject || !project?.isOwner || !authenticated)) && (+ {activeTab === PROJECT_TABS.funnels && (+ <button+ onClick={() => setActiveFunnel(null)}+ className='flex items-center text-base font-normal underline decoration-dashed hover:decoration-solid mb-4 mx-auto lg:mx-0 mt-2 lg:mt-0 text-gray-900 dark:text-gray-100'+ >+ <ChevronLeftIcon className='w-4 h-4' />+ {t('project.backToFunnels')}+ </button>+ )}+ </>+ )}+ {activeTab === PROJECT_TABS.alerts && (isSharedProject || !project?.isOwner || !authenticated) && (<div className='p-5 mt-5 bg-gray-700 rounded-xl'><div className='flex items-center text-gray-50'><BellIcon className='w-8 h-8 mr-2' />- <p className='font-bold text-3xl'>- {t('dashboard.alerts')}- </p>+ <p className='font-bold text-3xl'>{t('dashboard.alerts')}</p></div>- <p className='text-lg whitespace-pre-wrap mt-2 text-gray-100'>- {t('dashboard.alertsDesc')}- </p>- <Link to={routes.signup} className='inline-block select-none mt-6 bg-white py-2 px-3 border border-transparent rounded-md text-base font-medium text-gray-700 hover:bg-indigo-50' aria-label={t('titles.signup')}>+ <p className='text-lg whitespace-pre-wrap mt-2 text-gray-100'>{t('dashboard.alertsDesc')}</p>+ <Link+ to={routes.signup}+ className='inline-block select-none mt-6 bg-white py-2 px-3 border border-transparent rounded-md text-base font-medium text-gray-700 hover:bg-indigo-50'+ aria-label={t('titles.signup')}+ >{t('common.getStarted')}</Link></div>)}- {(activeTab === PROJECT_TABS.funnels && !activeFunnel && !_isEmpty(project.funnels) && (+ {activeTab === PROJECT_TABS.funnels && !activeFunnel && !_isEmpty(project.funnels) && (<FunnelsListopenFunnelSettings={(funnel?: IFunnel) => {if (funnel) {@@ -2802,18 +3255,14 @@ const ViewProject = ({loading={funnelActionLoading}authenticated={authenticated}/>- ))}- {(activeTab === PROJECT_TABS.funnels && !activeFunnel && _isEmpty(project.funnels) && (+ )}+ {activeTab === PROJECT_TABS.funnels && !activeFunnel && _isEmpty(project.funnels) && (<div className='p-5 mt-5 bg-gray-700 rounded-xl'><div className='flex items-center text-gray-50'><FunnelIcon className='w-8 h-8 mr-2' />- <p className='font-bold text-3xl'>- {t('dashboard.funnels')}- </p>+ <p className='font-bold text-3xl'>{t('dashboard.funnels')}</p></div>- <p className='text-lg whitespace-pre-wrap mt-2 text-gray-100'>- {t('dashboard.funnelsDesc')}- </p>+ <p className='text-lg whitespace-pre-wrap mt-2 text-gray-100'>{t('dashboard.funnelsDesc')}</p>{authenticated ? (<buttontype='button'@@ -2823,12 +3272,16 @@ const ViewProject = ({{t('dashboard.newFunnel')}</button>) : (- <Link to={routes.signup} className='inline-block select-none mt-6 bg-white py-2 px-3 border border-transparent rounded-md text-base font-medium text-gray-700 hover:bg-indigo-50' aria-label={t('titles.signup')}>+ <Link+ to={routes.signup}+ className='inline-block select-none mt-6 bg-white py-2 px-3 border border-transparent rounded-md text-base font-medium text-gray-700 hover:bg-indigo-50'+ aria-label={t('titles.signup')}+ >{t('common.getStarted')}</Link>)}</div>- ))}+ )}{activeTab === PROJECT_TABS.sessions && !activeSession && (<><Filters@@ -2837,18 +3290,19 @@ const ViewProject = ({onChangeExclusive={onChangeExclusive}tnMapping={tnMapping}/>- {!sessionsLoading && _isEmpty(sessions) && (- <NoEvents filters={filters} resetFilters={resetFilters} />- )}+ {!sessionsLoading && _isEmpty(sessions) && <NoEvents filters={filters} resetFilters={resetFilters} />}<Sessions sessions={sessions} onClick={loadSession} />{canLoadMoreSessions && (<buttontype='button'title={t('project.refreshStats')}onClick={() => loadSessions()}- className={cx('flex items-center mx-auto mt-2 text-gray-700 dark:text-gray-50 relative rounded-md p-2 bg-gray-50 text-sm font-medium hover:bg-white hover:shadow-sm dark:bg-slate-900 dark:hover:bg-slate-800 focus:z-10 focus:outline-none focus:ring-1 focus:ring-indigo-500 focus:border-indigo-500 focus:dark:ring-gray-200 focus:dark:border-gray-200', {- 'cursor-not-allowed opacity-50': sessionsLoading,- })}+ className={cx(+ 'flex items-center mx-auto mt-2 text-gray-700 dark:text-gray-50 relative rounded-md p-2 bg-gray-50 text-sm font-medium hover:bg-white hover:shadow-sm dark:bg-slate-900 dark:hover:bg-slate-800 focus:z-10 focus:outline-none focus:ring-1 focus:ring-indigo-500 focus:border-indigo-500 focus:dark:ring-gray-200 focus:dark:border-gray-200',+ {+ 'cursor-not-allowed opacity-50': sessionsLoading,+ },+ )}><ArrowDownTrayIcon className='w-5 h-5 mr-2' />{t('project.loadMore')}@@ -2889,22 +3343,26 @@ const ViewProject = ({<Pageflow pages={activeSession?.pages} /></>)}- {(activeTab === PROJECT_TABS.alerts && !isSharedProject && project?.isOwner && authenticated) && (+ {activeTab === PROJECT_TABS.alerts && !isSharedProject && project?.isOwner && authenticated && (<ProjectAlertsView projectId={id} />)}{analyticsLoading && (activeTab === PROJECT_TABS.traffic || activeTab === PROJECT_TABS.performance) && (<Loader />)}- {(isPanelsDataEmpty && activeTab === PROJECT_TABS.traffic) && (+ {isPanelsDataEmpty && activeTab === PROJECT_TABS.traffic && (<NoEvents filters={filters} resetFilters={resetFilters} />)}- {(isPanelsDataEmptyPerf && activeTab === PROJECT_TABS.performance) && (+ {isPanelsDataEmptyPerf && activeTab === PROJECT_TABS.performance && (<NoEvents filters={filtersPerf} resetFilters={resetFilters} />)}{activeTab === PROJECT_TABS.traffic && (<div className={cx('pt-2', { hidden: isPanelsDataEmpty || analyticsLoading })}>{!_isEmpty(overall) && (- <MetricCards overall={overall} overallCompare={overallCompare} activePeriodCompare={activePeriodCompare} />+ <MetricCards+ overall={overall}+ overallCompare={overallCompare}+ activePeriodCompare={activePeriodCompare}+ />)}<divclassName={cx('h-80', {@@ -2928,61 +3386,62 @@ const ViewProject = ({</div>)}<div className='mt-5 grid grid-cols-1 gap-5 sm:grid-cols-2 lg:grid-cols-3'>- {!_isEmpty(panelsData.types) && _map(TRAFFIC_PANELS_ORDER, (type: keyof typeof tnMapping) => {- const panelName = tnMapping[type]- // @ts-ignore- const panelIcon = panelIconMapping[type]- const customTabs = _filter(customPanelTabs, tab => tab.panelID === type)+ {!_isEmpty(panelsData.types) &&+ _map(TRAFFIC_PANELS_ORDER, (type: keyof typeof tnMapping) => {+ const panelName = tnMapping[type]+ // @ts-ignore+ const panelIcon = panelIconMapping[type]+ const customTabs = _filter(customPanelTabs, (tab) => tab.panelID === type)- if (type === 'cc') {- const ccPanelName = tnMapping[countryActiveTab]+ if (type === 'cc') {+ const ccPanelName = tnMapping[countryActiveTab]- const rowMapper = (entry: ICountryEntry) => {- const { name: entryName, cc } = entry+ const rowMapper = (entry: ICountryEntry) => {+ const { name: entryName, cc } = entry- if (cc) {- return (- <CCRow cc={cc} name={entryName} language={language} />- )+ if (cc) {+ return <CCRow cc={cc} name={entryName} language={language} />+ }++ return <CCRow cc={entryName} language={language} />}return (- <CCRow cc={entryName} language={language} />+ <Panel+ projectPassword={projectPassword}+ t={t}+ key={countryActiveTab}+ icon={panelIcon}+ id={countryActiveTab}+ onFilter={filterHandler}+ activeTab={activeTab}+ name={<CountryDropdown onSelect={setCountryActiveTab} title={ccPanelName} />}+ data={panelsData.data[countryActiveTab]}+ customTabs={customTabs}+ rowMapper={rowMapper}+ />)}- return (- <Panel- projectPassword={projectPassword}- t={t}- key={countryActiveTab}- icon={panelIcon}- id={countryActiveTab}- onFilter={filterHandler}- activeTab={activeTab}- name={(- <CountryDropdown- onSelect={setCountryActiveTab}- title={ccPanelName}- />- )}- data={panelsData.data[countryActiveTab]}- customTabs={customTabs}- rowMapper={rowMapper}- />- )- }+ if (type === 'br') {+ const rowMapper = (entry: any) => {+ const { name: entryName } = entry+ // @ts-ignore+ const logoUrl = BROWSER_LOGO_MAP[entryName]- if (type === 'br') {- const rowMapper = (entry: any) => {- const { name: entryName } = entry- // @ts-ignore- const logoUrl = BROWSER_LOGO_MAP[entryName]+ if (!logoUrl) {+ return (+ <>+ <GlobeAltIcon className='w-5 h-5' />+ + {entryName}+ </>+ )+ }- if (!logoUrl) {return (<>- <GlobeAltIcon className='w-5 h-5' />+ <img src={logoUrl} className='w-5 h-5' alt='' /> {entryName}</>@@ -2990,146 +3449,170 @@ const ViewProject = ({}return (- <>- <img src={logoUrl} className='w-5 h-5' alt='' />- - {entryName}- </>+ <Panel+ projectPassword={projectPassword}+ t={t}+ key={type}+ icon={panelIcon}+ id={type}+ activeTab={activeTab}+ onFilter={filterHandler}+ name={panelName}+ data={panelsData.data[type]}+ customTabs={customTabs}+ rowMapper={rowMapper}+ />)}- return (- <Panel- projectPassword={projectPassword}- t={t}- key={type}- icon={panelIcon}- id={type}- activeTab={activeTab}- onFilter={filterHandler}- name={panelName}- data={panelsData.data[type]}- customTabs={customTabs}- rowMapper={rowMapper}- />- )- }+ if (type === 'os') {+ const rowMapper = (entry: any) => {+ const { name: entryName } = entry+ // @ts-ignore+ const logoPathLight = OS_LOGO_MAP[entryName]+ // @ts-ignore+ const logoPathDark = OS_LOGO_MAP_DARK[entryName]- if (type === 'os') {- const rowMapper = (entry: any) => {- const { name: entryName } = entry- // @ts-ignore- const logoPathLight = OS_LOGO_MAP[entryName]- // @ts-ignore- const logoPathDark = OS_LOGO_MAP_DARK[entryName]+ let logoPath = _theme === 'dark' ? logoPathDark : logoPathLight+ logoPath ||= logoPathLight- let logoPath = _theme === 'dark' ? logoPathDark : logoPathLight- logoPath ||= logoPathLight+ if (!logoPath) {+ return (+ <>+ <GlobeAltIcon className='w-5 h-5' />+ + {entryName}+ </>+ )+ }++ const logoUrl = `/${logoPath}`- if (!logoPath) {return (<>- <GlobeAltIcon className='w-5 h-5' />+ <img src={logoUrl} className='w-5 h-5 dark:fill-gray-50' alt='' /> {entryName}</>)}- const logoUrl = `/${logoPath}`+ return (+ <Panel+ projectPassword={projectPassword}+ t={t}+ key={type}+ icon={panelIcon}+ id={type}+ activeTab={activeTab}+ onFilter={filterHandler}+ name={panelName}+ data={panelsData.data[type]}+ customTabs={customTabs}+ rowMapper={rowMapper}+ />+ )+ }+ if (type === 'dv') {return (- <>- <img src={logoUrl} className='w-5 h-5 dark:fill-gray-50' alt='' />- - {entryName}- </>+ <Panel+ projectPassword={projectPassword}+ t={t}+ key={type}+ activeTab={activeTab}+ icon={panelIcon}+ id={type}+ onFilter={filterHandler}+ name={panelName}+ data={panelsData.data[type]}+ customTabs={customTabs}+ capitalize+ />)}- return (- <Panel- projectPassword={projectPassword}- t={t}- key={type}- icon={panelIcon}- id={type}- activeTab={activeTab}- onFilter={filterHandler}- name={panelName}- data={panelsData.data[type]}- customTabs={customTabs}- rowMapper={rowMapper}- />- )- }+ if (type === 'ref') {+ return (+ <Panel+ projectPassword={projectPassword}+ t={t}+ key={type}+ icon={panelIcon}+ id={type}+ onFilter={filterHandler}+ name={panelName}+ activeTab={activeTab}+ data={panelsData.data[type]}+ customTabs={customTabs}+ // @ts-ignore+ rowMapper={({ name: entryName }) => <RefRow rowName={entryName} showIcons={showIcons} />}+ />+ )+ }- if (type === 'dv') {- return (- <Panel- projectPassword={projectPassword}- t={t}- key={type}- activeTab={activeTab}- icon={panelIcon}- id={type}- onFilter={filterHandler}- name={panelName}- data={panelsData.data[type]}- customTabs={customTabs}- capitalize- />- )- }+ if (type === 'so') {+ const ccPanelName = tnMapping[utmActiveTab]- if (type === 'ref') {- return (- <Panel- projectPassword={projectPassword}- t={t}- key={type}- icon={panelIcon}- id={type}- onFilter={filterHandler}- name={panelName}- activeTab={activeTab}- data={panelsData.data[type]}- customTabs={customTabs}- // @ts-ignore- rowMapper={({ name: entryName }) => (- <RefRow rowName={entryName} showIcons={showIcons} />- )}- />- )- }+ return (+ <Panel+ projectPassword={projectPassword}+ t={t}+ key={utmActiveTab}+ icon={panelIcon}+ id={utmActiveTab}+ activeTab={activeTab}+ onFilter={filterHandler}+ name={<UTMDropdown onSelect={setUtmActiveTab} title={ccPanelName} />}+ data={panelsData.data[utmActiveTab]}+ customTabs={customTabs}+ // @ts-ignore+ rowMapper={({ name: entryName }) => decodeURIComponent(entryName)}+ />+ )+ }- if (type === 'so') {- const ccPanelName = tnMapping[utmActiveTab]+ if (type === 'pg') {+ return (+ <Panel+ projectPassword={projectPassword}+ t={t}+ key={type}+ icon={panelIcon}+ id={type}+ onFilter={filterHandler}+ onFragmentChange={setPgActiveFragment}+ // @ts-ignore+ rowMapper={({ name: entryName }) => {+ if (!entryName) {+ return _toUpper(t('project.redactedPage'))+ }- return (- <Panel- projectPassword={projectPassword}- t={t}- key={utmActiveTab}- icon={panelIcon}- id={utmActiveTab}- activeTab={activeTab}- onFilter={filterHandler}- name={(- <UTMDropdown- onSelect={setUtmActiveTab}- title={ccPanelName}- />- )}- data={panelsData.data[utmActiveTab]}- customTabs={customTabs}- // @ts-ignore- rowMapper={({ name: entryName }) => decodeURIComponent(entryName)}- />- )- }+ let decodedUri = entryName as string++ try {+ decodedUri = decodeURIComponent(entryName)+ } catch (_) {+ // do nothing+ }++ return decodedUri+ }}+ name={pgPanelNameMapping[pgActiveFragment]}+ data={panelsData.data[type]}+ customTabs={customTabs}+ period={period}+ activeTab={activeTab}+ pid={id}+ timeBucket={timeBucket}+ filters={filters}+ from={dateRange ? getFormatDate(dateRange[0]) : null}+ to={dateRange ? getFormatDate(dateRange[1]) : null}+ timezone={timezone}+ />+ )+ }- if (type === 'pg') {return (<PanelprojectPassword={projectPassword}@@ -3137,61 +3620,21 @@ const ViewProject = ({key={type}icon={panelIcon}id={type}+ activeTab={activeTab}onFilter={filterHandler}- onFragmentChange={setPgActiveFragment}- // @ts-ignore- rowMapper={({ name: entryName }) => {- if (!entryName) {- return _toUpper(t('project.redactedPage'))- }-- let decodedUri = entryName as string-- try {- decodedUri = decodeURIComponent(entryName)- } catch (_) {- // do nothing- }-- return decodedUri- }}- name={pgPanelNameMapping[pgActiveFragment]}+ name={panelName}data={panelsData.data[type]}customTabs={customTabs}- period={period}- activeTab={activeTab}- pid={id}- timeBucket={timeBucket}- filters={filters}- from={dateRange ? getFormatDate(dateRange[0]) : null}- to={dateRange ? getFormatDate(dateRange[1]) : null}- timezone={timezone}/>)- }-- return (- <Panel- projectPassword={projectPassword}- t={t}- key={type}- icon={panelIcon}- id={type}- activeTab={activeTab}- onFilter={filterHandler}- name={panelName}- data={panelsData.data[type]}- customTabs={customTabs}- />- )- })}+ })}{!_isEmpty(panelsData.customs) && (<CustomEventst={t}customs={panelsData.customs}onFilter={filterHandler}chartData={chartData}- customTabs={_filter(customPanelTabs, tab => tab.panelID === 'ce')}+ customTabs={_filter(customPanelTabs, (tab) => tab.panelID === 'ce')}getCustomEventMetadata={getCustomEventMetadata}/>)}@@ -3201,7 +3644,11 @@ const ViewProject = ({{activeTab === PROJECT_TABS.performance && (<div className={cx('pt-8 md:pt-4', { hidden: isPanelsDataEmptyPerf || analyticsLoading })}>{!_isEmpty(overallPerformance) && (- <PerformanceMetricCards overall={overallPerformance} overallCompare={overallPerformanceCompare} activePeriodCompare={activePeriodCompare} />+ <PerformanceMetricCards+ overall={overallPerformance}+ overallCompare={overallPerformanceCompare}+ activePeriodCompare={activePeriodCompare}+ />)}<divclassName={cx('h-80', {@@ -3225,107 +3672,108 @@ const ViewProject = ({</div>)}<div className='mt-5 grid grid-cols-1 gap-5 sm:grid-cols-2 lg:grid-cols-3'>- {!_isEmpty(panelsDataPerf.types) && _map(PERFORMANCE_PANELS_ORDER, (type: keyof typeof tnMapping) => {- const panelName = tnMapping[type]- // @ts-ignore- const panelIcon = panelIconMapping[type]- const customTabs = _filter(customPanelTabs, tab => tab.panelID === type)+ {!_isEmpty(panelsDataPerf.types) &&+ _map(PERFORMANCE_PANELS_ORDER, (type: keyof typeof tnMapping) => {+ const panelName = tnMapping[type]+ // @ts-ignore+ const panelIcon = panelIconMapping[type]+ const customTabs = _filter(customPanelTabs, (tab) => tab.panelID === type)- if (type === 'cc') {- const ccPanelName = tnMapping[countryActiveTab]+ if (type === 'cc') {+ const ccPanelName = tnMapping[countryActiveTab]- const rowMapper = (entry: ICountryEntry) => {- const { name: entryName, cc } = entry+ const rowMapper = (entry: ICountryEntry) => {+ const { name: entryName, cc } = entry- if (cc) {- return (- <CCRow cc={cc} name={entryName} language={language} />- )+ if (cc) {+ return <CCRow cc={cc} name={entryName} language={language} />+ }++ return <CCRow cc={entryName} language={language} />}return (- <CCRow cc={entryName} language={language} />+ <Panel+ projectPassword={projectPassword}+ t={t}+ key={countryActiveTab}+ icon={panelIcon}+ id={countryActiveTab}+ onFilter={filterHandler}+ name={<CountryDropdown onSelect={setCountryActiveTab} title={ccPanelName} />}+ activeTab={activeTab}+ data={panelsDataPerf.data[countryActiveTab]}+ customTabs={customTabs}+ rowMapper={rowMapper}+ // @ts-ignore+ valueMapper={(value) => getStringFromTime(getTimeFromSeconds(value), true)}+ />)}- return (- <Panel- projectPassword={projectPassword}- t={t}- key={countryActiveTab}- icon={panelIcon}- id={countryActiveTab}- onFilter={filterHandler}- name={(- <CountryDropdown- onSelect={setCountryActiveTab}- title={ccPanelName}- />- )}- activeTab={activeTab}- data={panelsDataPerf.data[countryActiveTab]}- customTabs={customTabs}- rowMapper={rowMapper}- // @ts-ignore- valueMapper={(value) => getStringFromTime(getTimeFromSeconds(value), true)}- />- )- }+ if (type === 'dv') {+ return (+ <Panel+ projectPassword={projectPassword}+ t={t}+ key={type}+ icon={panelIcon}+ id={type}+ onFilter={filterHandler}+ name={panelName}+ activeTab={activeTab}+ data={panelsDataPerf.data[type]}+ customTabs={customTabs}+ // @ts-ignore+ valueMapper={(value) => getStringFromTime(getTimeFromSeconds(value), true)}+ capitalize+ />+ )+ }- if (type === 'dv') {- return (- <Panel- projectPassword={projectPassword}- t={t}- key={type}- icon={panelIcon}- id={type}- onFilter={filterHandler}- name={panelName}- activeTab={activeTab}- data={panelsDataPerf.data[type]}- customTabs={customTabs}- // @ts-ignore- valueMapper={(value) => getStringFromTime(getTimeFromSeconds(value), true)}- capitalize- />- )- }+ if (type === 'pg') {+ return (+ <Panel+ projectPassword={projectPassword}+ t={t}+ key={type}+ icon={panelIcon}+ id={type}+ activeTab={activeTab}+ onFilter={filterHandler}+ name={panelName}+ data={panelsDataPerf.data[type]}+ customTabs={customTabs}+ // @ts-ignore+ valueMapper={(value) => getStringFromTime(getTimeFromSeconds(value), true)}+ // @ts-ignore+ rowMapper={({ name: entryName }) => {+ // todo: add uppercase+ return entryName || t('project.redactedPage')+ }}+ />+ )+ }- if (type === 'pg') {- return (- <Panel- projectPassword={projectPassword}- t={t}- key={type}- icon={panelIcon}- id={type}- activeTab={activeTab}- onFilter={filterHandler}- name={panelName}- data={panelsDataPerf.data[type]}- customTabs={customTabs}+ if (type === 'br') {+ const rowMapper = (entry: any) => {+ const { name: entryName } = entry// @ts-ignore- valueMapper={(value) => getStringFromTime(getTimeFromSeconds(value), true)}- // @ts-ignore- rowMapper={({ name: entryName }) => {- // todo: add uppercase- return entryName || t('project.redactedPage')- }}- />- )- }+ const logoUrl = BROWSER_LOGO_MAP[entryName]- if (type === 'br') {- const rowMapper = (entry: any) => {- const { name: entryName } = entry- // @ts-ignore- const logoUrl = BROWSER_LOGO_MAP[entryName]+ if (!logoUrl) {+ return (+ <>+ <GlobeAltIcon className='w-5 h-5' />+ + {entryName}+ </>+ )+ }- if (!logoUrl) {return (<>- <GlobeAltIcon className='w-5 h-5' />+ <img src={logoUrl} className='w-5 h-5' alt='' /> {entryName}</>@@ -3333,11 +3781,21 @@ const ViewProject = ({}return (- <>- <img src={logoUrl} className='w-5 h-5' alt='' />- - {entryName}- </>+ <Panel+ projectPassword={projectPassword}+ t={t}+ key={type}+ icon={panelIcon}+ id={type}+ activeTab={activeTab}+ onFilter={filterHandler}+ name={panelName}+ data={panelsDataPerf.data[type]}+ customTabs={customTabs}+ // @ts-ignore+ valueMapper={(value) => getStringFromTime(getTimeFromSeconds(value), true)}+ rowMapper={rowMapper}+ />)}@@ -3355,28 +3813,9 @@ const ViewProject = ({customTabs={customTabs}// @ts-ignorevalueMapper={(value) => getStringFromTime(getTimeFromSeconds(value), true)}- rowMapper={rowMapper}/>)- }-- return (- <Panel- projectPassword={projectPassword}- t={t}- key={type}- icon={panelIcon}- id={type}- activeTab={activeTab}- onFilter={filterHandler}- name={panelName}- data={panelsDataPerf.data[type]}- customTabs={customTabs}- // @ts-ignore- valueMapper={(value) => getStringFromTime(getTimeFromSeconds(value), true)}- />- )- })}+ })}</div></div>)}@@ -3431,25 +3870,22 @@ const ViewProject = ({setProjectFilter={onFilterSearch}pid={id}tnMapping={tnMapping}- filters={activeTab === PROJECT_TABS.performance- ? filtersPerf- : activeTab === PROJECT_TABS.sessions- ? filtersSessions- : filters+ filters={+ activeTab === PROJECT_TABS.performance+ ? filtersPerf+ : activeTab === PROJECT_TABS.sessions+ ? filtersSessions+ : filters}/>- {!embedded && (- <Footer authenticated={authenticated} minimal />- )}+ {!embedded && <Footer authenticated={authenticated} minimal />}</>)}return (<>- {!embedded && (- <Header ssrTheme={ssrTheme} authenticated={authenticated} />- )}+ {!embedded && <Header ssrTheme={ssrTheme} authenticated={authenticated} />}<divclassName={cx('min-h-min-footer bg-gray-50 dark:bg-slate-900', {'min-h-min-footer': !embedded,@@ -3458,9 +3894,7 @@ const ViewProject = ({><Loader /></div>- {!embedded && (- <Footer authenticated={authenticated} minimal />- )}+ {!embedded && <Footer authenticated={authenticated} minimal />}</>)}diff --git a/app/pages/Project/View/components/CCRow.tsx b/app/pages/Project/View/components/CCRow.tsxindex 4a028839e..b8f46d0ae 100644--- a/app/pages/Project/View/components/CCRow.tsx+++ b/app/pages/Project/View/components/CCRow.tsx@@ -21,13 +21,7 @@ interface ICCRow {*/const CCRow = ({ cc, name, language, size = 21, spaces = 2 }: ICCRow): JSX.Element => (<>- <Flag- className='rounded-sm'- country={cc}- size={size}- alt=''- aria-hidden='true'- />+ <Flag className='rounded-sm' country={cc} size={size} alt='' aria-hidden='true' /><spandangerouslySetInnerHTML={{__html: _fill(Array(spaces), ' ').join(''),diff --git a/app/pages/Project/View/components/CountryDropdown.tsx b/app/pages/Project/View/components/CountryDropdown.tsxindex c35cc365b..9fe2d3e02 100644--- a/app/pages/Project/View/components/CountryDropdown.tsx+++ b/app/pages/Project/View/components/CountryDropdown.tsx@@ -3,12 +3,10 @@ import _map from 'lodash/map'import { useTranslation } from 'react-i18next'// @ts-ignoreimport OutsideClickHandler from 'react-outside-click-handler'-import {- ChevronDownIcon, ChevronUpIcon, XMarkIcon,-} from '@heroicons/react/24/outline'+import { ChevronDownIcon, ChevronUpIcon, XMarkIcon } from '@heroicons/react/24/outline'interface ICountryDropdown {- onSelect: any,+ onSelect: anytitle: string}@@ -37,20 +35,14 @@ const CountryDropdown = ({ onSelect, title }: ICountryDropdown): JSX.Element =>}return (- <OutsideClickHandler- onOutsideClick={() => setShow(false)}- >+ <OutsideClickHandler onOutsideClick={() => setShow(false)}><span className='cursor-pointer' onClick={() => setShow(!show)}>- {title}- {' '}- {show ? <ChevronUpIcon className='inline w-4 h-4' /> : <ChevronDownIcon className='inline w-4 h-4' />}+ {title} {show ? <ChevronUpIcon className='inline w-4 h-4' /> : <ChevronDownIcon className='inline w-4 h-4' />}</span>{show && (<div className='absolute z-10 mt-2 left-5 top-15 text-gray-900 bg-white border border-gray-200 rounded-md shadow-lg dark:bg-slate-900 dark:border-slate-700/50 min-w-[250px] max-h-[200px] overflow-auto'><div className='flex flex-col w-full p-2'>- <p className='text-sm font-semibold text-gray-900 dark:text-gray-50 px-1'>- {t('project.geo')}- </p>+ <p className='text-sm font-semibold text-gray-900 dark:text-gray-50 px-1'>{t('project.geo')}</p>{_map(OPTIONS, ({ label, value }) => (<divkey={label}@@ -61,7 +53,10 @@ const CountryDropdown = ({ onSelect, title }: ICountryDropdown): JSX.Element =></div>))}</div>- <XMarkIcon className='absolute top-2 right-2 w-5 h-5 text-gray-900 cursor-pointer dark:text-gray-50' onClick={() => setShow(!show)} />+ <XMarkIcon+ className='absolute top-2 right-2 w-5 h-5 text-gray-900 cursor-pointer dark:text-gray-50'+ onClick={() => setShow(!show)}+ /></div>)}</OutsideClickHandler>diff --git a/app/pages/Project/View/components/Filters.tsx b/app/pages/Project/View/components/Filters.tsxindex 39ba27c46..bf860d238 100644--- a/app/pages/Project/View/components/Filters.tsx+++ b/app/pages/Project/View/components/Filters.tsx@@ -27,7 +27,16 @@ interface IFilter {* @returns {JSX.Element}*/export const Filter = ({- column, filter, isExclusive, onRemoveFilter, onChangeExclusive, tnMapping, language, t, canChangeExclusive, removable,+ column,+ filter,+ isExclusive,+ onRemoveFilter,+ onChangeExclusive,+ tnMapping,+ language,+ t,+ canChangeExclusive,+ removable,}: IFilter): JSX.Element => {const displayColumn = tnMapping[column]let displayFilter = filter@@ -45,23 +54,26 @@ export const Filter = ({return (<spantitle={truncatedFilter === displayFilter ? undefined : displayFilter}- className={cx('inline-flex rounded-md items-center py-0.5 pl-2.5 pr-1 mr-2 mt-2 text-sm font-medium bg-gray-200 text-gray-800 dark:text-gray-50 dark:bg-slate-800', {- 'pr-2': !removable,- })}+ className={cx(+ 'inline-flex rounded-md items-center py-0.5 pl-2.5 pr-1 mr-2 mt-2 text-sm font-medium bg-gray-200 text-gray-800 dark:text-gray-50 dark:bg-slate-800',+ {+ 'pr-2': !removable,+ },+ )}>{displayColumn} {canChangeExclusive ? (- <span className='text-blue-400 border-blue-400 border-b-2 border-dotted cursor-pointer' onClick={() => onChangeExclusive(column, filter, !isExclusive)}>+ <span+ className='text-blue-400 border-blue-400 border-b-2 border-dotted cursor-pointer'+ onClick={() => onChangeExclusive(column, filter, !isExclusive)}+ >{t(`common.${isExclusive ? 'isNot' : 'is'}`)}</span>) : (- <span>- {t(`common.${isExclusive ? 'isNot' : 'is'}`)}- </span>+ <span>{t(`common.${isExclusive ? 'isNot' : 'is'}`)}</span>)}- - "+ "{truncatedFilter}"{removable && (@@ -102,10 +114,11 @@ interface IFilters {* @param {object} tnMapping - Mapping of column names to translated names.* @returns {JSX.Element}*/-export const Filters = ({- filters, onRemoveFilter, onChangeExclusive, tnMapping,-}: IFilters) => {- const { t, i18n: { language } } = useTranslation('common')+export const Filters = ({ filters, onRemoveFilter, onChangeExclusive, tnMapping }: IFilters) => {+ const {+ t,+ i18n: { language },+ } = useTranslation('common')return (<div className='flex justify-center md:justify-start flex-wrap -mt-2'>@@ -132,11 +145,13 @@ export const Filters = ({}Filters.propTypes = {- filters: PropTypes.arrayOf(PropTypes.shape({- column: PropTypes.string,- filter: PropTypes.string,- isExclusive: PropTypes.bool,- })),+ filters: PropTypes.arrayOf(+ PropTypes.shape({+ column: PropTypes.string,+ filter: PropTypes.string,+ isExclusive: PropTypes.bool,+ }),+ ),onRemoveFilter: PropTypes.func.isRequired,onChangeExclusive: PropTypes.func.isRequired,tnMapping: PropTypes.objectOf(PropTypes.string).isRequired,diff --git a/app/pages/Project/View/components/FunnelsList.tsx b/app/pages/Project/View/components/FunnelsList.tsxindex 4f07461c7..89fa1ccc4 100644--- a/app/pages/Project/View/components/FunnelsList.tsx+++ b/app/pages/Project/View/components/FunnelsList.tsx@@ -2,9 +2,7 @@ import React from 'react'import _map from 'lodash/map'import cx from 'clsx'import { useTranslation } from 'react-i18next'-import {- AdjustmentsVerticalIcon, PlusCircleIcon, TrashIcon,-} from '@heroicons/react/24/outline'+import { AdjustmentsVerticalIcon, PlusCircleIcon, TrashIcon } from '@heroicons/react/24/outline'import { IFunnel } from 'redux/models/IProject'interface IFunnelsList {@@ -28,9 +26,7 @@ interface IAddFunnel {openFunnelSettings: (funnel?: IFunnel) => void}-const FunnelCard = ({- funnel, openFunnelSettings, openFunnel, deleteFunnel, loading,-}: IFunnelCard): JSX.Element => {+const FunnelCard = ({ funnel, openFunnelSettings, openFunnel, deleteFunnel, loading }: IFunnelCard): JSX.Element => {const { t } = useTranslation()return (@@ -40,12 +36,8 @@ const FunnelCard = ({><div className='py-4 px-4'><div className='flex justify-between items-center'>- <p className='text-lg font-semibold text-slate-900 dark:text-gray-50 truncate'>- {funnel.name}- </p>- <div- className='flex items-center gap-2'- >+ <p className='text-lg font-semibold text-slate-900 dark:text-gray-50 truncate'>{funnel.name}</p>+ <div className='flex items-center gap-2'><buttontype='button'onClick={(e) => {@@ -82,7 +74,10 @@ const AddFunnel = ({ openFunnelSettings }: IAddFunnel): JSX.Element => {}return (- <li onClick={onClick} className='flex cursor-pointer justify-center items-center rounded-lg border-2 border-dashed h-auto min-h-[120px] group border-gray-300 hover:border-gray-400'>+ <li+ onClick={onClick}+ className='flex cursor-pointer justify-center items-center rounded-lg border-2 border-dashed h-auto min-h-[120px] group border-gray-300 hover:border-gray-400'+ ><div><PlusCircleIcon className='mx-auto h-12 w-12 text-gray-400 dark:text-gray-200 group-hover:text-gray-500 group-hover:dark:text-gray-400' /><span className='mt-2 block text-sm font-semibold text-gray-900 dark:text-gray-50 group-hover:dark:text-gray-400'>@@ -100,7 +95,12 @@ const AddFunnel = ({ openFunnelSettings }: IAddFunnel): JSX.Element => {* @returns {JSX.Element}*/const FunnelsList = ({- funnels, openFunnelSettings, openFunnel, deleteFunnel, loading, authenticated,+ funnels,+ openFunnelSettings,+ openFunnel,+ deleteFunnel,+ loading,+ authenticated,}: IFunnelsList): JSX.Element => (<ul className='grid grid-cols-1 gap-x-6 gap-y-3 lg:gap-y-6 lg:grid-cols-3 mt-2'>{_map(funnels, (funnel) => (@@ -113,11 +113,7 @@ const FunnelsList = ({loading={loading}/>))}- {authenticated && (- <AddFunnel- openFunnelSettings={openFunnelSettings}- />- )}+ {authenticated && <AddFunnel openFunnelSettings={openFunnelSettings} />}</ul>)diff --git a/app/pages/Project/View/components/InteractiveMap.tsx b/app/pages/Project/View/components/InteractiveMap.tsxindex d7fc9e493..29daae437 100644--- a/app/pages/Project/View/components/InteractiveMap.tsx+++ b/app/pages/Project/View/components/InteractiveMap.tsx@@ -14,7 +14,7 @@ import countriesList from 'utils/countries'import { useSelector } from 'react-redux'interface IInteractiveMap {- data: IEntry[],+ data: IEntry[]onClickCountry: (country: string) => voidtotal: number}@@ -34,11 +34,17 @@ interface ICountryMap {}const InteractiveMap = ({ data, onClickCountry, total }: IInteractiveMap) => {- const { t, i18n: { language } } = useTranslation('common')+ const {+ t,+ i18n: { language },+ } = useTranslation('common')const [hoverShow, setHoverShow] = useState<boolean>(false)const [dataHover, setDataHover] = useState<IDataHover>({} as IDataHover)const [cursorPosition, setCursorPosition] = useState<ICursorPosition>({} as ICursorPosition)- const countryMap: ICountryMap = useMemo(() => _reduce(data, (prev, curr) => ({ ...prev, [curr.cc || curr.name]: curr.count }), {}), [data])+ const countryMap: ICountryMap = useMemo(+ () => _reduce(data, (prev, curr) => ({ ...prev, [curr.cc || curr.name]: curr.count }), {}),+ [data],+ )const projectTab = useSelector((state: StateType) => state.ui.projects.projectTab)const isTrafficTab = projectTab === PROJECT_TABS.traffic@@ -56,33 +62,36 @@ const InteractiveMap = ({ data, onClickCountry, total }: IInteractiveMap) => {<g>{_map(countriesList, (key, value) => {const ccData = countryMap[value] || 0- const perc = ((ccData / total) * 100) || 0+ const perc = (ccData / total) * 100 || 0return (<pathkey={value}id={value}- className={isTrafficTab- ? cx({- 'hover:opacity-90': perc > 0,- 'fill-[#cfd1d4] dark:fill-[#465d7e46]': perc === 0,- 'fill-[#92b2e7] dark:fill-[#292d77]': perc > 0 && perc < 3,- 'fill-[#6f9be3] dark:fill-[#363391]': perc >= 3 && perc < 10,- 'fill-[#5689db] dark:fill-[#4842be]': perc >= 10 && perc < 20,- 'fill-[#3b82f6] dark:fill-[#6357ff]': perc >= 20,- 'cursor-pointer': Boolean(ccData),- }) : cx({- 'hover:opacity-90': ccData > 0,- 'fill-[#cfd1d4] dark:fill-[#465d7e46]': ccData === 0,- 'fill-[#92b2e7] dark:fill-[#292d77]': ccData > 0 && ccData < 1,- 'fill-[#6f9be3] dark:fill-[#363391]': ccData >= 1 && ccData < 2,- 'fill-[#5689db] dark:fill-[#4842be]': ccData >= 2 && ccData < 3,- 'fill-[#3b82f6] dark:fill-[#6357ff]': ccData >= 3 && ccData < 5,- 'fill-[#f78a8a]': ccData >= 5 && ccData < 7,- 'fill-[#f76b6b]': ccData >= 7 && ccData < 10,- 'fill-[#f74b4b]': ccData >= 10,- 'cursor-pointer': Boolean(ccData),- })}+ className={+ isTrafficTab+ ? cx({+ 'hover:opacity-90': perc > 0,+ 'fill-[#cfd1d4] dark:fill-[#465d7e46]': perc === 0,+ 'fill-[#92b2e7] dark:fill-[#292d77]': perc > 0 && perc < 3,+ 'fill-[#6f9be3] dark:fill-[#363391]': perc >= 3 && perc < 10,+ 'fill-[#5689db] dark:fill-[#4842be]': perc >= 10 && perc < 20,+ 'fill-[#3b82f6] dark:fill-[#6357ff]': perc >= 20,+ 'cursor-pointer': Boolean(ccData),+ })+ : cx({+ 'hover:opacity-90': ccData > 0,+ 'fill-[#cfd1d4] dark:fill-[#465d7e46]': ccData === 0,+ 'fill-[#92b2e7] dark:fill-[#292d77]': ccData > 0 && ccData < 1,+ 'fill-[#6f9be3] dark:fill-[#363391]': ccData >= 1 && ccData < 2,+ 'fill-[#5689db] dark:fill-[#4842be]': ccData >= 2 && ccData < 3,+ 'fill-[#3b82f6] dark:fill-[#6357ff]': ccData >= 3 && ccData < 5,+ 'fill-[#f78a8a]': ccData >= 5 && ccData < 7,+ 'fill-[#f76b6b]': ccData >= 7 && ccData < 10,+ 'fill-[#f74b4b]': ccData >= 10,+ 'cursor-pointer': Boolean(ccData),+ })+ }d={key.d}onClick={() => perc !== 0 && onClickCountry(value)}onMouseEnter={() => {@@ -113,16 +122,16 @@ const InteractiveMap = ({ data, onClickCountry, total }: IInteractiveMap) => {><strong>{dataHover.countries}</strong><br />- {isTrafficTab ? t('project.unique') : t('dashboard.pageLoad')}- :- + {isTrafficTab ? t('project.unique') : t('dashboard.pageLoad')}: <strongclassName={cx({'dark:text-indigo-400': isTrafficTab || dataHover.data < 5,'dark:text-red-400': !isTrafficTab && dataHover.data >= 5,})}>- {isTrafficTab ? nFormatter(dataHover.data, 1) : getStringFromTime(getTimeFromSeconds(dataHover.data), true)}+ {isTrafficTab+ ? nFormatter(dataHover.data, 1)+ : getStringFromTime(getTimeFromSeconds(dataHover.data), true)}</strong></div>)}@@ -133,15 +142,17 @@ const InteractiveMap = ({ data, onClickCountry, total }: IInteractiveMap) => {InteractiveMap.propTypes = {onClickCountry: PropTypes.func,- data: PropTypes.arrayOf(PropTypes.shape({- name: PropTypes.string,- count: PropTypes.number,- })),+ data: PropTypes.arrayOf(+ PropTypes.shape({+ name: PropTypes.string,+ count: PropTypes.number,+ }),+ ),total: PropTypes.number,}InteractiveMap.defaultProps = {- onClickCountry: () => { },+ onClickCountry: () => {},data: [],total: 0,}diff --git a/app/pages/Project/View/components/LiveVisitorsDropdown.tsx b/app/pages/Project/View/components/LiveVisitorsDropdown.tsxindex c24aec144..7adb910ca 100644--- a/app/pages/Project/View/components/LiveVisitorsDropdown.tsx+++ b/app/pages/Project/View/components/LiveVisitorsDropdown.tsx@@ -3,18 +3,20 @@ import _map from 'lodash/map'import { useTranslation } from 'react-i18next'// @ts-ignoreimport OutsideClickHandler from 'react-outside-click-handler'-import {- ChevronDownIcon, ChevronUpIcon, XMarkIcon,-} from '@heroicons/react/24/outline'+import { ChevronDownIcon, ChevronUpIcon, XMarkIcon } from '@heroicons/react/24/outline'import Flag from 'react-flagkit'import { getLiveVisitorsInfo, IGetLiveVisitorsInfo } from 'api'import PulsatingCircle from 'ui/icons/PulsatingCircle'-const LiveVisitorsDropdown = ({ live, projectId, projectPassword }: {- live: number | string,- projectId: string,- projectPassword?: string,+const LiveVisitorsDropdown = ({+ live,+ projectId,+ projectPassword,+}: {+ live: number | string+ projectId: string+ projectPassword?: string}): JSX.Element => {const { t } = useTranslation()const [show, setShow] = useState<boolean>(false)@@ -41,51 +43,47 @@ const LiveVisitorsDropdown = ({ live, projectId, projectPassword }: {}, [show]) // eslint-disable-line react-hooks/exhaustive-depsreturn (- <OutsideClickHandler- onOutsideClick={() => setShow(false)}- >- <p className='relative flex items-center h-5 text-gray-900 dark:text-gray-50 text-base cursor-pointer' onClick={() => setShow(!show)}>+ <OutsideClickHandler onOutsideClick={() => setShow(false)}>+ <p+ className='relative flex items-center h-5 text-gray-900 dark:text-gray-50 text-base cursor-pointer'+ onClick={() => setShow(!show)}+ ><PulsatingCircle className='mr-1.5' type='small' />{t('dashboard.xLiveVisitors', {amount: live || 0,- })}- {' '}+ })}{' '}{show ? <ChevronUpIcon className='inline w-4 h-4 ml-1' /> : <ChevronDownIcon className='inline w-4 h-4 ml-1' />}{show && (- <div className={`absolute z-10 mt-2 right-0 top-3 text-gray-900 bg-white border border-gray-200 rounded-md shadow-lg dark:bg-slate-900 dark:border-slate-700/50 max-h-[200px] overflow-auto ${liveInfo.length === 0 ? 'min-w-[200px]' : 'min-w-max'}`} >+ <div+ className={`absolute z-10 mt-2 right-0 top-3 text-gray-900 bg-white border border-gray-200 rounded-md shadow-lg dark:bg-slate-900 dark:border-slate-700/50 max-h-[200px] overflow-auto ${+ liveInfo.length === 0 ? 'min-w-[200px]' : 'min-w-max'+ }`}+ ><div className='flex flex-col w-full p-2'>- <p className='text-sm font-semibold text-gray-900 dark:text-gray-50'>- {t('dashboard.liveVisitors')}- </p>+ <p className='text-sm font-semibold text-gray-900 dark:text-gray-50'>{t('dashboard.liveVisitors')}</p>{loading ? (- <p className='text-sm text-gray-900 dark:text-gray-50'>- {t('common.loading')}- </p>+ <p className='text-sm text-gray-900 dark:text-gray-50'>{t('common.loading')}</p>) : (- _map(liveInfo, ({- dv, br, os, cc,- }, index) => (- <div key={`${dv}${br}${os}${cc}${index}`} className='flex flex-row items-center justify-between w-full p-2 mt-2 text-sm text-gray-900 bg-gray-100 rounded-md dark:text-gray-50 dark:bg-slate-800'>+ _map(liveInfo, ({ dv, br, os, cc }, index) => (+ <div+ key={`${dv}${br}${os}${cc}${index}`}+ className='flex flex-row items-center justify-between w-full p-2 mt-2 text-sm text-gray-900 bg-gray-100 rounded-md dark:text-gray-50 dark:bg-slate-800'+ ><div className='flex flex-row items-center'>- <Flag- className='rounded-sm mr-2'- country={cc}- size={21}- alt=''- aria-hidden='true'- />+ <Flag className='rounded-sm mr-2' country={cc} size={21} alt='' aria-hidden='true' /><p className='mr-2'>{os}</p><p className='mr-2'>{br}</p><p className='mr-2 capitalize'>{dv}</p></div>- <p className='text-xs font-semibold text-green-500'>- {t('dashboard.live')}- </p>+ <p className='text-xs font-semibold text-green-500'>{t('dashboard.live')}</p></div>)))}</div>- <XMarkIcon className='absolute top-2 right-2 w-5 h-5 text-gray-900 cursor-pointer dark:text-gray-50' onClick={() => setShow(!show)} />+ <XMarkIcon+ className='absolute top-2 right-2 w-5 h-5 text-gray-900 cursor-pointer dark:text-gray-50'+ onClick={() => setShow(!show)}+ /></div>)}</p>diff --git a/app/pages/Project/View/components/MetricCards.tsx b/app/pages/Project/View/components/MetricCards.tsxindex 9253a969a..abb6ca70d 100644--- a/app/pages/Project/View/components/MetricCards.tsx+++ b/app/pages/Project/View/components/MetricCards.tsx@@ -9,9 +9,7 @@ import _isNumber from 'lodash/isNumber'import _map from 'lodash/map'import { nFormatter, getStringFromTime, getTimeFromSeconds } from 'utils/generic'import { IOverallObject } from 'redux/models/IProject'-import {- ChevronDownIcon, ChevronUpIcon, XMarkIcon,-} from '@heroicons/react/24/outline'+import { ChevronDownIcon, ChevronUpIcon, XMarkIcon } from '@heroicons/react/24/outline'import { Badge } from 'ui/Badge'interface IMetricCard {@@ -23,9 +21,7 @@ interface IMetricCard {valueMapper?: (value: any, type: 'main' | 'badge') => any}-const ChangeBadge = ({- change, type, goodChangeDirection, valueMapper,-}: Partial<IMetricCard>) => {+const ChangeBadge = ({ change, type, goodChangeDirection, valueMapper }: Partial<IMetricCard>) => {if (!_isNumber(change)) {return null}@@ -33,56 +29,31 @@ const ChangeBadge = ({if (change === 0) {const label = valueMapper ? valueMapper(change, 'badge') : `0${type === 'percent' ? '%' : ''}`- return (- <Badge- colour='slate'- label={label}- />- )+ return <Badge colour='slate' label={label} />}if (change < 0 && goodChangeDirection === 'up') {const label = valueMapper ? valueMapper(change, 'badge') : `${change}${type === 'percent' ? '%' : ''}`- return (- <Badge- colour='green'- label={label}- />- )+ return <Badge colour='green' label={label} />}if (change < 0 && goodChangeDirection === 'down') {const label = valueMapper ? valueMapper(change, 'badge') : `${change}${type === 'percent' ? '%' : ''}`- return (- <Badge- colour='red'- label={label}- />- )+ return <Badge colour='red' label={label} />}if (change > 0 && goodChangeDirection === 'up') {const label = valueMapper ? valueMapper(change, 'badge') : `${change}${type === 'percent' ? '%' : ''}`- return (- <Badge- colour='red'- label={label}- />- )+ return <Badge colour='red' label={label} />}if (change > 0 && goodChangeDirection === 'down') {const label = valueMapper ? valueMapper(change, 'badge') : `${change}${type === 'percent' ? '%' : ''}`- return (- <Badge- colour='green'- label={label}- />- )+ return <Badge colour='green' label={label} />}}@@ -96,15 +67,8 @@ export const MetricCard: React.FC<IMetricCard> = ({ label, value, change, type,'space-x-2': _isNumber(change),})}>- <span className='text-slate-900 dark:text-gray-50'>- {label}- </span>- <ChangeBadge- change={change}- type={type}- goodChangeDirection={goodChangeDirection}- valueMapper={valueMapper}- />+ <span className='text-slate-900 dark:text-gray-50'>{label}</span>+ <ChangeBadge change={change} type={type} goodChangeDirection={goodChangeDirection} valueMapper={valueMapper} /></div></div>)@@ -133,23 +97,15 @@ export const MetricCardSelect: React.FC<IMetricCardSelect> = ({ values, valueMap{valueMapper ? valueMapper(values[selected], selected) : values[selected].value}</div><div className='flex items-center font-bold whitespace-nowrap text-sm relative'>- <OutsideClickHandler- onOutsideClick={() => setShow(false)}- >- <span- className='text-slate-900 dark:text-gray-50 cursor-pointer'- onClick={() => setShow(!show)}- >- {values[selected].label}- {' '}+ <OutsideClickHandler onOutsideClick={() => setShow(false)}>+ <span className='text-slate-900 dark:text-gray-50 cursor-pointer' onClick={() => setShow(!show)}>+ {values[selected].label}{' '}{show ? <ChevronUpIcon className='inline w-4 h-4' /> : <ChevronDownIcon className='inline w-4 h-4' />}</span>{show && (<div className='absolute z-10 mt-2 top-15 text-gray-900 bg-white border border-gray-200 rounded-md shadow-lg dark:bg-slate-900 dark:border-slate-700/50 min-w-[250px] max-h-[200px] overflow-auto'><div className='flex flex-col w-full p-2'>- <p className='text-sm font-semibold text-gray-900 dark:text-gray-50 px-1'>- {selectLabel}- </p>+ <p className='text-sm font-semibold text-gray-900 dark:text-gray-50 px-1'>{selectLabel}</p>{_map(values, ({ label }, index) => (<divkey={label}@@ -160,7 +116,10 @@ export const MetricCardSelect: React.FC<IMetricCardSelect> = ({ values, valueMap</div>))}</div>- <XMarkIcon className='absolute top-2 right-2 w-5 h-5 text-gray-900 cursor-pointer dark:text-gray-50' onClick={() => setShow(!show)} />+ <XMarkIcon+ className='absolute top-2 right-2 w-5 h-5 text-gray-900 cursor-pointer dark:text-gray-50'+ onClick={() => setShow(!show)}+ /></div>)}</OutsideClickHandler>@@ -202,7 +161,6 @@ const MetricCards = ({ overall, overallCompare, activePeriodCompare }: IMetricCavalueMapper={(value, type) => `${type === 'badge' && value > 0 ? '+' : ''}${nFormatter(value, 1)}`}/></div>-)}@@ -237,7 +195,9 @@ const MetricCards = ({ overall, overallCompare, activePeriodCompare }: IMetricCavalue={overall.current?.sdur}change={sdurChange}goodChangeDirection='down'- valueMapper={(value, type) => `${type === 'badge' && value > 0 ? '+' : ''}${getStringFromTime(getTimeFromSeconds(value))}`}+ valueMapper={(value, type) =>+ `${type === 'badge' && value > 0 ? '+' : ''}${getStringFromTime(getTimeFromSeconds(value))}`+ }/></div>)diff --git a/app/pages/Project/View/components/NoEvents.tsx b/app/pages/Project/View/components/NoEvents.tsxindex 9ff75e1d5..810b0e723 100644--- a/app/pages/Project/View/components/NoEvents.tsx+++ b/app/pages/Project/View/components/NoEvents.tsx@@ -1,6 +1,4 @@-import React, {- memo,-} from 'react'+import React, { memo } from 'react'import { useTranslation, Trans } from 'react-i18next'import _isEmpty from 'lodash/isEmpty'import PropTypes from 'prop-types'@@ -17,7 +15,8 @@ import { DOCS_URL } from 'redux/constants'* @returns {JSX.Element}*/const NoEvents = ({- filters, resetFilters,+ filters,+ resetFilters,}: {filters: {column: string@@ -26,16 +25,16 @@ const NoEvents = ({}[]resetFilters: () => void}): JSX.Element => {- const { t }: {+ const {+ t,+ }: {t: (key: string) => string} = useTranslation('common')return (<div className='flex flex-col py-6 sm:px-6 lg:px-8 mt-5'><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>+ <h2 className='text-4xl text-center leading-tight my-3'>{t('project.noEvTitle')}</h2><h2 className='text-2xl mb-8 text-center leading-snug'><Trans// @ts-ignore@@ -43,18 +42,21 @@ const NoEvents = ({i18nKey='project.noEvContent'components={{// eslint-disable-next-line jsx-a11y/anchor-has-content- url: <a title={`${t('titles.docs')} (opens in a new tab)`} href={DOCS_URL} className='hover:underline text-blue-600' target='_blank' rel='noreferrer noopener' />,+ url: (+ <a+ title={`${t('titles.docs')} (opens in a new tab)`}+ href={DOCS_URL}+ className='hover:underline text-blue-600'+ target='_blank'+ rel='noreferrer noopener'+ />+ ),}}/></h2>{!_isEmpty(filters) && (<div className='!flex !mx-auto'>- <Button- onClick={resetFilters}- className='!flex !mx-auto'- primary- giant- >+ <Button onClick={resetFilters} className='!flex !mx-auto' primary giant>{t('project.resetFilters')}</Button></div>@@ -65,11 +67,13 @@ const NoEvents = ({}NoEvents.propTypes = {- filters: PropTypes.arrayOf(PropTypes.shape({- column: PropTypes.string,- filter: PropTypes.string,- isExclusive: PropTypes.bool,- })),+ filters: PropTypes.arrayOf(+ PropTypes.shape({+ column: PropTypes.string,+ filter: PropTypes.string,+ isExclusive: PropTypes.bool,+ }),+ ),resetFilters: PropTypes.func.isRequired,}diff --git a/app/pages/Project/View/components/Pageflow.tsx b/app/pages/Project/View/components/Pageflow.tsxindex edcb1a576..0d359770e 100644--- a/app/pages/Project/View/components/Pageflow.tsx+++ b/app/pages/Project/View/components/Pageflow.tsx@@ -13,7 +13,10 @@ interface IPageflow {}export const Pageflow = ({ pages }: IPageflow) => {- const { t, i18n: { language } } = useTranslation('common')+ const {+ t,+ i18n: { language },+ } = useTranslation('common')return (<div className='flow-root'>@@ -30,19 +33,16 @@ export const Pageflow = ({ pages }: IPageflow) => {<li key={`${value}${created}`}><div className='relative pb-8'>{index !== pages.length - 1 ? (- <span className='absolute left-4 top-4 -ml-px h-full w-0.5 bg-slate-200 dark:bg-slate-700' aria-hidden='true' />+ <span+ className='absolute left-4 top-4 -ml-px h-full w-0.5 bg-slate-200 dark:bg-slate-700'+ aria-hidden='true'+ />) : null}<div className='relative flex space-x-3'><div>- <span- className='h-8 w-8 rounded-full flex items-center justify-center bg-slate-400 dark:bg-slate-800'- >- {type === 'pageview' && (- <NewspaperIcon className='h-5 w-5 text-white' aria-hidden='true' />- )}- {type === 'event' && (- <CursorArrowRaysIcon className='h-5 w-5 text-white' aria-hidden='true' />- )}+ <span className='h-8 w-8 rounded-full flex items-center justify-center bg-slate-400 dark:bg-slate-800'>+ {type === 'pageview' && <NewspaperIcon className='h-5 w-5 text-white' aria-hidden='true' />}+ {type === 'event' && <CursorArrowRaysIcon className='h-5 w-5 text-white' aria-hidden='true' />}</span></div><div className='flex min-w-0 flex-1 justify-between space-x-4 pt-1.5'>@@ -61,9 +61,7 @@ export const Pageflow = ({ pages }: IPageflow) => {</p></div><div className='whitespace-nowrap text-right text-sm text-gray-700 dark:text-gray-300'>- <time dateTime={created}>- {displayCreated}- </time>+ <time dateTime={created}>{displayCreated}</time></div></div></div>@@ -74,4 +72,4 @@ export const Pageflow = ({ pages }: IPageflow) => {</ul></div>)-}\ No newline at end of file+}diff --git a/app/pages/Project/View/components/PerformanceMetricCards.tsx b/app/pages/Project/View/components/PerformanceMetricCards.tsxindex 1a8418634..a58b55a83 100644--- a/app/pages/Project/View/components/PerformanceMetricCards.tsx+++ b/app/pages/Project/View/components/PerformanceMetricCards.tsx@@ -34,21 +34,27 @@ const PerformanceMetricCards = ({ overall, overallCompare, activePeriodCompare }value={overall.current?.frontend}change={frontendChange}goodChangeDirection='up'- valueMapper={(value, type) => `${type === 'badge' && value > 0 ? '+' : ''}${getStringFromTime(getTimeFromSeconds(value), true)}`}+ valueMapper={(value, type) =>+ `${type === 'badge' && value > 0 ? '+' : ''}${getStringFromTime(getTimeFromSeconds(value), true)}`+ }/><MetricCardlabel={t('dashboard.backend')}value={overall.current?.backend}change={backendChange}goodChangeDirection='up'- valueMapper={(value, type) => `${type === 'badge' && value > 0 ? '+' : ''}${getStringFromTime(getTimeFromSeconds(value), true)}`}+ valueMapper={(value, type) =>+ `${type === 'badge' && value > 0 ? '+' : ''}${getStringFromTime(getTimeFromSeconds(value), true)}`+ }/><MetricCardlabel={t('dashboard.network')}value={overall.current?.network}change={networkChange}goodChangeDirection='up'- valueMapper={(value, type) => `${type === 'badge' && value > 0 ? '+' : ''}${getStringFromTime(getTimeFromSeconds(value), true)}`}+ valueMapper={(value, type) =>+ `${type === 'badge' && value > 0 ? '+' : ''}${getStringFromTime(getTimeFromSeconds(value), true)}`+ }/></div>)diff --git a/app/pages/Project/View/components/RefRow.tsx b/app/pages/Project/View/components/RefRow.tsxindex ac520688b..da8791764 100644--- a/app/pages/Project/View/components/RefRow.tsx+++ b/app/pages/Project/View/components/RefRow.tsx@@ -9,10 +9,7 @@ import PropTypes from 'prop-types'* @param {boolean} showIcons - Whether to show favicon icons near links or not.* @returns {JSX.Element}*/-const RefRow = ({ rowName, showIcons }: {- rowName: string- showIcons: boolean-}): JSX.Element => {+const RefRow = ({ rowName, showIcons }: { rowName: string; showIcons: boolean }): JSX.Element => {let isUrl: boolean = truelet url: URL | null = null@@ -44,9 +41,7 @@ const RefRow = ({ rowName, showIcons }: {{rowName}</a>) : (- <span className='flex label hover:underline text-blue-600 dark:text-blue-500'>- {rowName}- </span>+ <span className='flex label hover:underline text-blue-600 dark:text-blue-500'>{rowName}</span>)}</div>)diff --git a/app/pages/Project/View/components/SearchFilters.tsx b/app/pages/Project/View/components/SearchFilters.tsxindex 655dab970..995db604d 100644--- a/app/pages/Project/View/components/SearchFilters.tsx+++ b/app/pages/Project/View/components/SearchFilters.tsx@@ -16,10 +16,13 @@ import { Filter } from './Filters'interface ISearchFilters {projectPassword?: string- setProjectFilter: (filter: {- column: string- filter: string[]- }[], override: boolean) => void+ setProjectFilter: (+ filter: {+ column: string+ filter: string[]+ }[],+ override: boolean,+ ) => voidpid: stringshowModal: booleansetShowModal: (show: boolean) => void@@ -31,10 +34,15 @@ interface ISearchFilters {}[]}-const getLabelToTypeMap = (t: any) => _reduce(FILTERS_PANELS_ORDER, (acc, curr) => ({- ...acc,- [t(`project.mapping.${curr}`)]: curr,-}), {})+const getLabelToTypeMap = (t: any) =>+ _reduce(+ FILTERS_PANELS_ORDER,+ (acc, curr) => ({+ ...acc,+ [t(`project.mapping.${curr}`)]: curr,+ }),+ {},+ )interface IActiveFilter {column: string@@ -52,9 +60,18 @@ const formatFilters = (filters: any): IActiveFilter[] => {}const SearchFilters = ({- setProjectFilter, pid, showModal, setShowModal, tnMapping, filters, projectPassword,+ setProjectFilter,+ pid,+ showModal,+ setShowModal,+ tnMapping,+ filters,+ projectPassword,}: ISearchFilters) => {- const { t, i18n: { language } } = useTranslation('common')+ const {+ t,+ i18n: { language },+ } = useTranslation('common')const [filterType, setFilterType] = useState<string>('')const [searchList, setSearchList] = useState<any[]>([])const [activeFilters, setActiveFilters] = useState<any>({})@@ -62,10 +79,13 @@ const SearchFilters = ({const labelToTypeMap = useMemo(() => getLabelToTypeMap(t), [t])- const getFiltersList = useCallback(async (type: string) => {- const res = await getFilters(pid, type, projectPassword)- setSearchList(res)- }, [pid, projectPassword])+ const getFiltersList = useCallback(+ async (type: string) => {+ const res = await getFilters(pid, type, projectPassword)+ setSearchList(res)+ },+ [pid, projectPassword],+ )useEffect(() => {if (!showModal || _isEmpty(filterType)) {@@ -94,106 +114,103 @@ const SearchFilters = ({submitText={t('project.applyFilters')}title={t('project.advancedFilters')}message={- (- <div className='min-h-[410px]'>- <Select- label={t('project.selectCategory')}- items={FILTERS_PANELS_ORDER}- labelExtractor={(item) => t(`project.mapping.${item}`)}- // @ts-ignore- onSelect={(item: string) => setFilterType(labelToTypeMap[item])}- title={_isEmpty(filterType) ? t('project.settings.reseted.selectFilters') : t(`project.mapping.${filterType}`)}- />- {!_isEmpty(filters) && (- <>- <p className='mt-5 text-sm font-medium text-gray-700 dark:text-gray-200'>- {t('project.currentFilters')}- </p>- {_map(filters, ({ column, filter, isExclusive }) => (+ <div className='min-h-[410px]'>+ <Select+ label={t('project.selectCategory')}+ items={FILTERS_PANELS_ORDER}+ labelExtractor={(item) => t(`project.mapping.${item}`)}+ // @ts-ignore+ onSelect={(item: string) => setFilterType(labelToTypeMap[item])}+ title={+ _isEmpty(filterType) ? t('project.settings.reseted.selectFilters') : t(`project.mapping.${filterType}`)+ }+ />+ {!_isEmpty(filters) && (+ <>+ <p className='mt-5 text-sm font-medium text-gray-700 dark:text-gray-200'>{t('project.currentFilters')}</p>+ {_map(filters, ({ column, filter, isExclusive }) => (+ <Filter+ key={`${column}-${filter}`}+ t={t}+ language={language}+ onChangeExclusive={() => {}}+ onRemoveFilter={() => {}}+ isExclusive={isExclusive}+ column={column}+ filter={filter}+ tnMapping={tnMapping}+ removable={false}+ canChangeExclusive={false}+ />+ ))}+ </>+ )}+ {filterType && !_isEmpty(searchList) && (+ <>+ <p className='mt-5 text-sm font-medium text-gray-700 dark:text-gray-200'>{t('project.newFilters')}</p>+ <Combobox+ items={searchList}+ labelExtractor={(item) => {+ if (filterType === 'cc') {+ return countries.getName(item, language)+ }++ return item+ }}+ onSelect={(item: any) => {+ const processedItem = filterType === 'cc' ? (countries.getAlpha2Code(item, language) as string) : item++ setActiveFilters((prevFilters: any) => ({+ ...prevFilters,+ [filterType]: [...(prevFilters[filterType] || []), processedItem],+ }))+ }}+ placeholder={t('project.settings.reseted.filtersPlaceholder')}+ />+ {_map(activeFilters, (filter, column) => {+ return _map(filter, (item) => (<Filter- key={`${column}-${filter}`}+ key={`${column}-${item}`}t={t}+ onRemoveFilter={(removeColumn, removeFilter) => {+ setActiveFilters((prevFilters: any) => {+ const filteredColumn = _filter(+ prevFilters[removeColumn],+ (item: string) => item !== removeFilter,+ )++ if (_isEmpty(filteredColumn)) {+ return _filter(prevFilters, (_, key) => key !== removeColumn)+ }++ return {+ ...prevFilters,+ [removeColumn]: filteredColumn,+ }+ })+ }}language={language}- onChangeExclusive={() => { }}- onRemoveFilter={() => { }}- isExclusive={isExclusive}+ onChangeExclusive={() => {}}+ isExclusive={false}+ canChangeExclusive={false}column={column}- filter={filter}+ filter={item}tnMapping={tnMapping}- removable={false}- canChangeExclusive={false}+ removable/>- ))}- </>- )}- {(filterType && !_isEmpty(searchList)) && (- <>- <p className='mt-5 text-sm font-medium text-gray-700 dark:text-gray-200'>- {t('project.newFilters')}- </p>- <Combobox- items={searchList}- labelExtractor={(item) => {- if (filterType === 'cc') {- return countries.getName(item, language)- }-- return item- }}- onSelect={(item: any) => {- const processedItem = filterType === 'cc'- ? countries.getAlpha2Code(item, language) as string- : item-- setActiveFilters((prevFilters: any) => ({- ...prevFilters,- [filterType]: [...(prevFilters[filterType] || []), processedItem],- }))- }}- placeholder={t('project.settings.reseted.filtersPlaceholder')}- />- {_map(activeFilters, (filter, column) => {- return _map(filter, (item) => (- <Filter- key={`${column}-${item}`}- t={t}- onRemoveFilter={(removeColumn, removeFilter) => {- setActiveFilters((prevFilters: any) => {- const filteredColumn = _filter(prevFilters[removeColumn], (item: string) => item !== removeFilter)-- if (_isEmpty(filteredColumn)) {- return _filter(prevFilters, (_, key) => key !== removeColumn)- }-- return {- ...prevFilters,- [removeColumn]: filteredColumn,- }- })- }}- language={language}- onChangeExclusive={() => { }}- isExclusive={false}- canChangeExclusive={false}- column={column}- filter={item}- tnMapping={tnMapping}- removable- />- ))- })}- <Checkbox- checked={Boolean(override)}- onChange={(e) => setOverride(e.target.checked)}- name='overrideCurrentlyFilters'- id='overrideCurrentlyFilters'- className='mt-4'- label={t('project.overrideCurrentlyFilters')}- />- </>- )}- </div>- )+ ))+ })}+ <Checkbox+ checked={Boolean(override)}+ onChange={(e) => setOverride(e.target.checked)}+ name='overrideCurrentlyFilters'+ id='overrideCurrentlyFilters'+ className='mt-4'+ label={t('project.overrideCurrentlyFilters')}+ />+ </>+ )}+ </div>}submitType='regular'isOpened={showModal}diff --git a/app/pages/Project/View/components/SessionChart.tsx b/app/pages/Project/View/components/SessionChart.tsxindex 40b13ac65..14f6c072e 100644--- a/app/pages/Project/View/components/SessionChart.tsx+++ b/app/pages/Project/View/components/SessionChart.tsx@@ -14,14 +14,18 @@ interface ISessionChart {dataNames: any}-export const SessionChart = ({- chart, timeBucket, timeFormat, rotateXAxis, chartType, dataNames,-}: ISessionChart) => {+export const SessionChart = ({ chart, timeBucket, timeFormat, rotateXAxis, chartType, dataNames }: ISessionChart) => {// const [bbChart, setBBChart] = useState<bb.Chart | null>(null)useEffect(() => {// @ts-ignore- const bbSettings: bb.ChartOptions = getSettingsSession(chart, timeBucket as string, timeFormat, rotateXAxis, chartType)+ const bbSettings: bb.ChartOptions = getSettingsSession(+ chart,+ timeBucket as string,+ timeFormat,+ rotateXAxis,+ chartType,+ )const generate = bb.generate(bbSettings)generate.data.names(dataNames)@@ -33,7 +37,5 @@ export const SessionChart = ({// })}, [chart, timeBucket, timeFormat, rotateXAxis, chartType, dataNames])- return (- <div className='h-80 mt-5 md:mt-0 [&_svg]:!overflow-visible' id='sessionChart' />- )+ return <div className='h-80 mt-5 md:mt-0 [&_svg]:!overflow-visible' id='sessionChart' />}diff --git a/app/pages/Project/View/components/SessionDetails.tsx b/app/pages/Project/View/components/SessionDetails.tsxindex 4af0fe599..92ecc2e83 100644--- a/app/pages/Project/View/components/SessionDetails.tsx+++ b/app/pages/Project/View/components/SessionDetails.tsx@@ -14,29 +14,40 @@ interface ISessionDetailsComponent {}export const SessionDetails = ({ details, psid }: ISessionDetailsComponent) => {- const { t, i18n: { language } } = useTranslation('common')+ const {+ t,+ i18n: { language },+ } = useTranslation('common')- const geo = [{- label: t('project.mapping.cc'),- value: details.cc,- }, {- label: t('project.mapping.rg'),- value: details.rg,- }, {- label: t('project.mapping.ct'),- value: details.ct,- }]+ const geo = [+ {+ label: t('project.mapping.cc'),+ value: details.cc,+ },+ {+ label: t('project.mapping.rg'),+ value: details.rg,+ },+ {+ label: t('project.mapping.ct'),+ value: details.ct,+ },+ ]- const utm = [{- label: t('project.mapping.so'),- value: details.so || 'N/A',- }, {- label: t('project.mapping.me'),- value: details.me || 'N/A',- }, {- label: t('project.mapping.ca'),- value: details.ca || 'N/A',- }]+ const utm = [+ {+ label: t('project.mapping.so'),+ value: details.so || 'N/A',+ },+ {+ label: t('project.mapping.me'),+ value: details.me || 'N/A',+ },+ {+ label: t('project.mapping.ca'),+ value: details.ca || 'N/A',+ },+ ]return (<div className='flex justify-center lg:justify-start gap-5 mb-5 flex-wrap'>@@ -59,23 +70,14 @@ export const SessionDetails = ({ details, psid }: ISessionDetailsComponent) => {)}}/>- <MetricCard- label={t('project.mapping.os')}- value={details.os || 'N/A'}- />+ <MetricCard label={t('project.mapping.os')} value={details.os || 'N/A'} /><MetricCardlabel={t('project.mapping.dv')}value={details.dv || 'N/A'}valueMapper={(value) => _capitalize(value)}/>- <MetricCard- label={t('project.mapping.br')}- value={details.br || 'N/A'}- />- <MetricCard- label={t('project.mapping.lc')}- value={details.lc || 'N/A'}- />+ <MetricCard label={t('project.mapping.br')} value={details.br || 'N/A'} />+ <MetricCard label={t('project.mapping.lc')} value={details.lc || 'N/A'} /><MetricCardlabel={t('project.mapping.ref')}value={details.ref || 'N/A'}@@ -93,10 +95,7 @@ export const SessionDetails = ({ details, psid }: ISessionDetailsComponent) => {)}}/>- <MetricCardSelect- values={utm}- selectLabel={t('project.campaigns')}- />+ <MetricCardSelect values={utm} selectLabel={t('project.campaigns')} /><MetricCardlabel={t('dashboard.sessionDuration')}value={details.sdur as number}diff --git a/app/pages/Project/View/components/Sessions.tsx b/app/pages/Project/View/components/Sessions.tsxindex 139b3ec1a..a24865ffb 100644--- a/app/pages/Project/View/components/Sessions.tsx+++ b/app/pages/Project/View/components/Sessions.tsx@@ -19,7 +19,10 @@ interface ISessionComponent {}const Session = ({ session, onClick, className }: ISessionComponent) => {- const { t, i18n: { language } } = useTranslation('common')+ const {+ t,+ i18n: { language },+ } = useTranslation('common')const date = new Date(session.created).toLocaleDateString(language, {day: 'numeric',month: 'short',@@ -30,12 +33,15 @@ const Session = ({ session, onClick, className }: ISessionComponent) => {return (<li- className={cx('relative flex justify-between gap-x-6 py-5 bg-gray-50 hover:bg-gray-200 dark:bg-slate-900 dark:hover:bg-slate-800 cursor-pointer px-4 sm:px-6 lg:px-8', className)}+ className={cx(+ 'relative flex justify-between gap-x-6 py-5 bg-gray-50 hover:bg-gray-200 dark:bg-slate-900 dark:hover:bg-slate-800 cursor-pointer px-4 sm:px-6 lg:px-8',+ className,+ )}onClick={() => {const url = new URL(window.location.href)url.searchParams.set('psid', session.psid)window.history.pushState({}, '', url.toString())-+onClick(session.psid)}}>@@ -43,31 +49,21 @@ const Session = ({ session, onClick, className }: ISessionComponent) => {<div className='min-w-0 flex-auto'><p className='text-sm font-semibold leading-6 text-gray-900 dark:text-gray-50'>{session.psid}- <span className='text-gray-400 mx-1'>- |- </span>+ <span className='text-gray-400 mx-1'>|</span>{date}</p><p className='mt-1 flex text-xs leading-5 text-gray-500 dark:text-gray-300'>- {session.cc ? (- <CCRow size={18} cc={session.cc} language={language} />- ) : t('project.unknownCountry')}- <span className='text-gray-400 mx-1'>- |- </span>+ {session.cc ? <CCRow size={18} cc={session.cc} language={language} /> : t('project.unknownCountry')}+ <span className='text-gray-400 mx-1'>|</span>{session.os}- <span className='text-gray-400 mx-1'>- |- </span>+ <span className='text-gray-400 mx-1'>|</span>{session.br}</p></div></div><div className='flex shrink-0 items-center gap-x-4'><div className='hidden sm:flex sm:flex-col sm:items-end'>- <p className='text-sm leading-6 text-gray-900 dark:text-gray-50'>- {`${session.pageviews} pageviews`}- </p>+ <p className='text-sm leading-6 text-gray-900 dark:text-gray-50'>{`${session.pageviews} pageviews`}</p>{session.active ? (<Badge label={t('dashboard.active')} colour='green' />) : (diff --git a/app/pages/Project/View/components/TBPeriodSelector.tsx b/app/pages/Project/View/components/TBPeriodSelector.tsxindex ef9a67da6..520bc55f3 100644--- a/app/pages/Project/View/components/TBPeriodSelector.tsx+++ b/app/pages/Project/View/components/TBPeriodSelector.tsx@@ -9,16 +9,23 @@ import cx from 'clsx'import { ALL_PERIODS } from 'redux/constants'interface ITBPeriodSelector {- title: string | number | React.ReactNode,- items: any[],+ title: string | number | React.ReactNode+ items: any[]/* (function): A function that is called when an item is selected. */- onSelect: (item: any, e?: React.MouseEvent<HTMLElement>) => void | null,- activePeriod: any,- updateTimebucket: (tb: string) => void,- timeBucket: string,+ onSelect: (item: any, e?: React.MouseEvent<HTMLElement>) => void | null+ activePeriod: any+ updateTimebucket: (tb: string) => void+ timeBucket: string}-const TBPeriodSelector = ({ items, title, onSelect, activePeriod, updateTimebucket, timeBucket }: ITBPeriodSelector): JSX.Element => {+const TBPeriodSelector = ({+ items,+ title,+ onSelect,+ activePeriod,+ updateTimebucket,+ timeBucket,+}: ITBPeriodSelector): JSX.Element => {const { t } = useTranslation('common')const periods = useMemo(() => {@@ -31,9 +38,7 @@ const TBPeriodSelector = ({ items, title, onSelect, activePeriod, updateTimebuckreturn (<Popover className='relative'>- <Popover.Button- className='inline-flex w-full px-3 md:px-4 py-2 text-sm font-medium text-gray-700 dark:text-gray-50 outline-none group'- >+ <Popover.Button className='inline-flex w-full px-3 md:px-4 py-2 text-sm font-medium text-gray-700 dark:text-gray-50 outline-none group'><CalendarDaysIcon className='w-5 h-5 mr-1' /><span>{title}</span><ChevronDownIcon@@ -65,24 +70,26 @@ const TBPeriodSelector = ({ items, title, onSelect, activePeriod, updateTimebuckupdateTimebucket(value)}}- className={cx(- 'relative capitalize inline-flex items-center text-sm font-medium',- {- 'text-gray-900 dark:text-gray-50': timeBucket === value,- 'text-gray-700 dark:text-gray-300': (available && timeBucket !== value),- 'text-gray-400 dark:text-gray-500': (!available && timeBucket !== value),- 'cursor-pointer': available,- 'cursor-default': !available,- },- )}+ className={cx('relative capitalize inline-flex items-center text-sm font-medium', {+ 'text-gray-900 dark:text-gray-50': timeBucket === value,+ 'text-gray-700 dark:text-gray-300': available && timeBucket !== value,+ 'text-gray-400 dark:text-gray-500': !available && timeBucket !== value,+ 'cursor-pointer': available,+ 'cursor-default': !available,+ })}>{label}</Popover.Button>))}</div><ul className='text-left w-full'>- {_map(items, item => (- <Popover.Button as='li' key={item.label} onClick={(e: React.MouseEvent<HTMLElement>) => onSelect(item, e)} className='text-gray-700 dark:text-gray-50 rounded-md block px-4 py-2 text-sm cursor-pointer hover:bg-gray-200 dark:hover:bg-slate-700'>+ {_map(items, (item) => (+ <Popover.Button+ as='li'+ key={item.label}+ onClick={(e: React.MouseEvent<HTMLElement>) => onSelect(item, e)}+ className='text-gray-700 dark:text-gray-50 rounded-md block px-4 py-2 text-sm cursor-pointer hover:bg-gray-200 dark:hover:bg-slate-700'+ >{item.dropdownLabel || item.label}</Popover.Button>))}diff --git a/app/pages/Project/View/components/UTMDropdown.tsx b/app/pages/Project/View/components/UTMDropdown.tsxindex cd4cdcbf0..d75c2a839 100644--- a/app/pages/Project/View/components/UTMDropdown.tsx+++ b/app/pages/Project/View/components/UTMDropdown.tsx@@ -3,12 +3,10 @@ import _map from 'lodash/map'import { useTranslation } from 'react-i18next'// @ts-ignoreimport OutsideClickHandler from 'react-outside-click-handler'-import {- ChevronDownIcon, ChevronUpIcon, XMarkIcon,-} from '@heroicons/react/24/outline'+import { ChevronDownIcon, ChevronUpIcon, XMarkIcon } from '@heroicons/react/24/outline'interface IUTMDropdown {- onSelect: any,+ onSelect: anytitle: string}@@ -37,20 +35,14 @@ const UTMDropdown = ({ onSelect, title }: IUTMDropdown): JSX.Element => {}return (- <OutsideClickHandler- onOutsideClick={() => setShow(false)}- >+ <OutsideClickHandler onOutsideClick={() => setShow(false)}><span className='cursor-pointer' onClick={() => setShow(!show)}>- {title}- {' '}- {show ? <ChevronUpIcon className='inline w-4 h-4' /> : <ChevronDownIcon className='inline w-4 h-4' />}+ {title} {show ? <ChevronUpIcon className='inline w-4 h-4' /> : <ChevronDownIcon className='inline w-4 h-4' />}</span>{show && (<div className='absolute z-10 mt-2 left-5 top-15 text-gray-900 bg-white border border-gray-200 rounded-md shadow-lg dark:bg-slate-900 dark:border-slate-700/50 min-w-[250px] max-h-[200px] overflow-auto'><div className='flex flex-col w-full p-2'>- <p className='text-sm font-semibold text-gray-900 dark:text-gray-50 px-1'>- {t('project.campaigns')}- </p>+ <p className='text-sm font-semibold text-gray-900 dark:text-gray-50 px-1'>{t('project.campaigns')}</p>{_map(OPTIONS, ({ label, value }) => (<divkey={label}@@ -61,7 +53,10 @@ const UTMDropdown = ({ onSelect, title }: IUTMDropdown): JSX.Element => {</div>))}</div>- <XMarkIcon className='absolute top-2 right-2 w-5 h-5 text-gray-900 cursor-pointer dark:text-gray-50' onClick={() => setShow(!show)} />+ <XMarkIcon+ className='absolute top-2 right-2 w-5 h-5 text-gray-900 cursor-pointer dark:text-gray-50'+ onClick={() => setShow(!show)}+ /></div>)}</OutsideClickHandler>diff --git a/app/pages/Project/View/components/UserFlow.tsx b/app/pages/Project/View/components/UserFlow.tsxindex 24555fc5b..bfa0e903e 100644--- a/app/pages/Project/View/components/UserFlow.tsx+++ b/app/pages/Project/View/components/UserFlow.tsx@@ -18,25 +18,31 @@ const mapStateToProps = (state: StateType) => ({const mapDispatchToProps = (dispatch: AppDispatch) => ({setUserFlowAscending: (data: IUserFlow, pid: string, period: string, filters: any) => {- dispatch(UIActions.setUserFlowAscending({- data,- pid,- period,- filters,- }))+ dispatch(+ UIActions.setUserFlowAscending({+ data,+ pid,+ period,+ filters,+ }),+ )},setUserFlowDescending: (data: IUserFlow, pid: string, period: string, filters: any) => {- dispatch(UIActions.setUserFlowDescending({- data,- pid,- period,- filters,- }))+ dispatch(+ UIActions.setUserFlowDescending({+ data,+ pid,+ period,+ filters,+ }),+ )},generateError: (message: string) => {- dispatch(errorsActions.genericError({- message,- }))+ dispatch(+ errorsActions.genericError({+ message,+ }),+ )},})@@ -65,9 +71,22 @@ interface IJSXUserFlow {}const UserFlow = ({- disableLegend, pid, period, timeBucket, from, to, timezone, userFlowAscendingCache,- userFlowDescendingCache, filters, setReversed,- isReversed, setUserFlowAscending, setUserFlowDescending, generateError, t,+ disableLegend,+ pid,+ period,+ timeBucket,+ from,+ to,+ timezone,+ userFlowAscendingCache,+ userFlowDescendingCache,+ filters,+ setReversed,+ isReversed,+ setUserFlowAscending,+ setUserFlowDescending,+ generateError,+ t,projectPassword,}: IJSXUserFlow) => {const key = getUserFlowCacheKey(pid, period, filters)@@ -78,10 +97,7 @@ const UserFlow = ({const fetchUserFlow = async () => {setIsLoading(true)await getUserFlow(pid, timeBucket, period, filters, from, to, timezone, projectPassword)- .then((res: {- ascending: IUserFlow- descending: IUserFlow- }) => {+ .then((res: { ascending: IUserFlow; descending: IUserFlow }) => {const { ascending, descending } = ressetUserFlowAscending(ascending, pid, period, filters)@@ -101,19 +117,23 @@ const UserFlow = ({} else if (isLoading) {setIsLoading(false)}- // eslint-disable-next-line react-hooks/exhaustive-deps+ // eslint-disable-next-line react-hooks/exhaustive-deps}, [period, timeBucket, from, to, timezone, pid])useEffect(() => {fetchUserFlow()- // eslint-disable-next-line react-hooks/exhaustive-deps+ // eslint-disable-next-line react-hooks/exhaustive-deps}, [filters])if (isLoading) {return <Loader />}- if (!isReversed ? (_isEmpty(userFlowAscending) || _isEmpty(userFlowAscending?.nodes) || _isEmpty(userFlowAscending?.links)) : (_isEmpty(userFlowDescending) || _isEmpty(userFlowDescending?.links) || _isEmpty(userFlowDescending?.nodes))) {+ if (+ !isReversed+ ? _isEmpty(userFlowAscending) || _isEmpty(userFlowAscending?.nodes) || _isEmpty(userFlowAscending?.links)+ : _isEmpty(userFlowDescending) || _isEmpty(userFlowDescending?.links) || _isEmpty(userFlowDescending?.nodes)+ ) {return (<><p className='flex mt-4 items-center justify-center text-md text-gray-900 dark:text-gray-50'>@@ -128,7 +148,6 @@ const UserFlow = ({>{t('project.reverse')}</button>-</>)}@@ -153,12 +172,7 @@ const UserFlow = ({nodeBorderWidth={0}nodeBorderColor={{from: 'color',- modifiers: [- [- 'darker',- 0.8,- ],- ],+ modifiers: [['darker', 0.8]],}}nodeBorderRadius={3}linkOpacity={0.5}@@ -170,12 +184,7 @@ const UserFlow = ({labelPadding={16}labelTextColor={{from: 'color',- modifiers: [- [- 'darker',- 1,- ],- ],+ modifiers: [['darker', 1]],}}// legends={!disableLegend ? [// {@@ -207,7 +216,11 @@ UserFlow.defaultProps = {isReversed: false,}-const mergeProps = (stateProps: ReturnType<typeof mapStateToProps>, dispatchProps: ReturnType<typeof mapDispatchToProps>, ownProps: ReturnType<typeof UserFlow>) => ({+const mergeProps = (+ stateProps: ReturnType<typeof mapStateToProps>,+ dispatchProps: ReturnType<typeof mapDispatchToProps>,+ ownProps: ReturnType<typeof UserFlow>,+) => ({...ownProps,...stateProps,...dispatchProps,diff --git a/app/pages/ReferralPage/index.tsx b/app/pages/ReferralPage/index.tsxindex c617b43d7..b9d3af324 100644--- a/app/pages/ReferralPage/index.tsx+++ b/app/pages/ReferralPage/index.tsx@@ -9,19 +9,22 @@ import Header from 'components/Header'import routes from 'routesPath'import { Lines } from 'pages/MainPage'-import {- isBrowser, REFERRAL_COOKIE_DAYS, REFERRAL_DISCOUNT,-} from 'redux/constants'+import { isBrowser, REFERRAL_COOKIE_DAYS, REFERRAL_DISCOUNT } from 'redux/constants'interface IReferralPage {ssrTheme: 'dark' | 'light'}const ReferralPage = ({ ssrTheme }: IReferralPage): JSX.Element => {- const { t }: {- t: (key: string, options?: {- [key: string]: string | number,- }) => string,+ const {+ t,+ }: {+ t: (+ key: string,+ options?: {+ [key: string]: string | number+ },+ ) => string} = useTranslation('common')const reduxTheme = useSelector((state: StateType) => state.ui.theme.theme)const theme = isBrowser ? reduxTheme : ssrTheme@@ -38,14 +41,7 @@ const ReferralPage = ({ ssrTheme }: IReferralPage): JSX.Element => {aria-hidden='true'><defs>- <pattern- id='rect-pattern'- width={200}- height={200}- x='50%'- y={-1}- patternUnits='userSpaceOnUse'- >+ <pattern id='rect-pattern' width={200} height={200} x='50%' y={-1} patternUnits='userSpaceOnUse'><path d='M.5 200V.5H200' fill='none' /></pattern></defs>@@ -70,9 +66,7 @@ const ReferralPage = ({ ssrTheme }: IReferralPage): JSX.Element => {/></div><Header ssrTheme={ssrTheme} authenticated={false} refPage transparent />- <div- className='relative pt-10 lg:pt-24 pb-5 xl:px-8 lg:px-6 sm:px-3 mx-auto min-h-[740px]'- >+ <div className='relative pt-10 lg:pt-24 pb-5 xl:px-8 lg:px-6 sm:px-3 mx-auto min-h-[740px]'><div className='relative z-20 flex flex-row content-between 2xl:mr-[14vw] 2xl:justify-center justify-center lg:justify-start'><div className='lg:mt-0 text-left relative lg:mr-14 px-4'><h1 className='max-w-2xl text-2xl sm:text-4xl md:text-5xl font-extrabold text-slate-900 dark:text-white sm:leading-none xl:leading-[110%]'>@@ -81,7 +75,9 @@ const ReferralPage = ({ ssrTheme }: IReferralPage): JSX.Element => {t={t}i18nKey='main.slogan'components={{- span: <span className='from-indigo-700 to-indigo-700 dark:from-indigo-600 dark:to-indigo-400 text-transparent bg-clip-text bg-gradient-to-r' />,+ span: (+ <span className='from-indigo-700 to-indigo-700 dark:from-indigo-600 dark:to-indigo-400 text-transparent bg-clip-text bg-gradient-to-r' />+ ),}}/></h1>@@ -99,9 +95,7 @@ const ReferralPage = ({ ssrTheme }: IReferralPage): JSX.Element => {className='rounded-md !duration-300 transition-all w-full sm:max-w-[210px] h-12 flex items-center justify-center sm:mr-6 shadow-sm ring-1 text-white bg-slate-900 ring-slate-900 hover:bg-slate-700 dark:bg-indigo-700 dark:ring-indigo-700 dark:hover:bg-indigo-600'aria-label={t('titles.signup')}>- <span className='text-base font-semibold mr-1'>- {t('common.getStarted')}- </span>+ <span className='text-base font-semibold mr-1'>{t('common.getStarted')}</span><ArrowSmallRightIcon className='h-4 w-5 mt-[1px]' /></Link><Link@@ -109,9 +103,7 @@ const ReferralPage = ({ ssrTheme }: IReferralPage): JSX.Element => {className='rounded-md !duration-300 transition-all sm:mt-0 mt-2 ring-1 ring-slate-900 dark:ring-white/20 w-full sm:max-w-[210px] h-12 flex items-center justify-center shadow-sm text-slate-900 dark:text-white bg-transparent hover:bg-slate-200 dark:hover:bg-gray-800'aria-label={t('titles.signup')}>- <span className='text-base font-semibold'>- {t('common.learnMore')}- </span>+ <span className='text-base font-semibold'>{t('common.learnMore')}</span></Link></div><p className='text-base tracking-tighter font-medium text-slate-500 dark:text-slate-500 mt-5'>@@ -124,7 +116,10 @@ const ReferralPage = ({ ssrTheme }: IReferralPage): JSX.Element => {<div className='max-w-md xl:max-w-lg hidden lg:block'><Lines /><picture>- <source srcSet={theme === 'dark' ? '/assets/screenshot_dark.webp' : '/assets/screenshot_light.webp'} type='image/webp' />+ <source+ srcSet={theme === 'dark' ? '/assets/screenshot_dark.webp' : '/assets/screenshot_light.webp'}+ type='image/webp'+ /><imgsrc={theme === 'dark' ? '/assets/screenshot_dark.png' : '/assets/screenshot_light.png'}className='h-full min-w-[880px] rounded-xl relative shadow-2xl ring-1 ring-gray-900/10 dark:ring-white/10'@@ -137,7 +132,10 @@ const ReferralPage = ({ ssrTheme }: IReferralPage): JSX.Element => {</div><div className='my-10 block lg:hidden relative z-20 px-4 md:px-0'><picture>- <source srcSet={theme === 'dark' ? '/assets/screenshot_dark.webp' : '/assets/screenshot_light.webp'} type='image/webp' />+ <source+ srcSet={theme === 'dark' ? '/assets/screenshot_dark.webp' : '/assets/screenshot_light.webp'}+ type='image/webp'+ /><imgsrc={theme === 'dark' ? '/assets/screenshot_dark.png' : '/assets/screenshot_light.png'}className='rounded-xl relative shadow-2xl w-full ring-1 ring-gray-900/10 dark:ring-white/10'diff --git a/app/pages/Terms/index.tsx b/app/pages/Terms/index.tsxindex 34cfe990f..0d1c30614 100644--- a/app/pages/Terms/index.tsx+++ b/app/pages/Terms/index.tsx@@ -7,111 +7,202 @@ const Features = (): JSX.Element => {return (<div className='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'>- <h1 className='text-4xl font-bold text-gray-900 dark:text-gray-50 tracking-tight'>Swetrix Terms and Conditions</h1>+ <h1 className='text-4xl font-bold text-gray-900 dark:text-gray-50 tracking-tight'>+ Swetrix Terms and Conditions+ </h1><p className='mt-4 text-lg text-gray-900 dark:text-gray-50 tracking-tight'>- These Swetrix Terms and Conditions ("Terms", "Terms and Conditions") govern your relationship with swetrix.com ("Service") operated by Andrii Romasiun ("Swetrix", "Swetrix Analytics", "Company", "us", "we", or "our").+ These Swetrix Terms and Conditions ("Terms", "Terms and Conditions") govern your relationship with swetrix.com+ ("Service") operated by Andrii Romasiun ("Swetrix", "Swetrix Analytics", "Company", "us", "we", or "our").<br />Please read these Terms and Conditions carefully before using the Service.</p><h3 className='text-2xl font-bold text-gray-900 dark:text-gray-50 tracking-tight mt-4'>Acknowledgment</h3><p className='text-lg text-gray-900 dark:text-gray-50 tracking-tight'>- These are the Terms and Conditions governing the use of this Service and the agreement that operates between you and us. These Terms and Conditions set out the rights and obligations of all users regarding the use of the Service.+ These are the Terms and Conditions governing the use of this Service and the agreement that operates between+ you and us. These Terms and Conditions set out the rights and obligations of all users regarding the use of+ the Service.<br />- Your access to and use of the Service is conditioned on your acceptance of and compliance with these Terms and Conditions. These Terms and Conditions apply to all visitors, users and others who access or use the Service.+ Your access to and use of the Service is conditioned on your acceptance of and compliance with these Terms and+ Conditions. These Terms and Conditions apply to all visitors, users and others who access or use the Service.<br />- By accessing or using the Service you agree to be bound by these Terms and Conditions. If you disagree with any part of these Terms and Conditions then you may not access the Service.+ By accessing or using the Service you agree to be bound by these Terms and Conditions. If you disagree with+ any part of these Terms and Conditions then you may not access the Service.<br />- Your access to and use of the Service is also conditioned on your acceptance of and compliance with our Privacy Policy. Our Privacy Policy describes our policies and procedures on the collection, use and disclosure of your personal information when you access our websites or use our Service and tells you about your privacy rights and how the law protects you. Please read Our Privacy Policy carefully before using our Service.+ Your access to and use of the Service is also conditioned on your acceptance of and compliance with our+ Privacy Policy. Our Privacy Policy describes our policies and procedures on the collection, use and disclosure+ of your personal information when you access our websites or use our Service and tells you about your privacy+ rights and how the law protects you. Please read Our Privacy Policy carefully before using our Service.</p><h3 className='text-2xl font-bold text-gray-900 dark:text-gray-50 tracking-tight mt-4'>Eligibility</h3><p className='text-lg text-gray-900 dark:text-gray-50 tracking-tight'>- By agreeing to these Terms, you represent and warrant to us: (i) that you are at least eighteen (18) years of age; (ii) that you have not previously been suspended or removed from our Service and (iii) that your use of our Service is in compliance with any and all applicable laws and regulations.+ By agreeing to these Terms, you represent and warrant to us: (i) that you are at least eighteen (18) years of+ age; (ii) that you have not previously been suspended or removed from our Service and (iii) that your use of+ our Service is in compliance with any and all applicable laws and regulations.</p><h3 className='text-2xl font-bold text-gray-900 dark:text-gray-50 tracking-tight mt-4'>Indemnity</h3><p className='text-lg text-gray-900 dark:text-gray-50 tracking-tight'>- You agree that you will be responsible for your use of the Service, and you agree to defend, indemnify, and us hold harmless and our officers, directors, employees, consultants, affiliates, subsidiaries and agents (collectively, the "Company Entities") from and against any and all claims, liabilities, damages, losses, and expenses, including reasonable attorneys' fees and costs, arising out of or in any way connected with (i) your access to, use of, or alleged use of the Service; (ii) your violation of these Terms or any representation, warranty, or agreements referenced herein, or any applicable law or regulation; (iii) your violation of any third-party right, including without limitation any intellectual property right, publicity, confidentiality, property or privacy right; or (iv) any disputes or issues between you and any third party. We reserve the right, at our own expense, to assume the exclusive defense and control of any matter otherwise subject to indemnification by you (and without limiting your indemnification obligations with respect to such matter), and in such case, you agree to cooperate with our defense of such claim.+ You agree that you will be responsible for your use of the Service, and you agree to defend, indemnify, and us+ hold harmless and our officers, directors, employees, consultants, affiliates, subsidiaries and agents+ (collectively, the "Company Entities") from and against any and all claims, liabilities, damages, losses, and+ expenses, including reasonable attorneys' fees and costs, arising out of or in any way connected with (i) your+ access to, use of, or alleged use of the Service; (ii) your violation of these Terms or any representation,+ warranty, or agreements referenced herein, or any applicable law or regulation; (iii) your violation of any+ third-party right, including without limitation any intellectual property right, publicity, confidentiality,+ property or privacy right; or (iv) any disputes or issues between you and any third party. We reserve the+ right, at our own expense, to assume the exclusive defense and control of any matter otherwise subject to+ indemnification by you (and without limiting your indemnification obligations with respect to such matter),+ and in such case, you agree to cooperate with our defense of such claim.</p><h3 className='text-2xl font-bold text-gray-900 dark:text-gray-50 tracking-tight mt-4'>Termination</h3><p className='text-lg text-gray-900 dark:text-gray-50 tracking-tight'>- We may at our sole discretion suspend or terminate your access to our Service at any time, with or without notice for any reason or no reason at all. We also reserve the right to modify or discontinue the Service at any time (including, without limitation, by limiting or discontinuing certain features of the Service) without notice to you. We will have no liability whatsoever on account of any change to the Service or any suspension or termination of your access to or use of the Service.+ We may at our sole discretion suspend or terminate your access to our Service at any time, with or without+ notice for any reason or no reason at all. We also reserve the right to modify or discontinue the Service at+ any time (including, without limitation, by limiting or discontinuing certain features of the Service) without+ notice to you. We will have no liability whatsoever on account of any change to the Service or any suspension+ or termination of your access to or use of the Service.</p><h3 className='text-2xl font-bold text-gray-900 dark:text-gray-50 tracking-tight mt-4'>Fair use</h3><p className='text-lg text-gray-900 dark:text-gray-50 tracking-tight'>- We will use commercially reasonable efforts to provide all plan levels with sufficient capacity for the analytics data, number of websites, and other plan features that we determine are typical of accounts at that plan level. We may notify you if your usage is unreasonable, and we may at our sole discretion and at any time shut down and terminate our Service if your usage is creating an unreasonable burden on our infrastructure and/or business operations.+ We will use commercially reasonable efforts to provide all plan levels with sufficient capacity for the+ analytics data, number of websites, and other plan features that we determine are typical of accounts at that+ plan level. We may notify you if your usage is unreasonable, and we may at our sole discretion and at any time+ shut down and terminate our Service if your usage is creating an unreasonable burden on our infrastructure+ and/or business operations.</p><h3 className='text-2xl font-bold text-gray-900 dark:text-gray-50 tracking-tight mt-4'>Third-party websites</h3><p className='text-lg text-gray-900 dark:text-gray-50 tracking-tight'>The Service may contain links to third-party websites or services that are not owned or controlled by us.<br />- We have no control over, and assume no responsibility for, the content, privacy policies, or practices of any third party websites or services. You further acknowledge and agree that the Company shall not be responsible or liable, directly or indirectly, for any damage or loss caused or alleged to be caused by or in connection with the use of or reliance on any such content, goods or services available on or through any such websites or services.+ We have no control over, and assume no responsibility for, the content, privacy policies, or practices of any+ third party websites or services. You further acknowledge and agree that the Company shall not be responsible+ or liable, directly or indirectly, for any damage or loss caused or alleged to be caused by or in connection+ with the use of or reliance on any such content, goods or services available on or through any such websites+ or services.<br />- We strongly advise you to read the terms and conditions and privacy policies of any third-party websites or services that you visit.+ We strongly advise you to read the terms and conditions and privacy policies of any third-party websites or+ services that you visit.</p><h3 className='text-2xl font-bold text-gray-900 dark:text-gray-50 tracking-tight mt-4'>License grant to us</h3><p className='text-lg text-gray-900 dark:text-gray-50 tracking-tight'>- By submitting, posting, or publishing your content, suggestions, enhancement requests, recommendations, feedback, information, data, or comments (“Content”) to our Service, you are granting us a perpetual, irrevocable, worldwide, non-exclusive, royalty-free right and license (with the right to sublicense) to use, incorporate, exploit, display, perform, reproduce, distribute, and prepare derivative works of your Content. You will retain ownership of your Content, however, any use of your Content by us may be without any compensation paid to you. By submitting, posting, and publishing your Content, you represent and warrant that your Content, does not: (i) infringe, violate, or misappropriate any third-party right, including any copyright, trademark, patent, trade secret, moral right, privacy right, right of publicity, or any other intellectual property or proprietary right; or (ii) slander, defame, or libel any third-party.+ By submitting, posting, or publishing your content, suggestions, enhancement requests, recommendations,+ feedback, information, data, or comments (“Content”) to our Service, you are granting us a perpetual,+ irrevocable, worldwide, non-exclusive, royalty-free right and license (with the right to sublicense) to use,+ incorporate, exploit, display, perform, reproduce, distribute, and prepare derivative works of your Content.+ You will retain ownership of your Content, however, any use of your Content by us may be without any+ compensation paid to you. By submitting, posting, and publishing your Content, you represent and warrant that+ your Content, does not: (i) infringe, violate, or misappropriate any third-party right, including any+ copyright, trademark, patent, trade secret, moral right, privacy right, right of publicity, or any other+ intellectual property or proprietary right; or (ii) slander, defame, or libel any third-party.</p><h3 className='text-2xl font-bold text-gray-900 dark:text-gray-50 tracking-tight mt-4'>Prohibited uses</h3><p className='text-lg text-gray-900 dark:text-gray-50 tracking-tight'>- As a condition of your use of the Service, you will not use the Service for any purpose that is unlawful or prohibited by these Terms. You may not use the Service in any manner that could damage, disable, overburden, disrupt or impair any of our servers or APIs, or any networks connected to any of our server or APIs, or that could interfere with any other party's use and enjoyment of any Service. You may not transmit any viruses, worms, defects, Trojan horses, or any items of a destructive nature through your use of Service. You may not exceed or circumvent, or try to exceed or circumvent, limitations on the Service, including on any API calls, or otherwise use the Service in a manner that violates any Swetrix documentation or user manuals. You may not attempt to gain unauthorized access to any Service, other accounts, computer systems, or networks connected to any Swetrix server or to any of the Service through hacking, password mining, or any other means. You may not obtain or attempt to obtain any materials or information through any means not intentionally made available through the Service. You may not use the Service in any way that violates any applicable federal, state, local, or international law or regulation (including, without limitation, any laws regarding the export of data or software to and from the US or other countries).+ As a condition of your use of the Service, you will not use the Service for any purpose that is unlawful or+ prohibited by these Terms. You may not use the Service in any manner that could damage, disable, overburden,+ disrupt or impair any of our servers or APIs, or any networks connected to any of our server or APIs, or that+ could interfere with any other party's use and enjoyment of any Service. You may not transmit any viruses,+ worms, defects, Trojan horses, or any items of a destructive nature through your use of Service. You may not+ exceed or circumvent, or try to exceed or circumvent, limitations on the Service, including on any API calls,+ or otherwise use the Service in a manner that violates any Swetrix documentation or user manuals. You may not+ attempt to gain unauthorized access to any Service, other accounts, computer systems, or networks connected to+ any Swetrix server or to any of the Service through hacking, password mining, or any other means. You may not+ obtain or attempt to obtain any materials or information through any means not intentionally made available+ through the Service. You may not use the Service in any way that violates any applicable federal, state,+ local, or international law or regulation (including, without limitation, any laws regarding the export of+ data or software to and from the US or other countries).<br />- Our Service is not intended for providing alerts on disaster scenarios or any other situations related to health or safety in any way. This includes but is not limited to natural disasters, acts of terrorism, or emergency responses, and you shall not use our Service for any such purposes.+ Our Service is not intended for providing alerts on disaster scenarios or any other situations related to+ health or safety in any way. This includes but is not limited to natural disasters, acts of terrorism, or+ emergency responses, and you shall not use our Service for any such purposes.</p>- <h3 className='text-2xl font-bold text-gray-900 dark:text-gray-50 tracking-tight mt-4'>Limitation of liability</h3>+ <h3 className='text-2xl font-bold text-gray-900 dark:text-gray-50 tracking-tight mt-4'>+ Limitation of liability+ </h3><p className='text-lg text-gray-900 dark:text-gray-50 tracking-tight'>- IN NO EVENT WILL THE COMPANY ENTITIES BE LIABLE TO YOU OR ANY THIRD PARTY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL, OR PUNITIVE DAMAGES ARISING OUT OF OR RELATING TO YOUR ACCESS TO OR USE OF, OR YOUR INABILITY TO ACCESS OR USE, THE SERVICE OR ANY MATERIALS OR CONTENT ON THE SERVICE, WHETHER BASED ON WARRANTY, CONTRACT, TORT (INCLUDING NEGLIGENCE), STATUTE, OR ANY OTHER LEGAL THEORY, WHETHER OR NOT THE COMPANY ENTITIES HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGE.+ IN NO EVENT WILL THE COMPANY ENTITIES BE LIABLE TO YOU OR ANY THIRD PARTY FOR ANY DIRECT, INDIRECT,+ INCIDENTAL, SPECIAL, CONSEQUENTIAL, OR PUNITIVE DAMAGES ARISING OUT OF OR RELATING TO YOUR ACCESS TO OR USE+ OF, OR YOUR INABILITY TO ACCESS OR USE, THE SERVICE OR ANY MATERIALS OR CONTENT ON THE SERVICE, WHETHER BASED+ ON WARRANTY, CONTRACT, TORT (INCLUDING NEGLIGENCE), STATUTE, OR ANY OTHER LEGAL THEORY, WHETHER OR NOT THE+ COMPANY ENTITIES HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGE.</p>- <h3 className='text-2xl font-bold text-gray-900 dark:text-gray-50 tracking-tight mt-4'>Disclaimers; no warranties</h3>+ <h3 className='text-2xl font-bold text-gray-900 dark:text-gray-50 tracking-tight mt-4'>+ Disclaimers; no warranties+ </h3><p className='text-lg text-gray-900 dark:text-gray-50 tracking-tight'>- THE SERVICE ARE MADE AVAILABLE TO YOU ON AN "AS IS" AND "AS AVAILABLE" BASIS, WITH THE EXPRESS UNDERSTANDING THAT THE COMPANY ENTITIES HAVE NO OBLIGATION TO MONITOR, CONTROL, OR VET THE CONTENT OR DATA APPEARING ON THE SERVICE. AS SUCH, YOUR USE OF THE SERVICE IS AT YOUR OWN DISCRETION AND RISK. THE COMPANY ENTITIES MAKE NO CLAIMS OR PROMISES ABOUT THE QUALITY, ACCURACY, OR RELIABILITY OF THE SERVICE AND EXPRESSLY DISCLAIM ALL WARRANTIES, WHETHER EXPRESS OR IMPLIED, INCLUDING IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.+ THE SERVICE ARE MADE AVAILABLE TO YOU ON AN "AS IS" AND "AS AVAILABLE" BASIS, WITH THE EXPRESS UNDERSTANDING+ THAT THE COMPANY ENTITIES HAVE NO OBLIGATION TO MONITOR, CONTROL, OR VET THE CONTENT OR DATA APPEARING ON THE+ SERVICE. AS SUCH, YOUR USE OF THE SERVICE IS AT YOUR OWN DISCRETION AND RISK. THE COMPANY ENTITIES MAKE NO+ CLAIMS OR PROMISES ABOUT THE QUALITY, ACCURACY, OR RELIABILITY OF THE SERVICE AND EXPRESSLY DISCLAIM ALL+ WARRANTIES, WHETHER EXPRESS OR IMPLIED, INCLUDING IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A+ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.</p><h3 className='text-2xl font-bold text-gray-900 dark:text-gray-50 tracking-tight mt-4'>Accounts</h3><p className='text-lg text-gray-900 dark:text-gray-50 tracking-tight'>- When you create an account with us, you must provide us information that is accurate, complete, and current at all times. Failure to do so constitutes a breach of the Terms, which may result in immediate termination of your account on our Service.+ When you create an account with us, you must provide us information that is accurate, complete, and current at+ all times. Failure to do so constitutes a breach of the Terms, which may result in immediate termination of+ your account on our Service.<br />- You are responsible for safeguarding the password that you use to access the Service and for any activities or actions under your password, whether your password is with our Service or a third-party service.+ You are responsible for safeguarding the password that you use to access the Service and for any activities or+ actions under your password, whether your password is with our Service or a third-party service.<br />- You agree not to disclose your password to any third party. You must notify us immediately upon becoming aware of any breach of security or unauthorized use of your account.+ You agree not to disclose your password to any third party. You must notify us immediately upon becoming aware+ of any breach of security or unauthorized use of your account.<br />- You may not use as a username the name of another person or entity or that is not lawfully available for use, a name or trademark that is subject to any rights of another person or entity other than you without appropriate authorization, or a name that is otherwise offensive, vulgar or obscene.+ You may not use as a username the name of another person or entity or that is not lawfully available for use,+ a name or trademark that is subject to any rights of another person or entity other than you without+ appropriate authorization, or a name that is otherwise offensive, vulgar or obscene.</p><h3 className='text-2xl font-bold text-gray-900 dark:text-gray-50 tracking-tight mt-4'>Subscriptions</h3><p className='text-lg text-gray-900 dark:text-gray-50 tracking-tight'>- Some parts of the Service are billed on a subscription basis ("Subscription(s)"). You will be billed in advance on a recurring and periodic basis ("Billing Cycle"). Billing cycles are set either on a monthly or annual basis, depending on the type of subscription plan you select when purchasing a Subscription.+ Some parts of the Service are billed on a subscription basis ("Subscription(s)"). You will be billed in+ advance on a recurring and periodic basis ("Billing Cycle"). Billing cycles are set either on a monthly or+ annual basis, depending on the type of subscription plan you select when purchasing a Subscription.<br />- At the end of each Billing Cycle, your Subscription will automatically renew under the exact same conditions unless you cancel it or we cancel it. You may cancel your Subscription renewal either through your online account management page or by contacting our customer support team.+ At the end of each Billing Cycle, your Subscription will automatically renew under the exact same conditions+ unless you cancel it or we cancel it. You may cancel your Subscription renewal either through your online+ account management page or by contacting our customer support team.<br />- A valid payment method, including credit card, is required to process the payment for your Subscription. You shall provide us with accurate and complete billing information including full name, address, state, zip code, telephone number, and a valid payment method information. By submitting such payment information, you automatically authorize us to charge all Subscription fees incurred through your account to any such payment instruments.+ A valid payment method, including credit card, is required to process the payment for your Subscription. You+ shall provide us with accurate and complete billing information including full name, address, state, zip code,+ telephone number, and a valid payment method information. By submitting such payment information, you+ automatically authorize us to charge all Subscription fees incurred through your account to any such payment+ instruments.<br />- Should automatic billing fail to occur for any reason, we may issue an electronic invoice indicating that you must proceed manually, within a certain deadline date, with the full payment corresponding to the billing period as indicated on the invoice.+ Should automatic billing fail to occur for any reason, we may issue an electronic invoice indicating that you+ must proceed manually, within a certain deadline date, with the full payment corresponding to the billing+ period as indicated on the invoice.</p><h3 className='text-2xl font-bold text-gray-900 dark:text-gray-50 tracking-tight mt-4'>Fee changes</h3><p className='text-lg text-gray-900 dark:text-gray-50 tracking-tight'>- We may, at our sole discretion and at any time, modify the Subscription fees for the Subscriptions. Any Subscription fee change will become effective at the end of the then-current Billing Cycle.+ We may, at our sole discretion and at any time, modify the Subscription fees for the Subscriptions. Any+ Subscription fee change will become effective at the end of the then-current Billing Cycle.<br />- We will provide you with a reasonable prior notice of any change in Subscription fees to give you an opportunity to terminate your Subscription before such change becomes effective.+ We will provide you with a reasonable prior notice of any change in Subscription fees to give you an+ opportunity to terminate your Subscription before such change becomes effective.<br />- Your continued use of the Service after the Subscription fee change comes into effect constitutes your agreement to pay the modified Subscription fee amount.+ Your continued use of the Service after the Subscription fee change comes into effect constitutes your+ agreement to pay the modified Subscription fee amount.</p><h3 className='text-2xl font-bold text-gray-900 dark:text-gray-50 tracking-tight mt-4'>Refunds</h3><p className='text-lg text-gray-900 dark:text-gray-50 tracking-tight'>- To avoid being charged for your Subscription, you must cancel the Subscription before your renewal date. Otherwise, you’ll be charged and will retain access to the Service through the end of the Billing Cycle.+ To avoid being charged for your Subscription, you must cancel the Subscription before your renewal date.+ Otherwise, you’ll be charged and will retain access to the Service through the end of the Billing Cycle.<br />- Except when required by law, paid Subscription fees are non-refundable. However, you may contact our support team and at our sole discretion we may issue a refund on a case-by-case basis.+ Except when required by law, paid Subscription fees are non-refundable. However, you may contact our support+ team and at our sole discretion we may issue a refund on a case-by-case basis.</p>{/* <h3 className='text-2xl font-bold text-gray-900 tracking-tight mt-4'>Service Level Agreement (SLA)</h3>@@ -133,52 +224,80 @@ const Features = (): JSX.Element => {<h3 className='text-2xl font-bold text-gray-900 dark:text-gray-50 tracking-tight mt-4'>Governing Law</h3><p className='text-lg text-gray-900 dark:text-gray-50 tracking-tight'>- These Terms shall be governed and construed in accordance with the laws of Ukraine, without regard to its conflict of law provisions.+ These Terms shall be governed and construed in accordance with the laws of Ukraine, without regard to its+ conflict of law provisions.<br />- Our failure to enforce any right or provision of these Terms will not be considered a waiver of those rights. If any provision of these Terms is held to be invalid or unenforceable by a court, the remaining provisions of these Terms will remain in effect. These Terms constitute the entire agreement between us regarding our Service, and supersede and replace any prior agreements we might have between us regarding the Service.+ Our failure to enforce any right or provision of these Terms will not be considered a waiver of those rights.+ If any provision of these Terms is held to be invalid or unenforceable by a court, the remaining provisions of+ these Terms will remain in effect. These Terms constitute the entire agreement between us regarding our+ Service, and supersede and replace any prior agreements we might have between us regarding the Service.</p><h3 className='text-2xl font-bold text-gray-900 dark:text-gray-50 tracking-tight mt-4'>Disputes resolution</h3><p className='text-lg text-gray-900 dark:text-gray-50 tracking-tight'>- If you have any concern or dispute about the Service, you agree to first try to resolve the dispute informally by contacting the Company.+ If you have any concern or dispute about the Service, you agree to first try to resolve the dispute informally+ by contacting the Company.</p>- <h3 className='text-2xl font-bold text-gray-900 dark:text-gray-50 tracking-tight mt-4'>For European Union (EU) users</h3>+ <h3 className='text-2xl font-bold text-gray-900 dark:text-gray-50 tracking-tight mt-4'>+ For European Union (EU) users+ </h3><p className='text-lg text-gray-900 dark:text-gray-50 tracking-tight'>- If You are a European Union consumer, you will benefit from any mandatory provisions of the law of the country in which you are resident in.+ If You are a European Union consumer, you will benefit from any mandatory provisions of the law of the country+ in which you are resident in.</p>- <h3 className='text-2xl font-bold text-gray-900 dark:text-gray-50 tracking-tight mt-4'>United States Legal Compliance</h3>+ <h3 className='text-2xl font-bold text-gray-900 dark:text-gray-50 tracking-tight mt-4'>+ United States Legal Compliance+ </h3><p className='text-lg text-gray-900 dark:text-gray-50 tracking-tight'>- You represent and warrant that (i) you are not located in a country that is subject to the United States government embargo, or that has been designated by the United States government as a "terrorist supporting" country, and (ii) You are not listed on any United States government list of prohibited or restricted parties.+ You represent and warrant that (i) you are not located in a country that is subject to the United States+ government embargo, or that has been designated by the United States government as a "terrorist supporting"+ country, and (ii) You are not listed on any United States government list of prohibited or restricted parties.</p><h3 className='text-2xl font-bold text-gray-900 dark:text-gray-50 tracking-tight mt-4'>Severability</h3><p className='text-lg text-gray-900 dark:text-gray-50 tracking-tight'>- If any provision of these Terms is held to be unenforceable or invalid, such provision will be changed and interpreted to accomplish the objectives of such provision to the greatest extent possible under applicable law and the remaining provisions will continue in full force and effect.+ If any provision of these Terms is held to be unenforceable or invalid, such provision will be changed and+ interpreted to accomplish the objectives of such provision to the greatest extent possible under applicable+ law and the remaining provisions will continue in full force and effect.</p><h3 className='text-2xl font-bold text-gray-900 dark:text-gray-50 tracking-tight mt-4'>Waiver</h3><p className='text-lg text-gray-900 dark:text-gray-50 tracking-tight'>- Except as provided herein, the failure to exercise a right or to require performance of an obligation under this Agreement shall not affect a party’s ability to exercise such right or require such performance at any time thereafter, nor shall the waiver of a breach constitute the waiver of any subsequent breach.+ Except as provided herein, the failure to exercise a right or to require performance of an obligation under+ this Agreement shall not affect a party’s ability to exercise such right or require such performance at any+ time thereafter, nor shall the waiver of a breach constitute the waiver of any subsequent breach.</p>- <h3 className='text-2xl font-bold text-gray-900 dark:text-gray-50 tracking-tight mt-4'>Translation interpretation</h3>+ <h3 className='text-2xl font-bold text-gray-900 dark:text-gray-50 tracking-tight mt-4'>+ Translation interpretation+ </h3><p className='text-lg text-gray-900 dark:text-gray-50 tracking-tight'>- These Terms and Conditions may have been translated if we have made them available to you on our Service. You agree that the original English text shall prevail in the case of a dispute.+ These Terms and Conditions may have been translated if we have made them available to you on our Service. You+ agree that the original English text shall prevail in the case of a dispute.</p>- <h3 className='text-2xl font-bold text-gray-900 dark:text-gray-50 tracking-tight mt-4'>Changes to these Terms and Conditions</h3>+ <h3 className='text-2xl font-bold text-gray-900 dark:text-gray-50 tracking-tight mt-4'>+ Changes to these Terms and Conditions+ </h3><p className='text-lg text-gray-900 dark:text-gray-50 tracking-tight'>- We reserve the right, at our sole discretion, to modify or replace these Terms and Conditions at any time. If a revision is material we will make reasonable efforts to provide at least 30 days' notice prior to any new terms taking effect. What constitutes a material change will be determined at our sole discretion.+ We reserve the right, at our sole discretion, to modify or replace these Terms and Conditions at any time. If+ a revision is material we will make reasonable efforts to provide at least 30 days' notice prior to any new+ terms taking effect. What constitutes a material change will be determined at our sole discretion.<br />- By continuing to access or use our Service after those revisions become effective, you agree to be bound by the revised terms. If you do not agree to the new terms, in whole or in part, please stop using the website and the Service.+ By continuing to access or use our Service after those revisions become effective, you agree to be bound by+ the revised terms. If you do not agree to the new terms, in whole or in part, please stop using the website+ and the Service.</p><h3 className='text-2xl font-bold text-gray-900 dark:text-gray-50 tracking-tight mt-4'>Contact us</h3><p className='text-lg text-gray-900 dark:text-gray-50 tracking-tight'>If you have any questions you can contact us by sending us an email at - <a href={`mailto:${CONTACT_EMAIL}`} className='font-medium text-indigo-600 hover:text-indigo-500 dark:text-indigo-400 dark:hover:text-indigo-500'>+ <a+ href={`mailto:${CONTACT_EMAIL}`}+ className='font-medium text-indigo-600 hover:text-indigo-500 dark:text-indigo-400 dark:hover:text-indigo-500'+ >{CONTACT_EMAIL}</a>.diff --git a/app/pages/UserSettings/UserSettings.container.tsx b/app/pages/UserSettings/UserSettings.container.tsxindex 0327b4566..29e933a5b 100644--- a/app/pages/UserSettings/UserSettings.container.tsx+++ b/app/pages/UserSettings/UserSettings.container.tsx@@ -36,16 +36,17 @@ const mapDispatchToProps = (dispatch: AppDispatch) => ({t: (key: string) => string,deletionFeedback: string,onSuccess: {- (): void;+ (): void},) => {dispatch(sagaActions.deleteAccountAsync(- (error: string) => dispatch(- errorsActions.deleteAccountFailed({- message: error,- }),- ),+ (error: string) =>+ dispatch(+ errorsActions.deleteAccountFailed({+ message: error,+ }),+ ),() => {trackCustom('ACCOUNT_DELETED')onSuccess()@@ -70,10 +71,12 @@ const mapDispatchToProps = (dispatch: AppDispatch) => ({)},setCache: (key: string, value: any) => {- dispatch(UIActions.setCache({- key,- value,- }))+ dispatch(+ UIActions.setCache({+ key,+ value,+ }),+ )},sharedProjectError: (message: string) => {dispatch(@@ -135,7 +138,7 @@ const mapDispatchToProps = (dispatch: AppDispatch) => ({updateUserProfileAsync: (data: Partial<IUser>,successMessage: string,- callback: (isSuccess: boolean) => void = () => { },+ callback: (isSuccess: boolean) => void = () => {},) => {dispatch(sagaActions.updateUserProfileAsync(data, (res: any) => {@@ -157,24 +160,13 @@ const mapDispatchToProps = (dispatch: AppDispatch) => ({// setThemeType: (theme) => {// dispatch(UIActions.setThemeType(theme))// },- linkSSO: (- t: (key: string) => string,- callback: (e: any) => void,- provider: string,- ) => {+ linkSSO: (t: (key: string) => string, callback: (e: any) => void, provider: string) => {dispatch(sagaActions.linkSSO(t, callback, provider))},- unlinkSSO: (- t: (key: string) => string,- callback: (e: any) => void,- provider: string,- ) => {+ unlinkSSO: (t: (key: string) => string, callback: (e: any) => void, provider: string) => {dispatch(sagaActions.unlinkSSO(t, callback, provider))},- updateShowLiveVisitorsInTitle: (- show: boolean,- callback: (isSuccess: boolean) => void,- ) => {+ updateShowLiveVisitorsInTitle: (show: boolean, callback: (isSuccess: boolean) => void) => {dispatch(sagaActions.updateShowLiveVisitorsInTitle(show, callback))},// Reset the user in the regex store and remove tokensdiff --git a/app/pages/UserSettings/UserSettings.tsx b/app/pages/UserSettings/UserSettings.tsxindex c7c2de2d5..eae2ee4a3 100644--- a/app/pages/UserSettings/UserSettings.tsx+++ b/app/pages/UserSettings/UserSettings.tsx@@ -1,7 +1,5 @@/* eslint-disable no-param-reassign, react/forbid-prop-types */-import React, {- useState, useEffect, memo, useRef, useMemo,-} from 'react'+import React, { useState, useEffect, memo, useRef, useMemo } from 'react'import { useNavigate } from '@remix-run/react'import { ClientOnly } from 'remix-utils'import { useTranslation } from 'react-i18next'@@ -52,11 +50,7 @@ import PaidFeature from 'modals/PaidFeature'import TimezonePicker from 'ui/TimezonePicker'import Textarea from 'ui/Textarea'import Loader from 'ui/Loader'-import {- isValidEmail,- isValidPassword,- MIN_PASSWORD_CHARS,-} from 'utils/validator'+import { isValidEmail, isValidPassword, MIN_PASSWORD_CHARS } from 'utils/validator'import routes from 'routesPath'import { trackCustom } from 'utils/analytics'import { getCookie, setCookie } from 'utils/cookie'@@ -85,7 +79,7 @@ const TAB_MAPPING = {COMMUNICATIONS: 'communications',}-const getTabs = (t: (key: string) => string) => ([+const getTabs = (t: (key: string) => string) => [{id: TAB_MAPPING.ACCOUNT,label: t('profileSettings.account'),@@ -106,52 +100,74 @@ const getTabs = (t: (key: string) => string) => ([label: t('profileSettings.referral.title'),icon: CursorArrowRaysIcon,},-])+]interface IProps {- onDelete: (t: (key: string) => string, deletionFeedback: string, callback: () => void) => void,- onDeleteProjectCache: () => void,- removeProject: (id: string) => void,- removeShareProject: (id: string) => void,- setUserShareData: (data: Partial<ISharedProject>, id: string) => void,- setProjectsShareData: (data: Partial<ISharedProject>, id: string) => void,- userSharedUpdate: (message: string) => void,- sharedProjectError: (message: string) => void,- updateUserData: (data: Partial<IUser>) => void,- genericError: (message: string) => void,- onGDPRExportFailed: (message: string) => void,- updateProfileFailed: (message: string) => void,- updateUserProfileAsync: (data: IUser, successMessage: string, callback?: (isSuccess: boolean) => void) => void,- accountUpdated: (t: string) => void,- setAPIKey: (key: string | null) => void,- user: IUser,- dontRemember: boolean,- isPaidTierUsed: boolean,- linkSSO: (t: (key: string) => string, callback: (e: any) => void, provider: string) => void,- unlinkSSO: (t: (key: string) => string, callback: (e: any) => void, provider: string) => void,- theme: string,- updateShowLiveVisitorsInTitle: (show: boolean, callback: (isSuccess: boolean) => void) => void,- logoutLocal: () => void,- logoutAll: () => void,- loading: boolean,- setCache: (key: string, value: any) => void,- activeReferrals: any[],- referralStatistics: any,+ onDelete: (t: (key: string) => string, deletionFeedback: string, callback: () => void) => void+ onDeleteProjectCache: () => void+ removeProject: (id: string) => void+ removeShareProject: (id: string) => void+ setUserShareData: (data: Partial<ISharedProject>, id: string) => void+ setProjectsShareData: (data: Partial<ISharedProject>, id: string) => void+ userSharedUpdate: (message: string) => void+ sharedProjectError: (message: string) => void+ updateUserData: (data: Partial<IUser>) => void+ genericError: (message: string) => void+ onGDPRExportFailed: (message: string) => void+ updateProfileFailed: (message: string) => void+ updateUserProfileAsync: (data: IUser, successMessage: string, callback?: (isSuccess: boolean) => void) => void+ accountUpdated: (t: string) => void+ setAPIKey: (key: string | null) => void+ user: IUser+ dontRemember: boolean+ isPaidTierUsed: boolean+ linkSSO: (t: (key: string) => string, callback: (e: any) => void, provider: string) => void+ unlinkSSO: (t: (key: string) => string, callback: (e: any) => void, provider: string) => void+ theme: string+ updateShowLiveVisitorsInTitle: (show: boolean, callback: (isSuccess: boolean) => void) => void+ logoutLocal: () => void+ logoutAll: () => void+ loading: boolean+ setCache: (key: string, value: any) => void+ activeReferrals: any[]+ referralStatistics: any}interface IForm extends Partial<IUser> {- repeat: string;- password: string;- email: string;+ repeat: string+ password: string+ email: string}const UserSettings = ({- onDelete, onDeleteProjectCache, removeProject, removeShareProject, setUserShareData,- setProjectsShareData, userSharedUpdate, sharedProjectError, updateUserData,- genericError, onGDPRExportFailed, updateProfileFailed, updateUserProfileAsync,- accountUpdated, setAPIKey, user, dontRemember, isPaidTierUsed, // setThemeType, themeType,- linkSSO, unlinkSSO, theme, updateShowLiveVisitorsInTitle, logoutAll, loading, logoutLocal,- referralStatistics, activeReferrals, setCache,+ onDelete,+ onDeleteProjectCache,+ removeProject,+ removeShareProject,+ setUserShareData,+ setProjectsShareData,+ userSharedUpdate,+ sharedProjectError,+ updateUserData,+ genericError,+ onGDPRExportFailed,+ updateProfileFailed,+ updateUserProfileAsync,+ accountUpdated,+ setAPIKey,+ user,+ dontRemember,+ isPaidTierUsed, // setThemeType, themeType,+ linkSSO,+ unlinkSSO,+ theme,+ updateShowLiveVisitorsInTitle,+ logoutAll,+ loading,+ logoutLocal,+ referralStatistics,+ activeReferrals,+ setCache,}: IProps): JSX.Element => {const navigate = useNavigate()const {@@ -160,9 +176,9 @@ const UserSettings = ({t: (key: string,options?: {- [key: string]: string | number | null;- }- ) => string;+ [key: string]: string | number | null+ },+ ) => string} = useTranslation('common')const [activeTab, setActiveTab] = useState<string>(TAB_MAPPING.ACCOUNT)const [form, setForm] = useState<IForm>({@@ -172,19 +188,15 @@ const UserSettings = ({timeFormat: user.timeFormat || TimeFormat['12-hour'],})const [showPasswordFields, setShowPasswordFields] = useState<boolean>(false)- const [timezone, setTimezone] = useState<string>(- user.timezone || DEFAULT_TIMEZONE,- )+ const [timezone, setTimezone] = useState<string>(user.timezone || DEFAULT_TIMEZONE)const [isPaidFeatureOpened, setIsPaidFeatureOpened] = useState<boolean>(false)const [isPasswordChangeModalOpened, setIsPasswordChangeModalOpened] = useState<boolean>(false)const [timezoneChanged, setTimezoneChanged] = useState<boolean>(false)- const [reportFrequency, setReportFrequency] = useState<string>(- user.reportFrequency,- )+ const [reportFrequency, setReportFrequency] = useState<string>(user.reportFrequency)const [formPresetted, setFormPresetted] = useState<boolean>(false)const [validated, setValidated] = useState<boolean>(false)const [errors, setErrors] = useState<{- [key: string]: string;+ [key: string]: string}>({})const [beenSubmitted, setBeenSubmitted] = useState<boolean>(false)const [showModal, setShowModal] = useState<boolean>(false)@@ -200,11 +212,11 @@ const UserSettings = ({const copyTimerRef = useRef(null)const tabs = getTabs(t)- const activeTabLabel = useMemo(() => _find(tabs, tab => tab.id === activeTab)?.label, [tabs, activeTab])+ const activeTabLabel = useMemo(() => _find(tabs, (tab) => tab.id === activeTab)?.label, [tabs, activeTab])const validate = () => {const allErrors = {} as {- [key: string]: string;+ [key: string]: string}if (!isValidEmail(form.email)) {@@ -227,7 +239,7 @@ const UserSettings = ({setValidated(valid)}- const onSubmit = (data: any, callback: (isSuccess: boolean) => void = () => { }) => {+ const onSubmit = (data: any, callback: (isSuccess: boolean) => void = () => {}) => {delete data.repeat// eslint-disable-next-line no-restricted-syntax@@ -242,7 +254,7 @@ const UserSettings = ({useEffect(() => {validate()- }, [form]); // eslint-disable-line+ }, [form]) // eslint-disable-lineuseEffect(() => {return () => {@@ -253,7 +265,7 @@ const UserSettings = ({useEffect(() => {if (!loading && !formPresetted) {- setForm(prev => ({+ setForm((prev) => ({...prev,email: user.email || '',timeFormat: user.timeFormat || TimeFormat['12-hour'],@@ -279,7 +291,11 @@ const UserSettings = ({}))}- const handleSubmit = (e: React.FormEvent<HTMLFormElement> | null, force?: boolean, callback: (isSuccess: boolean) => void = () => { }) => {+ const handleSubmit = (+ e: React.FormEvent<HTMLFormElement> | null,+ force?: boolean,+ callback: (isSuccess: boolean) => void = () => {},+ ) => {if (e) {e.preventDefault()e.stopPropagation()@@ -287,7 +303,7 @@ const UserSettings = ({setBeenSubmitted(true)if (validated) {- // User is about to change their password, let's warn him if+ // User is about to change their password, let's warn him ifif (form.password && !force) {setIsPasswordChangeModalOpened(true)return@@ -313,9 +329,7 @@ const UserSettings = ({}}- const handleShowLiveVisitorsSave = (- e: React.ChangeEvent<HTMLInputElement>,- ) => {+ const handleShowLiveVisitorsSave = (e: React.ChangeEvent<HTMLInputElement>) => {if (settingUpdating) {return}@@ -335,9 +349,7 @@ const UserSettings = ({})}- const handleReceiveLoginNotifications = async (- e: React.ChangeEvent<HTMLInputElement>,- ) => {+ const handleReceiveLoginNotifications = async (e: React.ChangeEvent<HTMLInputElement>) => {if (settingUpdating) {return}@@ -359,7 +371,7 @@ const UserSettings = ({}}- const handleIntegrationSave = (data: any, callback = () => { }) => {+ const handleIntegrationSave = (data: any, callback = () => {}) => {setBeenSubmitted(true)if (validated) {@@ -394,10 +406,7 @@ const UserSettings = ({}const reportIconExtractor = (_: any, index: number) => {- if (- !isPaidTierUsed- && reportFrequencies[index] === WEEKLY_REPORT_FREQUENCY- ) {+ if (!isPaidTierUsed && reportFrequencies[index] === WEEKLY_REPORT_FREQUENCY) {return <CurrencyDollarIcon className='w-5 h-5 mr-1' />}@@ -424,12 +433,8 @@ const UserSettings = ({const onExport = async (exportedAt: string) => {try {if (- getCookie(GDPR_REQUEST)- || (!_isNull(exportedAt)- && !dayjs().isAfter(- dayjs.utc(exportedAt).add(GDPR_EXPORT_TIMEFRAME, 'day'),- 'day',- ))+ getCookie(GDPR_REQUEST) ||+ (!_isNull(exportedAt) && !dayjs().isAfter(dayjs.utc(exportedAt).add(GDPR_EXPORT_TIMEFRAME, 'day'), 'day'))) {onGDPRExportFailed(t('profileSettings.tryAgainInXDays', {@@ -517,9 +522,7 @@ const UserSettings = ({return (<div className='min-h-min-footer bg-gray-50 dark:bg-slate-900 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-bold text-gray-900 dark:text-gray-50'>- {t('titles.profileSettings')}- </h2>+ <h2 className='mt-2 text-3xl font-bold text-gray-900 dark:text-gray-50'>{t('titles.profileSettings')}</h2>{/* Tabs selector */}<div className='mt-2'><div className='sm:hidden'>@@ -540,7 +543,7 @@ const UserSettings = ({<div className='hidden sm:block'><div><nav className='-mb-px flex space-x-4' aria-label='Tabs'>- {_map(tabs, tab => {+ {_map(tabs, (tab) => {const isCurrent = tab.id === activeTabconst onClick = () => {@@ -551,22 +554,26 @@ const UserSettings = ({<divkey={tab.id}onClick={onClick}- className={cx('group inline-flex items-center whitespace-nowrap py-2 px-1 border-b-2 font-bold text-md cursor-pointer', {- 'border-slate-900 text-slate-900 dark:text-gray-50 dark:border-gray-50': isCurrent,- 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300 dark:text-gray-400 dark:hover:border-gray-300 dark:hover:text-gray-300': !isCurrent,- })}+ className={cx(+ 'group inline-flex items-center whitespace-nowrap py-2 px-1 border-b-2 font-bold text-md cursor-pointer',+ {+ 'border-slate-900 text-slate-900 dark:text-gray-50 dark:border-gray-50': isCurrent,+ 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300 dark:text-gray-400 dark:hover:border-gray-300 dark:hover:text-gray-300':+ !isCurrent,+ },+ )}aria-current={isCurrent ? 'page' : undefined}><tab.iconclassName={cx(- isCurrent ? 'text-slate-900 dark:text-gray-50' : 'text-gray-500 group-hover:text-gray-500 dark:text-gray-400 dark:group-hover:text-gray-300',+ isCurrent+ ? 'text-slate-900 dark:text-gray-50'+ : 'text-gray-500 group-hover:text-gray-500 dark:text-gray-400 dark:group-hover:text-gray-300','-ml-0.5 mr-2 h-5 w-5',)}aria-hidden='true'/>- <span>- {tab.label}- </span>+ <span>{tab.label}</span></div>)})}@@ -574,11 +581,7 @@ const UserSettings = ({</div></div></div>- <ClientOnly- fallback={(- <Loader />- )}- >+ <ClientOnly fallback={<Loader />}>{() => {if (loading) {return <Loader />@@ -725,7 +728,10 @@ const UserSettings = ({{/* Socialisations setup */}<hr className='mt-5 border-gray-200 dark:border-gray-600' />- <h3 id='socialisations' className='flex items-center mt-2 text-lg font-bold text-gray-900 dark:text-gray-50'>+ <h3+ id='socialisations'+ className='flex items-center mt-2 text-lg font-bold text-gray-900 dark:text-gray-50'+ >{t('profileSettings.socialisations')}</h3><Socialisations@@ -863,13 +869,12 @@ const UserSettings = ({label={t('profileSettings.selectTimeFormat')}className='w-full'items={translatedTimeFormat}- onSelect={(f) => setForm((prev) => ({- ...prev,- timeFormat:- timeFormatArray[- _findIndex(translatedTimeFormat, (freq) => freq === f)- ],- }))}+ onSelect={(f) =>+ setForm((prev) => ({+ ...prev,+ timeFormat: timeFormatArray[_findIndex(translatedTimeFormat, (freq) => freq === f)],+ }))+ }capitalise/></div>@@ -899,7 +904,6 @@ const UserSettings = ({if (activeTab === TAB_MAPPING.COMMUNICATIONS) {return (<>-{!isSelfhosted && (<>{/* Email reports frequency selector (e.g. monthly, weekly, etc.) */}@@ -914,9 +918,11 @@ const UserSettings = ({className='w-full'items={translatedFrequencies}iconExtractor={reportIconExtractor}- onSelect={(f) => _setReportFrequency(- reportFrequencies[_findIndex(translatedFrequencies, (freq) => freq === f)],- )}+ onSelect={(f) =>+ _setReportFrequency(+ reportFrequencies[_findIndex(translatedFrequencies, (freq) => freq === f)],+ )+ }capitalise/></div>@@ -927,7 +933,10 @@ const UserSettings = ({<hr className='mt-5 border-gray-200 dark:border-gray-600' />{/* Integrations setup */}- <h3 id='integrations' className='flex items-center mt-2 text-lg font-bold text-gray-900 dark:text-gray-50'>+ <h3+ id='integrations'+ className='flex items-center mt-2 text-lg font-bold text-gray-900 dark:text-gray-50'+ >{t('profileSettings.integrations')}</h3><Integrations@@ -956,7 +965,10 @@ const UserSettings = ({if (activeTab === TAB_MAPPING.REFERRALS) {return (<>- <h3 id='socialisations' className='flex items-center mt-2 text-lg font-bold text-gray-900 dark:text-gray-50'>+ <h3+ id='socialisations'+ className='flex items-center mt-2 text-lg font-bold text-gray-900 dark:text-gray-50'+ >{t('profileSettings.referral.title')}</h3><Referral@@ -977,10 +989,7 @@ const UserSettings = ({</ClientOnly></form>- <PaidFeature- isOpened={isPaidFeatureOpened}- onClose={() => setIsPaidFeatureOpened(false)}- />+ <PaidFeature isOpened={isPaidFeatureOpened} onClose={() => setIsPaidFeatureOpened(false)} /><ModalonClose={() => setShowExportModal(false)}onSubmit={() => {@@ -1008,7 +1017,7 @@ const UserSettings = ({title={t('profileSettings.qDelete')}submitType='danger'type='error'- message={(+ message={<>{t('profileSettings.deactivateConfirmation')}<Textarea@@ -1020,7 +1029,7 @@ const UserSettings = ({label={t('profileSettings.deletionFeedbackLabel')}/></>- )}+ }isOpened={showModal}/><Modaldiff --git a/app/pages/UserSettings/components/Integrations.tsx b/app/pages/UserSettings/components/Integrations.tsxindex 3bb0eac84..f86253c3a 100644--- a/app/pages/UserSettings/components/Integrations.tsx+++ b/app/pages/UserSettings/components/Integrations.tsx@@ -2,9 +2,7 @@ import React, { useState, memo } from 'react'import { useTranslation, Trans } from 'react-i18next'import _map from 'lodash/map'import _isString from 'lodash/isString'-import {- CheckCircleIcon, XCircleIcon, ClockIcon,-} from '@heroicons/react/24/solid'+import { CheckCircleIcon, XCircleIcon, ClockIcon } from '@heroicons/react/24/solid'import Input from 'ui/Input'import Button from 'ui/Button'@@ -12,33 +10,40 @@ import Telegram from 'ui/icons/Telegram'import { removeTgIntegration } from 'api'import { IUser } from 'redux/models/IUser'-const getAvailableIntegrations = (t: (key: string) => string): {- name: string,- key: string,- description: string,- Icon: React.FC<React.SVGProps<SVGSVGElement>>,-}[] => ([+const getAvailableIntegrations = (+ t: (key: string) => string,+): {+ name: string+ key: string+ description: string+ Icon: React.FC<React.SVGProps<SVGSVGElement>>+}[] => [{name: 'Telegram',key: 'telegram',description: t('profileSettings.integrationsList.telegram'),Icon: Telegram,},-])+]const TG_BOT_URL: string = 'https://t.me/swetrixbot'const TG_BOT_USERNAME: string = '@swetrixbot'const Integrations = ({- user, updateUserData, handleIntegrationSave, genericError,+ user,+ updateUserData,+ handleIntegrationSave,+ genericError,}: {- user: IUser,- updateUserData: (data: Partial<IUser>) => void,- handleIntegrationSave: (data: Partial<IUser>, cb: () => void) => void,- genericError: (message: string) => void,+ user: IUser+ updateUserData: (data: Partial<IUser>) => void+ handleIntegrationSave: (data: Partial<IUser>, cb: () => void) => void+ genericError: (message: string) => void}) => {- const { t }: {- t: (key: string) => string,+ const {+ t,+ }: {+ t: (key: string) => string} = useTranslation('common')const available = getAvailableIntegrations(t)const [integrationConfigurating, setIntegrationConfigurating] = useState<string | null>(null)@@ -57,12 +62,15 @@ const Integrations = ({if (key === 'telegram' && tgChatId) {setIsIntegrationLoading(true)- handleIntegrationSave({- telegramChatId: tgChatId,- }, () => {- setIsIntegrationLoading(false)- setIntegrationConfigurating(null)- })+ handleIntegrationSave(+ {+ telegramChatId: tgChatId,+ },+ () => {+ setIsIntegrationLoading(false)+ setIntegrationConfigurating(null)+ },+ )}}@@ -112,12 +120,7 @@ const Integrations = ({if (integrationConfigurating === 'telegram') {return (<>- <Button- className='mb-2 mt-2'- onClick={() => setIntegrationConfigurating(null)}- primary- small- >+ <Button className='mb-2 mt-2' onClick={() => setIntegrationConfigurating(null)} primary small>{t('common.goBack')}</Button><p className='text-base max-w-prose text-gray-900 dark:text-gray-50'>@@ -127,7 +130,14 @@ const Integrations = ({i18nKey='profileSettings.integrationsList.tgHint'components={{// eslint-disable-next-line jsx-a11y/anchor-has-content- url: <a href={TG_BOT_URL} className='hover:underline text-blue-600' target='_blank' rel='noreferrer noopener' />,+ url: (+ <a+ href={TG_BOT_URL}+ className='hover:underline text-blue-600'+ target='_blank'+ rel='noreferrer noopener'+ />+ ),}}values={{username: TG_BOT_USERNAME,@@ -163,64 +173,67 @@ const Integrations = ({return (<>- <p className='max-w-prose text-base text-gray-900 dark:text-gray-50'>- {t('profileSettings.integrationsDesc')}- </p>+ <p className='max-w-prose text-base text-gray-900 dark:text-gray-50'>{t('profileSettings.integrationsDesc')}</p><div className='overflow-hidden bg-white dark:bg-slate-800 mt-2 shadow sm:rounded-md'><ul className='divide-y divide-gray-200 dark:divide-slate-700'>- {- _map(available, ({- name, key, description, Icon,- }) => {- const { connected, confirmed, id } = getIntegrationStatus(key)- const status = connected ? (confirmed ? 'connected' : 'pending') : 'notConnected'-- return (- <li key={key}>- <div className='sm:flex items-center px-1 py-4 sm:px-6'>- <div className='flex min-w-0 flex-1 items-center'>- <div className='flex-shrink-0 hidden sm:block'>- <Icon className='max-h-12 max-w-12 h-12 w-12 rounded-full' />+ {_map(available, ({ name, key, description, Icon }) => {+ const { connected, confirmed, id } = getIntegrationStatus(key)+ const status = connected ? (confirmed ? 'connected' : 'pending') : 'notConnected'++ return (+ <li key={key}>+ <div className='sm:flex items-center px-1 py-4 sm:px-6'>+ <div className='flex min-w-0 flex-1 items-center'>+ <div className='flex-shrink-0 hidden sm:block'>+ <Icon className='max-h-12 max-w-12 h-12 w-12 rounded-full' />+ </div>+ <div className='min-w-0 flex-1 px-2 sm:px-4 md:grid md:grid-cols-2 md:gap-4'>+ <div>+ <p className='text-md font-medium text-gray-800 dark:text-gray-50'>{name}</p>+ <p className='mt-2 flex items-center text-sm text-gray-500 dark:text-gray-100'>+ <span>{description}</span>+ </p></div>- <div className='min-w-0 flex-1 px-2 sm:px-4 md:grid md:grid-cols-2 md:gap-4'>- <div>- <p className='text-md font-medium text-gray-800 dark:text-gray-50'>{name}</p>- <p className='mt-2 flex items-center text-sm text-gray-500 dark:text-gray-100'>- <span>{description}</span>+ <div>+ {id && (+ <p className='text-sm text-gray-900 dark:text-gray-50'>+ {t('profileSettings.chatID')}+ {`: ${id}`}</p>- </div>- <div>- {id && (- <p className='text-sm text-gray-900 dark:text-gray-50'>- {t('profileSettings.chatID')}- {`: ${id}`}- </p>+ )}+ <p className='mt-2 flex items-center text-sm text-gray-500 dark:text-gray-100'>+ {status === 'notConnected' && (+ <XCircleIcon className='mr-1.5 h-5 w-5 flex-shrink-0 text-red-400' aria-hidden='true' />)}- <p className='mt-2 flex items-center text-sm text-gray-500 dark:text-gray-100'>- {status === 'notConnected' && <XCircleIcon className='mr-1.5 h-5 w-5 flex-shrink-0 text-red-400' aria-hidden='true' />}- {status === 'pending' && <ClockIcon className='mr-1.5 h-5 w-5 flex-shrink-0 text-yellow-400' aria-hidden='true' />}- {status === 'connected' && <CheckCircleIcon className='mr-1.5 h-5 w-5 flex-shrink-0 text-green-400' aria-hidden='true' />}- {t(`common.${status}`)}- </p>- </div>+ {status === 'pending' && (+ <ClockIcon className='mr-1.5 h-5 w-5 flex-shrink-0 text-yellow-400' aria-hidden='true' />+ )}+ {status === 'connected' && (+ <CheckCircleIcon+ className='mr-1.5 h-5 w-5 flex-shrink-0 text-green-400'+ aria-hidden='true'+ />+ )}+ {t(`common.${status}`)}+ </p></div></div>- <div className='flex justify-center mt-2 sm:block sm:mt-0'>- {connected ? (- <Button onClick={() => removeIntegration(key)} small danger>- {t('profileSettings.removeIntegration')}- </Button>- ) : (- <Button onClick={setupIntegration(key)} small primary>- {t('profileSettings.addIntegration')}- </Button>- )}- </div></div>- </li>- )- })- }+ <div className='flex justify-center mt-2 sm:block sm:mt-0'>+ {connected ? (+ <Button onClick={() => removeIntegration(key)} small danger>+ {t('profileSettings.removeIntegration')}+ </Button>+ ) : (+ <Button onClick={setupIntegration(key)} small primary>+ {t('profileSettings.addIntegration')}+ </Button>+ )}+ </div>+ </div>+ </li>+ )+ })}</ul></div></>diff --git a/app/pages/UserSettings/components/NoSharedProjects.tsx b/app/pages/UserSettings/components/NoSharedProjects.tsxindex f04daf5ef..dfc6b2471 100644--- a/app/pages/UserSettings/components/NoSharedProjects.tsx+++ b/app/pages/UserSettings/components/NoSharedProjects.tsx@@ -1,13 +1,9 @@import React from 'react'-const NoSharedProjects = ({ t }: {- t: (key: string) => string,-}): JSX.Element => (+const NoSharedProjects = ({ t }: { t: (key: string) => string }): JSX.Element => (<div className='flex flex-col py-6 sm:px-6 lg:px-8'><div className='max-w-7xl w-full mx-auto text-gray-900 dark:text-gray-50'>- <h2 className='text-2xl mb-4 text-center leading-snug'>- {t('profileSettings.noSharedProjects')}- </h2>+ <h2 className='text-2xl mb-4 text-center leading-snug'>{t('profileSettings.noSharedProjects')}</h2></div></div>)diff --git a/app/pages/UserSettings/components/ProjectList.tsx b/app/pages/UserSettings/components/ProjectList.tsxindex 0992598d4..940ef01c4 100644--- a/app/pages/UserSettings/components/ProjectList.tsx+++ b/app/pages/UserSettings/components/ProjectList.tsx@@ -5,36 +5,43 @@ import { useTranslation } from 'react-i18next'import Button from 'ui/Button'import Modal from 'ui/Modal'-import {- deleteShareProject, acceptShareProject,-} from 'api'+import { deleteShareProject, acceptShareProject } from 'api'import { ISharedProject } from 'redux/models/ISharedProject'const ProjectList = ({- item, removeShareProject, removeProject, setProjectsShareData, setUserShareData,- userSharedUpdate, sharedProjectError,+ item,+ removeShareProject,+ removeProject,+ setProjectsShareData,+ setUserShareData,+ userSharedUpdate,+ sharedProjectError,}: {- item: ISharedProject,- removeShareProject: (id: string) => void,- removeProject: (id: string) => void,- setProjectsShareData: (data: Partial<ISharedProject>, id: string, shared?: boolean) => void,- setUserShareData: (data: Partial<ISharedProject>, id: string) => void,- userSharedUpdate: (message: string) => void,- sharedProjectError: (message: string) => void,+ item: ISharedProject+ removeShareProject: (id: string) => void+ removeProject: (id: string) => void+ setProjectsShareData: (data: Partial<ISharedProject>, id: string, shared?: boolean) => void+ setUserShareData: (data: Partial<ISharedProject>, id: string) => void+ userSharedUpdate: (message: string) => void+ sharedProjectError: (message: string) => void}): JSX.Element => {- const { t, i18n: { language } }: {- t: (key: string, options?: {- [key: string]: string | number,- }) => string,+ const {+ t,+ i18n: { language },+ }: {+ t: (+ key: string,+ options?: {+ [key: string]: string | number+ },+ ) => stringi18n: {- language: string,- },+ language: string+ }} = useTranslation('common')const [showDeleteModal, setShowDeleteModal] = useState<boolean>(false)- const {- created, confirmed, id, role, project,- } = item+ const { created, confirmed, id, role, project } = itemconst deleteProject = async (pid: string) => {try {diff --git a/app/pages/UserSettings/components/Referral.tsx b/app/pages/UserSettings/components/Referral.tsxindex cbc35ac23..19d4d36c8 100644--- a/app/pages/UserSettings/components/Referral.tsx+++ b/app/pages/UserSettings/components/Referral.tsx@@ -1,40 +1,52 @@-import React, {- memo, useState, useRef, useEffect,-} from 'react'+import React, { memo, useState, useRef, useEffect } from 'react'import { useTranslation, Trans } from 'react-i18next'import { ClipboardDocumentIcon } from '@heroicons/react/24/outline'import dayjs from 'dayjs'import _isEmpty from 'lodash/isEmpty'import _map from 'lodash/map'-import {- generateRefCode, getPayoutsInfo, getReferrals, setPaypalEmail,-} from 'api'+import { generateRefCode, getPayoutsInfo, getReferrals, setPaypalEmail } from 'api'import Tooltip from 'ui/Tooltip'import Highlighted from 'ui/Highlighted'import Input from 'ui/Input'import Button from 'ui/Button'import { IUser } from 'redux/models/IUser'import {- REF_URL_PREFIX, DOCS_REFERRAL_PROGRAM_URL, REFERRAL_PENDING_PAYOUT_DAYS, calculateReferralCut,- PLAN_LIMITS, CURRENCIES, BillingFrequency, MERCHANT_FEE, REFERRAL_CUT,+ REF_URL_PREFIX,+ DOCS_REFERRAL_PROGRAM_URL,+ REFERRAL_PENDING_PAYOUT_DAYS,+ calculateReferralCut,+ PLAN_LIMITS,+ CURRENCIES,+ BillingFrequency,+ MERCHANT_FEE,+ REFERRAL_CUT,} from 'redux/constants'import { isValidEmail } from 'utils/validator'interface IReferral {- user: IUser,- genericError: (message: string) => void,- updateUserData: (data: Partial<IUser>) => void,- setCache: (key: string, value: any) => void,- activeReferrals: any[],- referralStatistics: any,- accountUpdated: (t: string) => void,+ user: IUser+ genericError: (message: string) => void+ updateUserData: (data: Partial<IUser>) => void+ setCache: (key: string, value: any) => void+ activeReferrals: any[]+ referralStatistics: any+ accountUpdated: (t: string) => void}const Referral = ({- user, genericError, updateUserData, referralStatistics, activeReferrals, setCache, accountUpdated,+ user,+ genericError,+ updateUserData,+ referralStatistics,+ activeReferrals,+ setCache,+ accountUpdated,}: IReferral) => {- const { t, i18n: { language } } = useTranslation('common')+ const {+ t,+ i18n: { language },+ } = useTranslation('common')const [copied, setCopied] = useState(false)const [refCodeGenerating, setRefCodeGenerating] = useState(false)const [referralStatsRequested, setReferralStatsRequested] = useState(false)@@ -154,12 +166,14 @@ const Referral = ({t={t}i18nKey='profileSettings.referral.desc'components={{- url: <a- href={DOCS_REFERRAL_PROGRAM_URL}- className='font-medium hover:underline text-indigo-600 hover:text-indigo-500 dark:text-indigo-400 dark:hover:text-indigo-500'- target='_blank'- rel='noreferrer noopener'- />,+ url: (+ <a+ href={DOCS_REFERRAL_PROGRAM_URL}+ className='font-medium hover:underline text-indigo-600 hover:text-indigo-500 dark:text-indigo-400 dark:hover:text-indigo-500'+ target='_blank'+ rel='noreferrer noopener'+ />+ ),}}/></p>@@ -178,14 +192,7 @@ const Referral = ({onChange={handlePaypalInput}error={paypalInputError}/>- <Button- type='button'- className='h-9'- loading={isPaypalEmailLoading}- onClick={updatePaypalEmail}- primary- large- >+ <Button type='button' className='h-9' loading={isPaypalEmailLoading} onClick={updatePaypalEmail} primary large>{t('common.save')}</Button></div>@@ -203,14 +210,7 @@ const Referral = ({{user.refCode ? (<div className='grid grid-cols-1 gap-y-6 gap-x-4 lg:grid-cols-2'><div className='relative group'>- <Input- name='refCode'- id='refCode'- type='text'- className='pr-9'- value={refUrl}- disabled- />+ <Input name='refCode' id='refCode' type='text' className='pr-9' value={refUrl} disabled /><div className='absolute right-2 top-3'><div className='group relative'><Button@@ -233,13 +233,7 @@ const Referral = ({</div></div>) : (- <Button- className='mt-2'- onClick={onRefCodeGenerate}- loading={refCodeGenerating}- primary- large- >+ <Button className='mt-2' onClick={onRefCodeGenerate} loading={refCodeGenerating} primary large>{t('profileSettings.referral.generateRefLink')}</Button>)}@@ -251,39 +245,50 @@ const Referral = ({<div><Tooltiptext={t('profileSettings.referral.trialDesc')}- tooltipNode={(- <span className='text-gray-900 dark:text-gray-50'>{t('profileSettings.referral.trial')}: <Highlighted>{referralStatistics.trials}</Highlighted></span>- )}+ tooltipNode={+ <span className='text-gray-900 dark:text-gray-50'>+ {t('profileSettings.referral.trial')}: <Highlighted>{referralStatistics.trials}</Highlighted>+ </span>+ }className='max-w-max !w-auto !h-auto'/><Tooltiptext={t('profileSettings.referral.activeDesc')}- tooltipNode={(- <span className='text-gray-900 dark:text-gray-50'>{t('profileSettings.referral.active')}: <Highlighted>{referralStatistics.subscribers}</Highlighted></span>- )}+ tooltipNode={+ <span className='text-gray-900 dark:text-gray-50'>+ {t('profileSettings.referral.active')}: <Highlighted>{referralStatistics.subscribers}</Highlighted>+ </span>+ }className='max-w-max !w-auto !h-auto'/><Tooltiptext={t('profileSettings.referral.paidDesc')}- tooltipNode={(- <span className='text-gray-900 dark:text-gray-50'>{t('profileSettings.referral.paid')}: <Highlighted>US$ {referralStatistics.paid}</Highlighted></span>- )}+ tooltipNode={+ <span className='text-gray-900 dark:text-gray-50'>+ {t('profileSettings.referral.paid')}: <Highlighted>US$ {referralStatistics.paid}</Highlighted>+ </span>+ }className='max-w-max !w-auto !h-auto'/><Tooltiptext={t('profileSettings.referral.nextPayoutDesc')}- tooltipNode={(- <span className='text-gray-900 dark:text-gray-50'>{t('profileSettings.referral.nextPayout')}: <Highlighted>US$ {referralStatistics.nextPayout}</Highlighted></span>- )}+ tooltipNode={+ <span className='text-gray-900 dark:text-gray-50'>+ {t('profileSettings.referral.nextPayout')}:{' '}+ <Highlighted>US$ {referralStatistics.nextPayout}</Highlighted>+ </span>+ }className='max-w-max !w-auto !h-auto'/><Tooltiptext={t('profileSettings.referral.pendingDesc', {days: REFERRAL_PENDING_PAYOUT_DAYS,})}- tooltipNode={(- <span className='text-gray-900 dark:text-gray-50'>{t('profileSettings.referral.pending')}: <Highlighted>US$ {referralStatistics.pending}</Highlighted></span>- )}+ tooltipNode={+ <span className='text-gray-900 dark:text-gray-50'>+ {t('profileSettings.referral.pending')}: <Highlighted>US$ {referralStatistics.pending}</Highlighted>+ </span>+ }className='max-w-max !w-auto !h-auto'/></div>@@ -297,7 +302,10 @@ const Referral = ({<table className='mt-2 min-w-full shadow ring-1 ring-black ring-opacity-5 md:rounded-lg divide-y divide-gray-300 200 dark:divide-gray-500'><thead className='bg-gray-50 dark:bg-slate-800'><tr>- <th scope='col' className='py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 dark:text-gray-50'>+ <th+ scope='col'+ className='py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 dark:text-gray-50'+ >{t('profileSettings.referral.activeReferralsTable.plan')}</th><th scope='col' className='px-3 py-3.5 text-left text-sm font-semibold text-gray-900 dark:text-gray-50'>@@ -316,22 +324,24 @@ const Referral = ({</tr></thead><tbody className='divide-y divide-gray-200 dark:divide-gray-600 bg-white dark:bg-slate-800'>- {_map(activeReferrals, ({- billingFrequency, created, planCode, tierCurrency,- }, index) => {+ {_map(activeReferrals, ({ billingFrequency, created, planCode, tierCurrency }, index) => {// @ts-ignoreconst planPrice = PLAN_LIMITS[planCode].price[tierCurrency][billingFrequency]const referrerCut = calculateReferralCut(planPrice)const currencySymbol = CURRENCIES[tierCurrency as 'EUR' | 'USD' | 'GBP'].symbol- const tBillingFrequency = t(billingFrequency === BillingFrequency.monthly ? 'pricing.perMonth' : 'pricing.perYear')+ const tBillingFrequency = t(+ billingFrequency === BillingFrequency.monthly ? 'pricing.perMonth' : 'pricing.perYear',+ )return (<tr key={index}><td className='whitespace-nowrap px-3 py-4 text-sm text-gray-900 dark:text-gray-50 sm:pl-6'>- {currencySymbol}{planPrice}/{tBillingFrequency}+ {currencySymbol}+ {planPrice}/{tBillingFrequency}</td><td className='whitespace-nowrap px-3 py-4 text-sm text-gray-900 dark:text-gray-50'>- {currencySymbol}{referrerCut}/{tBillingFrequency}+ {currencySymbol}+ {referrerCut}/{tBillingFrequency}</td><td className='whitespace-nowrap px-3 py-4 text-sm text-gray-900 dark:text-gray-50'>{language === 'en'diff --git a/app/pages/UserSettings/components/Socialisations.tsx b/app/pages/UserSettings/components/Socialisations.tsxindex 327d293f4..020ab0d2f 100644--- a/app/pages/UserSettings/components/Socialisations.tsx+++ b/app/pages/UserSettings/components/Socialisations.tsx@@ -1,9 +1,7 @@import React, { useState, memo } from 'react'import { useTranslation } from 'react-i18next'import _map from 'lodash/map'-import {- CheckCircleIcon, XCircleIcon,-} from '@heroicons/react/24/solid'+import { CheckCircleIcon, XCircleIcon } from '@heroicons/react/24/solid'import Button from 'ui/Button'import Google from 'ui/icons/GoogleG'@@ -36,7 +34,7 @@ const AVAILABLE_SSO_PROVIDERS = [* @param {IUser} user - user object* @param {string} socialisation - key from SOCIALISATIONS* @returns {[boolean, boolean]} - [isConnected, isUnlinkable]-*/+ */const getStatusByUser = (user: IUser, socialisation: string) => {if (socialisation === SSO_PROVIDERS.GOOGLE) {const connected = user.googleId@@ -54,115 +52,108 @@ const getStatusByUser = (user: IUser, socialisation: string) => {}interface ISocialisations {- user: IUser,- linkSSO: (t: (key: string) => string, callback: (e: any) => void, provider: string) => void,- unlinkSSO: (t: (key: string) => string, callback: (e: any) => void, provider: string) => void,- genericError: (message: string) => void,+ user: IUser+ linkSSO: (t: (key: string) => string, callback: (e: any) => void, provider: string) => void+ unlinkSSO: (t: (key: string) => string, callback: (e: any) => void, provider: string) => void+ genericError: (message: string) => voidtheme: string}-const Socialisations = ({- user, linkSSO, unlinkSSO, genericError, theme,-}: ISocialisations) => {- const { t }: {- t: (key: string) => string,+const Socialisations = ({ user, linkSSO, unlinkSSO, genericError, theme }: ISocialisations) => {+ const {+ t,+ }: {+ t: (key: string) => string} = useTranslation('common')const [isLoading, setIsLoading] = useState(false)const _linkSSO = (provider: string) => {setIsLoading(true)- linkSSO(t, () => {- setIsLoading(false)- }, provider)+ linkSSO(+ t,+ () => {+ setIsLoading(false)+ },+ provider,+ )}const _unlinkSSO = (provider: string) => {setIsLoading(true)- unlinkSSO(t, () => {- setIsLoading(false)- }, provider)+ unlinkSSO(+ t,+ () => {+ setIsLoading(false)+ },+ provider,+ )}return (<>- <p className='max-w-prose text-base text-gray-900 dark:text-gray-50'>- {t('profileSettings.socialisationsDesc')}- </p>+ <p className='max-w-prose text-base text-gray-900 dark:text-gray-50'>{t('profileSettings.socialisationsDesc')}</p><div className='overflow-hidden bg-white dark:bg-slate-800 mt-2 shadow sm:rounded-md'><ul className='divide-y divide-gray-200 dark:divide-slate-700'>- {- _map(AVAILABLE_SSO_PROVIDERS, ({- name, key, icons,- }) => {- const [connected, unlinkable] = getStatusByUser(user, key)- const { Light, Dark } = icons-- const status = connected ? 'connected' : 'notConnected'-- return (- <li key={key}>- <div className='sm:flex items-center px-1 py-4 sm:px-6'>- <div className='flex min-w-0 flex-1 items-center'>- <div className='flex-shrink-0 hidden sm:block'>- {theme === 'dark' ? (- <Light className='max-h-12 max-w-12 h-12 w-12 rounded-full' />- ) : (- <Dark className='max-h-12 max-w-12 h-12 w-12 rounded-full' />- )}- </div>- <div className='min-w-0 flex-1 px-2 sm:px-4 md:grid md:grid-cols-2 md:gap-4'>- <div>- <p className='text-md font-medium text-gray-800 dark:text-gray-50'>- {name}- </p>- <p className='mt-2 flex items-center text-sm text-gray-500 dark:text-gray-100'>- {status === 'notConnected' && <XCircleIcon className='mr-1.5 h-5 w-5 flex-shrink-0 text-red-400' aria-hidden='true' />}- {status === 'connected' && <CheckCircleIcon className='mr-1.5 h-5 w-5 flex-shrink-0 text-green-400' aria-hidden='true' />}- {t(`common.${status}`)}- </p>- </div>- </div>- </div>- <div className='flex justify-center mt-2 sm:block sm:mt-0'>- {connected && !unlinkable && (- <Button- onClick={() => genericError(t('profileSettings.cantUnlinkSocialisation'))}- small- danger- >- {t('common.unlink')}- </Button>- )}-- {connected && unlinkable && (- <Button- onClick={() => _unlinkSSO(key)}- loading={isLoading}- small- danger- >- {t('common.unlink')}- </Button>- )}-- {!connected && (- <Button- onClick={() => _linkSSO(key)}- loading={isLoading}- small- primary- >- {t('common.link')}- </Button>+ {_map(AVAILABLE_SSO_PROVIDERS, ({ name, key, icons }) => {+ const [connected, unlinkable] = getStatusByUser(user, key)+ const { Light, Dark } = icons++ const status = connected ? 'connected' : 'notConnected'++ return (+ <li key={key}>+ <div className='sm:flex items-center px-1 py-4 sm:px-6'>+ <div className='flex min-w-0 flex-1 items-center'>+ <div className='flex-shrink-0 hidden sm:block'>+ {theme === 'dark' ? (+ <Light className='max-h-12 max-w-12 h-12 w-12 rounded-full' />+ ) : (+ <Dark className='max-h-12 max-w-12 h-12 w-12 rounded-full' />)}</div>+ <div className='min-w-0 flex-1 px-2 sm:px-4 md:grid md:grid-cols-2 md:gap-4'>+ <div>+ <p className='text-md font-medium text-gray-800 dark:text-gray-50'>{name}</p>+ <p className='mt-2 flex items-center text-sm text-gray-500 dark:text-gray-100'>+ {status === 'notConnected' && (+ <XCircleIcon className='mr-1.5 h-5 w-5 flex-shrink-0 text-red-400' aria-hidden='true' />+ )}+ {status === 'connected' && (+ <CheckCircleIcon+ className='mr-1.5 h-5 w-5 flex-shrink-0 text-green-400'+ aria-hidden='true'+ />+ )}+ {t(`common.${status}`)}+ </p>+ </div>+ </div>+ </div>+ <div className='flex justify-center mt-2 sm:block sm:mt-0'>+ {connected && !unlinkable && (+ <Button onClick={() => genericError(t('profileSettings.cantUnlinkSocialisation'))} small danger>+ {t('common.unlink')}+ </Button>+ )}++ {connected && unlinkable && (+ <Button onClick={() => _unlinkSSO(key)} loading={isLoading} small danger>+ {t('common.unlink')}+ </Button>+ )}++ {!connected && (+ <Button onClick={() => _linkSSO(key)} loading={isLoading} small primary>+ {t('common.link')}+ </Button>+ )}</div>- </li>- )- })- }+ </div>+ </li>+ )+ })}</ul></div></>diff --git a/app/pages/UserSettings/components/TwoFA.tsx b/app/pages/UserSettings/components/TwoFA.tsxindex 77b75d9e0..fbe6dd728 100644--- a/app/pages/UserSettings/components/TwoFA.tsx+++ b/app/pages/UserSettings/components/TwoFA.tsx@@ -7,31 +7,37 @@ import _isString from 'lodash/isString'import Input from 'ui/Input'import Button from 'ui/Button'-import {- generate2FA, enable2FA, disable2FA,-} from 'api'+import { generate2FA, enable2FA, disable2FA } from 'api'import { setAccessToken } from 'utils/accessToken'import { setRefreshToken } from 'utils/refreshToken'import { IUser } from 'redux/models/IUser'const TwoFA = ({- user, dontRemember, updateUserData, genericError,+ user,+ dontRemember,+ updateUserData,+ genericError,}: {- user: IUser,- dontRemember: boolean,- updateUserData: (data: Partial<IUser>) => void,- genericError: (message: string) => void,+ user: IUser+ dontRemember: boolean+ updateUserData: (data: Partial<IUser>) => void+ genericError: (message: string) => void}): JSX.Element => {- const { t }: {- t: (key: string, options?: {- [key: string]: string | number,- }) => string,+ const {+ t,+ }: {+ t: (+ key: string,+ options?: {+ [key: string]: string | number+ },+ ) => string} = useTranslation('common')const [twoFAConfigurating, setTwoFAConfigurating] = useState<boolean>(false)const [twoFADisabling, setTwoFADisabling] = useState<boolean>(false)const [twoFAConfigData, setTwoFAConfigData] = useState<{- secret?: string,- otpauthUrl?: string,+ secret?: string+ otpauthUrl?: string}>({}) // { secret, otpauthUrl }const [isTwoFaLoading, setIsTwoFaLoading] = useState<boolean>(false)const [twoFACode, setTwoFACode] = useState('')@@ -40,7 +46,9 @@ const TwoFA = ({const { isTwoFactorAuthenticationEnabled } = userconst handle2FAInput = (event: React.ChangeEvent<HTMLInputElement>) => {- const { target: { value } } = event+ const {+ target: { value },+ } = eventsetTwoFACode(value)setTwoFACodeError(null)}@@ -109,12 +117,14 @@ const TwoFA = ({}}- const callFnOnKeyPress = (fn: (e: any) => void, key = 'Enter') => (e: any) => {- e.stopPropagation()- if (e.key === key) {- fn(e)+ const callFnOnKeyPress =+ (fn: (e: any) => void, key = 'Enter') =>+ (e: any) => {+ e.stopPropagation()+ if (e.key === key) {+ fn(e)+ }}- }const recoverySaved = () => {setTwoFARecovery(null)@@ -124,9 +134,7 @@ const TwoFA = ({if (twoFARecovery) {return (<div className='max-w-prose'>- <p className='text-base text-gray-900 dark:text-gray-50'>- {t('profileSettings.2faRecoveryNote')}- </p>+ <p className='text-base text-gray-900 dark:text-gray-50'>{t('profileSettings.2faRecoveryNote')}</p><Input type='text' className='mt-4' value={twoFARecovery} /><Button onClick={recoverySaved} primary large>{t('profileSettings.2faRecoverySaved')}@@ -139,9 +147,7 @@ const TwoFA = ({if (twoFADisabling) {return (<>- <p className='text-base max-w-prose text-gray-900 dark:text-gray-50'>- {t('profileSettings.2faDisableHint')}- </p>+ <p className='text-base max-w-prose text-gray-900 dark:text-gray-50'>{t('profileSettings.2faDisableHint')}</p><div className='flex items-center mt-4'><Inputtype='text'@@ -173,9 +179,7 @@ const TwoFA = ({return (<>- <p className='max-w-prose text-base text-gray-900 dark:text-gray-50'>- {t('profileSettings.2faEnabled')}- </p>+ <p className='max-w-prose text-base text-gray-900 dark:text-gray-50'>{t('profileSettings.2faEnabled')}</p><Button className='mt-4' onClick={() => setTwoFADisabling(true)} danger large>{t('profileSettings.2faDisableBtn')}</Button>@@ -186,9 +190,7 @@ const TwoFA = ({if (twoFAConfigurating) {return (<>- <p className='text-base max-w-prose text-gray-900 dark:text-gray-50'>- {t('profileSettings.2faDesc')}- </p>+ <p className='text-base max-w-prose text-gray-900 dark:text-gray-50'>{t('profileSettings.2faDesc')}</p><div className='mt-4 p-4 bg-white w-max'><QRCode value={twoFAConfigData?.otpauthUrl || ''} /></div>@@ -226,9 +228,7 @@ const TwoFA = ({return (<>- <p className='max-w-prose text-base text-gray-900 dark:text-gray-50'>- {t('profileSettings.2faEnable')}- </p>+ <p className='max-w-prose text-base text-gray-900 dark:text-gray-50'>{t('profileSettings.2faEnable')}</p><Button className='mt-4' onClick={_generate2FA} loading={isTwoFaLoading} primary large>{t('profileSettings.2faEnableBtn')}</Button>diff --git a/app/redux/constants/index.ts b/app/redux/constants/index.tsindex 8a9432758..b3495e36e 100644--- a/app/redux/constants/index.ts+++ b/app/redux/constants/index.ts@@ -39,13 +39,7 @@ export const FORECAST_MAX_MAPPING: {export const KEY_FOR_ALL_TIME = 'all'-export const ALL_PERIODS = [- 'minute',- 'hour',- 'day',- 'month',- 'year',-]+export const ALL_PERIODS = ['minute', 'hour', 'day', 'month', 'year']export interface ITBPeriodPairs {label: string@@ -56,131 +50,174 @@ export interface ITBPeriodPairs {isCustomDate?: boolean}-export const tbPeriodPairs = (t: Function, tbs?: string[] | null, dates?: Date[], language?: string):ITBPeriodPairs[] => [{- label: t('project.thisHour'),- period: '1h',- tbs: ['minute'],-}, {- label: t('project.today'),- period: 'today',- tbs: ['hour'],-}, {- label: t('project.yesterday'),- period: 'yesterday',- tbs: ['hour'],-}, {- label: t('project.last24h'),- period: '1d',- countDays: 1,- tbs: ['hour'],-}, {- label: t('project.lastXDays', { amount: 7 }),- period: '7d',- tbs: ['hour', 'day'],- countDays: 7,-}, {- label: t('project.lastXWeeks', { amount: 4 }),- period: '4w',- tbs: ['day'],- countDays: 28,-}, {- label: t('project.lastXMonths', { amount: 3 }),- period: '3M',- tbs: ['month'],- countDays: 90,-}, {- label: t('project.lastXMonths', { amount: 12 }),- period: '12M',- tbs: ['month'],- countDays: 365,-}, {- label: t('project.lastXMonths', { amount: 24 }),- period: '24M',- tbs: ['month'],-}, {- label: t('project.all'),- period: KEY_FOR_ALL_TIME,- tbs: ['month', 'year'],-}, {- label: dates ? getCustomLabel(dates, t, language) : t('project.custom'),- dropdownLabel: t('project.custom'),- isCustomDate: true,- period: 'custom',- tbs: tbs || ['custom'],-}, {- label: t('project.compare'),- period: 'compare',- tbs: tbs || ['custom'],-}]--export const captchaTbPeriodPairs = (t: Function, tbs?: string[] | null, dates?: Date[], language?: string):ITBPeriodPairs[] => [{- label: t('project.thisHour'),- period: '1h',- tbs: ['minute'],-}, {- label: t('project.today'),- period: 'today',- tbs: ['hour'],-}, {- label: t('project.yesterday'),- period: 'yesterday',- tbs: ['hour'],-}, {- label: t('project.last24h'),- period: '1d',- countDays: 1,- tbs: ['hour'],-}, {- label: t('project.lastXDays', { amount: 7 }),- period: '7d',- tbs: ['hour', 'day'],- countDays: 7,-}, {- label: t('project.lastXWeeks', { amount: 4 }),- period: '4w',- tbs: ['day'],- countDays: 28,-}, {- label: t('project.lastXMonths', { amount: 3 }),- period: '3M',- tbs: ['month'],- countDays: 90,-}, {- label: t('project.lastXMonths', { amount: 12 }),- period: '12M',- tbs: ['month'],- countDays: 365,-}, {- label: t('project.lastXMonths', { amount: 24 }),- period: '24M',- tbs: ['month'],-}, {- label: t('project.all'),- period: KEY_FOR_ALL_TIME,- tbs: ['month', 'year'],-}, {- label: dates ? getCustomLabel(dates, t, language) : t('project.custom'),- dropdownLabel: t('project.custom'),- isCustomDate: true,- period: 'custom',- tbs: tbs || ['custom'],-}]+export const tbPeriodPairs = (+ t: Function,+ tbs?: string[] | null,+ dates?: Date[],+ language?: string,+): ITBPeriodPairs[] => [+ {+ label: t('project.thisHour'),+ period: '1h',+ tbs: ['minute'],+ },+ {+ label: t('project.today'),+ period: 'today',+ tbs: ['hour'],+ },+ {+ label: t('project.yesterday'),+ period: 'yesterday',+ tbs: ['hour'],+ },+ {+ label: t('project.last24h'),+ period: '1d',+ countDays: 1,+ tbs: ['hour'],+ },+ {+ label: t('project.lastXDays', { amount: 7 }),+ period: '7d',+ tbs: ['hour', 'day'],+ countDays: 7,+ },+ {+ label: t('project.lastXWeeks', { amount: 4 }),+ period: '4w',+ tbs: ['day'],+ countDays: 28,+ },+ {+ label: t('project.lastXMonths', { amount: 3 }),+ period: '3M',+ tbs: ['month'],+ countDays: 90,+ },+ {+ label: t('project.lastXMonths', { amount: 12 }),+ period: '12M',+ tbs: ['month'],+ countDays: 365,+ },+ {+ label: t('project.lastXMonths', { amount: 24 }),+ period: '24M',+ tbs: ['month'],+ },+ {+ label: t('project.all'),+ period: KEY_FOR_ALL_TIME,+ tbs: ['month', 'year'],+ },+ {+ label: dates ? getCustomLabel(dates, t, language) : t('project.custom'),+ dropdownLabel: t('project.custom'),+ isCustomDate: true,+ period: 'custom',+ tbs: tbs || ['custom'],+ },+ {+ label: t('project.compare'),+ period: 'compare',+ tbs: tbs || ['custom'],+ },+]++export const captchaTbPeriodPairs = (+ t: Function,+ tbs?: string[] | null,+ dates?: Date[],+ language?: string,+): ITBPeriodPairs[] => [+ {+ label: t('project.thisHour'),+ period: '1h',+ tbs: ['minute'],+ },+ {+ label: t('project.today'),+ period: 'today',+ tbs: ['hour'],+ },+ {+ label: t('project.yesterday'),+ period: 'yesterday',+ tbs: ['hour'],+ },+ {+ label: t('project.last24h'),+ period: '1d',+ countDays: 1,+ tbs: ['hour'],+ },+ {+ label: t('project.lastXDays', { amount: 7 }),+ period: '7d',+ tbs: ['hour', 'day'],+ countDays: 7,+ },+ {+ label: t('project.lastXWeeks', { amount: 4 }),+ period: '4w',+ tbs: ['day'],+ countDays: 28,+ },+ {+ label: t('project.lastXMonths', { amount: 3 }),+ period: '3M',+ tbs: ['month'],+ countDays: 90,+ },+ {+ label: t('project.lastXMonths', { amount: 12 }),+ period: '12M',+ tbs: ['month'],+ countDays: 365,+ },+ {+ label: t('project.lastXMonths', { amount: 24 }),+ period: '24M',+ tbs: ['month'],+ },+ {+ label: t('project.all'),+ period: KEY_FOR_ALL_TIME,+ tbs: ['month', 'year'],+ },+ {+ label: dates ? getCustomLabel(dates, t, language) : t('project.custom'),+ dropdownLabel: t('project.custom'),+ isCustomDate: true,+ period: 'custom',+ tbs: tbs || ['custom'],+ },+]export const filtersPeriodPairs = ['1h', '1d', '7d', '4w', '3M', '12M', 'custom', 'compare']-export const tbPeriodPairsCompare = (t: Function, dates?: Date[], language?: string): {+export const tbPeriodPairsCompare = (+ t: Function,+ dates?: Date[],+ language?: string,+): {label: stringperiod: string-}[] => [{- label: t('project.previousPeriod'),- period: 'previous',-}, {- label: dates ? getCustomLabel(dates, t, language) : t('project.custom'),- period: 'custom',-}, {- label: t('project.disableCompare'),- period: 'disable',-}]+}[] => [+ {+ label: t('project.previousPeriod'),+ period: 'previous',+ },+ {+ label: dates ? getCustomLabel(dates, t, language) : t('project.custom'),+ period: 'custom',+ },+ {+ label: t('project.disableCompare'),+ period: 'disable',+ },+]export const PERIOD_PAIRS_COMPARE: {COMPARE: string@@ -288,7 +325,8 @@ export const DEFAULT_TIMEZONE: string = 'Etc/GMT'export const DONATE_URL: string = 'https://ko-fi.com/andriir'export const FIREFOX_ADDON_URL: string = 'https://addons.mozilla.org/en-US/firefox/addon/swetrix/'-export const CHROME_EXTENSION_URL: string = 'https://chrome.google.com/webstore/detail/swetrix/glbeclfdldjldjonfnpnembfkhphmeld'+export const CHROME_EXTENSION_URL: string =+ 'https://chrome.google.com/webstore/detail/swetrix/glbeclfdldjldjonfnpnembfkhphmeld'export const HAVE_I_BEEN_PWNED_URL: string = 'https://haveibeenpwned.com/passwords'export const LINKEDIN_URL: string = 'https://www.linkedin.com/company/swetrix/'export const GITHUB_URL: string = 'https://github.com/Swetrix'@@ -341,9 +379,7 @@ export const CDN_URL = isBrowser ? window.REMIX_ENV?.CDN_URL : process.env.CDN_Uexport const NODE_ENV = isBrowser ? window.REMIX_ENV?.NODE_ENV : process.env.NODE_ENVexport const isDevelopment = !NODE_ENV || NODE_ENV === 'development'-export const isSelfhosted = Boolean(- isBrowser ? window.REMIX_ENV?.SELFHOSTED : process.env.SELFHOSTED,-)+export const isSelfhosted = Boolean(isBrowser ? window.REMIX_ENV?.SELFHOSTED : process.env.SELFHOSTED)export const getOgImageUrl = (title: string) => {const apiUrl = _endsWith(API_URL, '/') ? API_URL.slice(0, -1) : API_URL@@ -352,14 +388,35 @@ export const getOgImageUrl = (title: string) => {}// Functions-export const getProjectCacheKey = (period: string, timeBucket: string, mode: 'periodical' | 'cumulative', filters?: any): string => `${period}${timeBucket}${mode}${filters ? JSON.stringify(filters) : ''}}`-export const getProjectCaptchaCacheKey = (period: string, timeBucket: string, filters?: any): string => `${period}${timeBucket}captcha${filters ? JSON.stringify(filters) : ''}}`-export const getProjectForcastCacheKey = (period: string, timeBucket: string, periodToForecast: string, filters: any): string => `${period}${timeBucket}${periodToForecast}forecast${filters ? JSON.stringify(filters) : ''}`-export const getProjectCacheCustomKey = (from: string, to: string, timeBucket: string, mode: 'periodical' | 'cumulative', filters: any): string => `cst${from}${to}${timeBucket}-${mode}${filters ? JSON.stringify(filters) : ''}}`-export const getProjectCacheCustomKeyPerf = (from: string, to: string, timeBucket: string, filters: any): string => `${from}-${to}-${timeBucket}perf${filters ? JSON.stringify(filters) : ''}`-export const getUserFlowCacheKey = (pid: string, period: string, filters: any): string => `${pid}${period}userflow${filters ? JSON.stringify(filters) : ''}`-export const getFunnelsCacheKey = (pid: string, funnelId: string, period: string): string => `${pid}${funnelId}${period}funnels`-export const getFunnelsCacheCustomKey = (pid: string, funnelId: string, from: string, to: string): string => `${pid}${funnelId}${from}${to}funnels`+export const getProjectCacheKey = (+ period: string,+ timeBucket: string,+ mode: 'periodical' | 'cumulative',+ filters?: any,+): string => `${period}${timeBucket}${mode}${filters ? JSON.stringify(filters) : ''}}`+export const getProjectCaptchaCacheKey = (period: string, timeBucket: string, filters?: any): string =>+ `${period}${timeBucket}captcha${filters ? JSON.stringify(filters) : ''}}`+export const getProjectForcastCacheKey = (+ period: string,+ timeBucket: string,+ periodToForecast: string,+ filters: any,+): string => `${period}${timeBucket}${periodToForecast}forecast${filters ? JSON.stringify(filters) : ''}`+export const getProjectCacheCustomKey = (+ from: string,+ to: string,+ timeBucket: string,+ mode: 'periodical' | 'cumulative',+ filters: any,+): string => `cst${from}${to}${timeBucket}-${mode}${filters ? JSON.stringify(filters) : ''}}`+export const getProjectCacheCustomKeyPerf = (from: string, to: string, timeBucket: string, filters: any): string =>+ `${from}-${to}-${timeBucket}perf${filters ? JSON.stringify(filters) : ''}`+export const getUserFlowCacheKey = (pid: string, period: string, filters: any): string =>+ `${pid}${period}userflow${filters ? JSON.stringify(filters) : ''}`+export const getFunnelsCacheKey = (pid: string, funnelId: string, period: string): string =>+ `${pid}${funnelId}${period}funnels`+export const getFunnelsCacheCustomKey = (pid: string, funnelId: string, from: string, to: string): string =>+ `${pid}${funnelId}${from}${to}funnels`// Cookiesexport const GDPR_REQUEST: string = 'gdpr_request'@@ -548,7 +605,9 @@ type ICurrencies = {}export const CURRENCIES: ICurrencies = {- EUR, USD, GBP,+ EUR,+ USD,+ GBP,}export const MERCHANT_FEE = '5% + 50¢'diff --git a/app/redux/models/IAlerts.ts b/app/redux/models/IAlerts.tsindex 7e02666ec..74e6d99af 100644--- a/app/redux/models/IAlerts.ts+++ b/app/redux/models/IAlerts.ts@@ -1,15 +1,15 @@import { QUERY_METRIC, QUERY_CONDITION, QUERY_TIME } from '../constants'export interface IAlerts {- id: string- name: string- active: boolean- created: string- lastTriggered: string | null- queryMetric: keyof typeof QUERY_METRIC- queryCondition: keyof typeof QUERY_CONDITION- queryValue: number- queryTime: keyof typeof QUERY_TIME- pid: string- queryCustomEvent?: string+ id: string+ name: string+ active: boolean+ created: string+ lastTriggered: string | null+ queryMetric: keyof typeof QUERY_METRIC+ queryCondition: keyof typeof QUERY_CONDITION+ queryValue: number+ queryTime: keyof typeof QUERY_TIME+ pid: string+ queryCustomEvent?: string}diff --git a/app/redux/models/IAuth.ts b/app/redux/models/IAuth.tsindex 99ebe9b8d..3b2dda1e7 100644--- a/app/redux/models/IAuth.ts+++ b/app/redux/models/IAuth.ts@@ -1,7 +1,7 @@import { IUser } from './IUser'export interface IAuth {- refresh_token: string- access_token: string- user: IUser+ refresh_token: string+ access_token: string+ user: IUser}diff --git a/app/redux/models/ISharedProject.ts b/app/redux/models/ISharedProject.tsindex 6d9cecd50..d08e1775c 100644--- a/app/redux/models/ISharedProject.ts+++ b/app/redux/models/ISharedProject.ts@@ -1,16 +1,16 @@import { IProject } from './IProject'export interface IProjectForShared extends IProject {- shared?: boolean- role?: string+ shared?: boolean+ role?: string}export interface ISharedProject {- id: string- confirmed: boolean- role: string- created: string- updated: string- project: IProjectForShared- uiHidden: boolean+ id: string+ confirmed: boolean+ role: string+ created: string+ updated: string+ project: IProjectForShared+ uiHidden: boolean}diff --git a/app/redux/models/ISubscribers.ts b/app/redux/models/ISubscribers.tsindex d8909a851..513104fa2 100644--- a/app/redux/models/ISubscribers.ts+++ b/app/redux/models/ISubscribers.ts@@ -1,14 +1,14 @@import { reportFrequencies } from '../constants'export interface ISubscribers {- userId: string- projectId: string- projectName: string- email: string- reportFrequency: typeof reportFrequencies[number]- origin: string- id: string- isConfirmed: boolean- addedAt: string- updatedAt: string+ userId: string+ projectId: string+ projectName: string+ email: string+ reportFrequency: (typeof reportFrequencies)[number]+ origin: string+ id: string+ isConfirmed: boolean+ addedAt: string+ updatedAt: string}diff --git a/app/redux/reducers/alerts.ts b/app/redux/reducers/alerts.tsindex a0f9a0ff6..ba1a6a86b 100644--- a/app/redux/reducers/alerts.ts+++ b/app/redux/reducers/alerts.ts@@ -11,7 +11,7 @@ const initialState: IInitialState = {type: 'info',}-const alertsCreate = (state: IInitialState, { payload }: PayloadAction<{ message: string, type?: string }>) => {+const alertsCreate = (state: IInitialState, { payload }: PayloadAction<{ message: string; type?: string }>) => {state.message = payload.messagestate.type = payload.type || 'info'}diff --git a/app/redux/reducers/auth.ts b/app/redux/reducers/auth.tsindex c1253377b..f17b74340 100644--- a/app/redux/reducers/auth.ts+++ b/app/redux/reducers/auth.ts@@ -37,7 +37,7 @@ const authSlice = createSlice({loginSuccessful: (state, { payload }: PayloadAction<IUser>) => {state.user = payloadstate.authenticated = true- state.isPaidTierUsed = isSelfhosted || (payload?.planCode && payload.planCode !== FREE_TIER_KEY) as boolean+ state.isPaidTierUsed = isSelfhosted || ((payload?.planCode && payload.planCode !== FREE_TIER_KEY) as boolean)},emailVerifySuccessful: (state) => {state.user = { ...state.user, isActive: true }@@ -45,7 +45,7 @@ const authSlice = createSlice({signupUpSuccessful: (state, { payload }: PayloadAction<IUser>) => {state.user = payloadstate.authenticated = true- state.isPaidTierUsed = isSelfhosted || (payload?.planCode && payload.planCode !== FREE_TIER_KEY) as boolean+ state.isPaidTierUsed = isSelfhosted || ((payload?.planCode && payload.planCode !== FREE_TIER_KEY) as boolean)},updateUserProfileSuccess: (state, { payload }: PayloadAction<IUser>) => {state.user = payload@@ -70,7 +70,7 @@ const authSlice = createSlice({const projects = _filter(state.user?.sharedProjects, (item) => item.id !== payload)state.user = { ...state.user, sharedProjects: projects }},- setUserShareData: (state, { payload }: PayloadAction<{ data: Partial<ISharedProject>, id: string }>) => {+ setUserShareData: (state, { payload }: PayloadAction<{ data: Partial<ISharedProject>; id: string }>) => {const projects = _map(current(state.user?.sharedProjects), (item) => {if (item.id === payload.id) {return { ...item, ...payload.data }diff --git a/app/redux/reducers/ui/alerts.ts b/app/redux/reducers/ui/alerts.tsindex 5596ffa0b..42318f9c0 100644--- a/app/redux/reducers/ui/alerts.ts+++ b/app/redux/reducers/ui/alerts.ts@@ -2,10 +2,10 @@ import { createSlice, PayloadAction } from '@reduxjs/toolkit'import { IAlerts } from 'redux/models/IAlerts'interface IInitialState {- alerts: IAlerts[]- total: number- pageTotal: number- loading: boolean+ alerts: IAlerts[]+ total: number+ pageTotal: number+ loading: boolean}const initialState: IInitialState = {@@ -22,7 +22,7 @@ const alertsSlice = createSlice({setProjectAlerts(state, action: PayloadAction<IAlerts[]>) {state.alerts = action.payload},- setProjectAlertsTotal(state, { payload }: PayloadAction<{ total: number, pageTotal?: number }>) {+ setProjectAlertsTotal(state, { payload }: PayloadAction<{ total: number; pageTotal?: number }>) {state.total = payload.totalstate.pageTotal = payload.pageTotal || state.pageTotal},diff --git a/app/redux/reducers/ui/cache.ts b/app/redux/reducers/ui/cache.tsindex 1c01be712..56ba9de1f 100644--- a/app/redux/reducers/ui/cache.ts+++ b/app/redux/reducers/ui/cache.ts@@ -3,8 +3,12 @@ import _filter from 'lodash/filter'import _isEmpty from 'lodash/isEmpty'import { getItem, removeItem, setItem } from 'utils/localstorage'import {- getProjectCacheKey, LS_VIEW_PREFS_SETTING, LS_CAPTCHA_VIEW_PREFS_SETTING, getProjectCaptchaCacheKey,- getUserFlowCacheKey, isBrowser,+ getProjectCacheKey,+ LS_VIEW_PREFS_SETTING,+ LS_CAPTCHA_VIEW_PREFS_SETTING,+ getProjectCaptchaCacheKey,+ getUserFlowCacheKey,+ isBrowser,} from 'redux/constants'import { IUserFlow } from 'redux/models/IUserFlow'import { filterInvalidViewPrefs } from 'pages/Project/View/ViewProject.helpers'@@ -37,7 +41,7 @@ interface IInitialState {period: stringtimeBucket: stringrangeDate?: Date[]- },+ }} | nulluserFlowAscending: {[key: string]: IUserFlow@@ -67,7 +71,7 @@ const cacheSlice = createSlice({name: 'cache',initialState,reducers: {- setProjectCache(state, { payload }: PayloadAction<{ pid: string, key: string, data: any }>) {+ setProjectCache(state, { payload }: PayloadAction<{ pid: string; key: string; data: any }>) {state.analytics = {...state.analytics,[payload.pid]: {@@ -76,7 +80,7 @@ const cacheSlice = createSlice({},}},- setCaptchaProjectCache(state, { payload }: PayloadAction<{ pid: string, key: string, data: any }>) {+ setCaptchaProjectCache(state, { payload }: PayloadAction<{ pid: string; key: string; data: any }>) {state.captchaAnalytics = {...state.captchaAnalytics,[payload.pid]: {@@ -85,10 +89,11 @@ const cacheSlice = createSlice({},}},- deleteProjectCache(state, { payload }: PayloadAction<{ pid?: string, period?: string, timeBucket?: string, filters?: any }>) {- const {- pid, period, timeBucket, filters,- } = payload+ deleteProjectCache(+ state,+ { payload }: PayloadAction<{ pid?: string; period?: string; timeBucket?: string; filters?: any }>,+ ) {+ const { pid, period, timeBucket, filters } = payloadlet key: stringif (period && timeBucket && filters) {@@ -108,10 +113,11 @@ const cacheSlice = createSlice({}}},- deleteCaptchaProjectCache(state, { payload }: PayloadAction<{ pid: string, period?: string, timeBucket?: string }>) {- const {- pid, period, timeBucket,- } = payload+ deleteCaptchaProjectCache(+ state,+ { payload }: PayloadAction<{ pid: string; period?: string; timeBucket?: string }>,+ ) {+ const { pid, period, timeBucket } = payloadlet key: stringif (period && timeBucket) {@@ -129,21 +135,27 @@ const cacheSlice = createSlice({[pid]: _filter(state.captchaAnalytics[pid], (ckey) => ckey !== key),}},- setProjectViewPrefs(state, { payload }: PayloadAction<{ pid: string, period: string, timeBucket: string, rangeDate?: Date[] }>) {- const {- pid, period, timeBucket, rangeDate,- } = payload- const viewPrefs = rangeDate ? {- period, timeBucket, rangeDate,- } : {- period, timeBucket,- }+ setProjectViewPrefs(+ state,+ { payload }: PayloadAction<{ pid: string; period: string; timeBucket: string; rangeDate?: Date[] }>,+ ) {+ const { pid, period, timeBucket, rangeDate } = payload+ const viewPrefs = rangeDate+ ? {+ period,+ timeBucket,+ rangeDate,+ }+ : {+ period,+ timeBucket,+ }const storedPrefs = getItem(LS_VIEW_PREFS_SETTING) as {[key: string]: {period: stringtimeBucket: stringrangeDate?: Date[]- },+ }}if (typeof storedPrefs === 'object' && storedPrefs !== null) {storedPrefs[pid] = viewPrefs@@ -156,21 +168,27 @@ const cacheSlice = createSlice({[pid]: viewPrefs,}},- setCaptchaProjectViewPrefs(state, { payload }: PayloadAction<{ pid: string, period: string, timeBucket: string, rangeDate?: Date[] | null }>) {- const {- pid, period, timeBucket, rangeDate,- } = payload- const viewPrefs = rangeDate ? {- period, timeBucket, rangeDate,- } : {- period, timeBucket,- }+ setCaptchaProjectViewPrefs(+ state,+ { payload }: PayloadAction<{ pid: string; period: string; timeBucket: string; rangeDate?: Date[] | null }>,+ ) {+ const { pid, period, timeBucket, rangeDate } = payload+ const viewPrefs = rangeDate+ ? {+ period,+ timeBucket,+ rangeDate,+ }+ : {+ period,+ timeBucket,+ }const storedPrefs = getItem(LS_CAPTCHA_VIEW_PREFS_SETTING) as {[key: string]: {period: stringtimeBucket: stringrangeDate?: Date[]- },+ }}if (typeof storedPrefs === 'object' && storedPrefs !== null) {storedPrefs[pid] = viewPrefs@@ -183,7 +201,7 @@ const cacheSlice = createSlice({[pid]: viewPrefs,}},- setProjectCachePerf(state, { payload }: PayloadAction<{ pid: string, key: string, data: any }>) {+ setProjectCachePerf(state, { payload }: PayloadAction<{ pid: string; key: string; data: any }>) {state.analyticsPerf = {...state.analyticsPerf,[payload.pid]: {@@ -192,7 +210,7 @@ const cacheSlice = createSlice({},}},- setFunnelsCache(state, { payload }: PayloadAction<{ pid: string, key: string, data: any }>) {+ setFunnelsCache(state, { payload }: PayloadAction<{ pid: string; key: string; data: any }>) {state.funnels = {...state.funnels,[payload.pid]: {@@ -201,7 +219,7 @@ const cacheSlice = createSlice({},}},- setProjectForecastCache(state, { payload }: PayloadAction<{ pid: string, key: string, data: any }>) {+ setProjectForecastCache(state, { payload }: PayloadAction<{ pid: string; key: string; data: any }>) {state.analytics = {...state.analytics,[payload.pid]: {@@ -210,7 +228,7 @@ const cacheSlice = createSlice({},}},- setCustomEventsPrefs(state, { payload }: PayloadAction<{ pid: string, data: any }>) {+ setCustomEventsPrefs(state, { payload }: PayloadAction<{ pid: string; data: any }>) {state.customEventsPrefs = {...state.customEventsPrefs,[payload.pid]: {@@ -219,7 +237,10 @@ const cacheSlice = createSlice({},}},- setUserFlowAscending(state, { payload }: PayloadAction<{ pid: string, period: string, data: IUserFlow, filters: any }>) {+ setUserFlowAscending(+ state,+ { payload }: PayloadAction<{ pid: string; period: string; data: IUserFlow; filters: any }>,+ ) {const key = getUserFlowCacheKey(payload.pid, payload.period, payload.filters)state.userFlowAscending = {@@ -227,7 +248,10 @@ const cacheSlice = createSlice({[key]: payload.data,}},- setUserFlowDescending(state, { payload }: PayloadAction<{ pid: string, period: string, data: IUserFlow, filters: any }>) {+ setUserFlowDescending(+ state,+ { payload }: PayloadAction<{ pid: string; period: string; data: IUserFlow; filters: any }>,+ ) {const key = getUserFlowCacheKey(payload.pid, payload.period, payload.filters)state.userFlowDescending = {@@ -235,7 +259,7 @@ const cacheSlice = createSlice({[key]: payload.data,}},- setCache(state, { payload }: PayloadAction<{ key: string, value: any }>) {+ setCache(state, { payload }: PayloadAction<{ key: string; value: any }>) {const { key, value } = payload// @ts-ignorediff --git a/app/redux/reducers/ui/projects.ts b/app/redux/reducers/ui/projects.tsindex eb9d2c634..96602735d 100644--- a/app/redux/reducers/ui/projects.ts+++ b/app/redux/reducers/ui/projects.ts@@ -52,7 +52,7 @@ const initialState: IInitialState = {dashboardPaginationPage: 1,dashboardPaginationPageShared: 1,dashboardPaginationPageCaptcha: 1,- dashboardTabs: getItem('dashboardTabs') as string || tabForOwnedProject,+ dashboardTabs: (getItem('dashboardTabs') as string) || tabForOwnedProject,projectTab: PROJECT_TABS.traffic,alerts: [],subscribers: [],@@ -64,10 +64,15 @@ const projectsSlice = createSlice({name: 'projects',initialState,reducers: {- setProjects(state, { payload }: PayloadAction<{- projects: Partial<IProject | ISharedProject>[]- shared?: boolean- }>) {+ setProjects(+ state,+ {+ payload,+ }: PayloadAction<{+ projects: Partial<IProject | ISharedProject>[]+ shared?: boolean+ }>,+ ) {if (payload.shared) {state.isLoadingShared = falsestate.sharedProjects = payload.projects as ISharedProject[]@@ -76,7 +81,7 @@ const projectsSlice = createSlice({state.projects = payload.projects as IProject[]}},- updateProject(state, { payload }: PayloadAction<{ project: Partial<IProject | ISharedProject>, pid: string }>) {+ updateProject(state, { payload }: PayloadAction<{ project: Partial<IProject | ISharedProject>; pid: string }>) {const { pid, project } = payloadstate.projects = _map(current(state.projects), (res) => {@@ -105,7 +110,7 @@ const projectsSlice = createSlice({setTotalMonthlyEvents(state, { payload }: PayloadAction<number>) {state.totalMonthlyEvents = payload},- setTotal(state, { payload }: PayloadAction<{ total: number, shared?: boolean }>) {+ setTotal(state, { payload }: PayloadAction<{ total: number; shared?: boolean }>) {if (payload.shared) {state.sharedTotal = payload.total} else {@@ -129,7 +134,7 @@ const projectsSlice = createSlice({...data,}},- setLiveStatsProject(state, { payload }: PayloadAction<{ id: string, count: number }>) {+ setLiveStatsProject(state, { payload }: PayloadAction<{ id: string; count: number }>) {const { id, count } = payloadstate.liveStats = {@@ -137,32 +142,40 @@ const projectsSlice = createSlice({[id]: count,}},- setPublicProject(state, { payload }: PayloadAction<{ project: Partial<IProject | ISharedProject>, shared?: boolean }>) {+ setPublicProject(+ state,+ { payload }: PayloadAction<{ project: Partial<IProject | ISharedProject>; shared?: boolean }>,+ ) {const { project, shared = false } = payloadif (shared) {- state.sharedProjects = _findIndex(current(state.sharedProjects), (el) => el.id === project.id) >= 0- ? state.sharedProjects- : [- ...state.sharedProjects,- {- ...project as ISharedProject,- uiHidden: true,- },- ]+ state.sharedProjects =+ _findIndex(current(state.sharedProjects), (el) => el.id === project.id) >= 0+ ? state.sharedProjects+ : [+ ...state.sharedProjects,+ {+ ...(project as ISharedProject),+ uiHidden: true,+ },+ ]} else {- state.projects = _findIndex(current(state.projects), (el) => el.id === project.id) >= 0- ? state.projects- : [- ...state.projects,- {- ...project as IProject,- uiHidden: true,- },- ]+ state.projects =+ _findIndex(current(state.projects), (el) => el.id === project.id) >= 0+ ? state.projects+ : [+ ...state.projects,+ {+ ...(project as IProject),+ uiHidden: true,+ },+ ]}},- setProjectsShareData(state, { payload }: PayloadAction<{ data: Partial<IProject> | Partial<ISharedProject>, id: string, shared?: boolean }>) {+ setProjectsShareData(+ state,+ { payload }: PayloadAction<{ data: Partial<IProject> | Partial<ISharedProject>; id: string; shared?: boolean }>,+ ) {const { data, id, shared = false } = payloadif (shared) {@@ -190,7 +203,7 @@ const projectsSlice = createSlice({setProjectsError(state, { payload }: PayloadAction<string>) {state.error = payload},- removeProject(state, { payload }: PayloadAction<{ pid: string, shared: boolean }>) {+ removeProject(state, { payload }: PayloadAction<{ pid: string; shared: boolean }>) {const { pid, shared = false } = payloadif (shared) {@@ -201,7 +214,7 @@ const projectsSlice = createSlice({state.total -= 1}},- setProjectsLoading(state, { payload }: PayloadAction<{ isLoading: boolean, shared?: boolean }>) {+ setProjectsLoading(state, { payload }: PayloadAction<{ isLoading: boolean; shared?: boolean }>) {const { isLoading, shared = false } = payloadif (shared) {@@ -217,7 +230,7 @@ const projectsSlice = createSlice({setProjectTab(state, { payload }: PayloadAction<string>) {state.projectTab = payload},- setProjectProtectedPassword: (state, { payload }: PayloadAction<{ id: string, password: string }>) => {+ setProjectProtectedPassword: (state, { payload }: PayloadAction<{ id: string; password: string }>) => {const { id, password } = payloadstate.password = {diff --git a/app/redux/reducers/ui/theme.ts b/app/redux/reducers/ui/theme.tsindex 2a4c72c1a..dd74e648c 100644--- a/app/redux/reducers/ui/theme.ts+++ b/app/redux/reducers/ui/theme.ts@@ -1,9 +1,7 @@import { createSlice, PayloadAction } from '@reduxjs/toolkit'import _includes from 'lodash/includes'import { setCookie, getCookie } from 'utils/cookie'-import {- isBrowser, LS_THEME_SETTING, SUPPORTED_THEMES, THEME_TYPE, ThemeType,-} from 'redux/constants'+import { isBrowser, LS_THEME_SETTING, SUPPORTED_THEMES, THEME_TYPE, ThemeType } from 'redux/constants'const setThemeToDOM = (theme: string) => {if (!isBrowser) {@@ -32,7 +30,7 @@ const getInitialTheme = (): ThemeType => {return 'light'}- const queryTheme = new URLSearchParams(window.location.search).get('theme') as (ThemeType | null)+ const queryTheme = new URLSearchParams(window.location.search).get('theme') as ThemeType | nullif (queryTheme && _includes(SUPPORTED_THEMES, queryTheme)) {setThemeToDOM(queryTheme)diff --git a/app/redux/sagas/actions/index.ts b/app/redux/sagas/actions/index.tsindex 093f8d7e6..e99fb1903 100644--- a/app/redux/sagas/actions/index.ts+++ b/app/redux/sagas/actions/index.ts@@ -37,76 +37,122 @@ const loadProjectAlerts = (take?: number, skip?: number) => ({payload: { take, skip },})-const loginAsync = (credentials: {- email: string,- password: string,- dontRemember: boolean,-}, callback = () => { }) => ({+const loginAsync = (+ credentials: {+ email: string+ password: string+ dontRemember: boolean+ },+ callback = () => {},+) => ({type: types.LOGIN_ASYNC,payload: {- credentials, callback,+ credentials,+ callback,},})// currently only google is supported, in future we should provide a variable specifying the provider-const authSSO = (provider: string, dontRemember: boolean, t: (key: string) => string = () => '', callback: (res: any) => void = () => { }) => ({+const authSSO = (+ provider: string,+ dontRemember: boolean,+ t: (key: string) => string = () => '',+ callback: (res: any) => void = () => {},+) => ({type: types.AUTH_SSO,payload: {- dontRemember, callback, t, provider,+ dontRemember,+ callback,+ t,+ provider,},})// currently only google is supported, in future we should provide a variable specifying the provider-const linkSSO = (t: (key: string) => string = () => '', callback: (res: any) => void = () => { }, provider = 'google') => ({+const linkSSO = (+ t: (key: string) => string = () => '',+ callback: (res: any) => void = () => {},+ provider = 'google',+) => ({type: types.LINK_SSO,payload: {- callback, t, provider,+ callback,+ t,+ provider,},})// currently only google is supported, in future we should provide a variable specifying the provider-const unlinkSSO = (t: (key: string) => string = () => '', callback: (res: any) => void = () => { }, provider = 'google') => ({+const unlinkSSO = (+ t: (key: string) => string = () => '',+ callback: (res: any) => void = () => {},+ provider = 'google',+) => ({type: types.UNLINK_SSO,payload: {- callback, t, provider,+ callback,+ t,+ provider,},})-const signupAsync = (data: {- email: string,- password: string,-}, t?: (string: string) => {}, callback = (res: any) => { }) => ({+const signupAsync = (+ data: {+ email: string+ password: string+ },+ t?: (string: string) => {},+ callback = (res: any) => {},+) => ({type: types.SIGNUP_ASYNC,payload: {- data, callback, t,+ data,+ callback,+ t,},})-const emailVerifyAsync = (data: {- id: string,-}, successfulCallback?: () => void, errorCallback?: (e: string) => void) => ({+const emailVerifyAsync = (+ data: {+ id: string+ },+ successfulCallback?: () => void,+ errorCallback?: (e: string) => void,+) => ({type: types.EMAIL_VERIFY_ASYNC,payload: { data, successfulCallback, errorCallback },})-const updateUserProfileAsync = (data: Partial<IUser>, callback = (item: any) => { }) => ({+const updateUserProfileAsync = (data: Partial<IUser>, callback = (item: any) => {}) => ({type: types.UPDATE_USER_PROFILE_ASYNC,payload: { data, callback },})-const deleteAccountAsync = (errorCallback?: (e: string) => {}, successCallback?: (str?: string) => void, deletionFeedback?: string, t?: (str: string) => {}) => {+const deleteAccountAsync = (+ errorCallback?: (e: string) => {},+ successCallback?: (str?: string) => void,+ deletionFeedback?: string,+ t?: (str: string) => {},+) => {return {type: types.DELETE_ACCOUNT_ASYNC,payload: {- errorCallback, successCallback, t, deletionFeedback,+ errorCallback,+ successCallback,+ t,+ deletionFeedback,},}}-const shareVerifyAsync = (data: {- id: string,- path: string-}, successfulCallback?: () => void, errorCallback?: (error: string) => void) => ({+const shareVerifyAsync = (+ data: {+ id: string+ path: string+ },+ successfulCallback?: () => void,+ errorCallback?: (error: string) => void,+) => ({type: types.SHARE_VERIFY_ASYNC,payload: { data, successfulCallback, errorCallback },})@@ -125,7 +171,8 @@ const logout = (basedOn401Error: boolean, isLogoutAll: boolean) => {const updateShowLiveVisitorsInTitle = (show: boolean, callback: (isSuccess: boolean) => void) => ({type: types.UPDATE_SHOW_LIVE_VISITORS_IN_TITLE,payload: {- show, callback,+ show,+ callback,},})diff --git a/app/redux/sagas/auth/watchers/index.ts b/app/redux/sagas/auth/watchers/index.tsindex 4694e9794..01a95c647 100644--- a/app/redux/sagas/auth/watchers/index.ts+++ b/app/redux/sagas/auth/watchers/index.ts@@ -63,9 +63,15 @@ function* watchUpdateShowLiveVisitorsInTitle() {export default function* watchAuth() {yield all([- call(watchLogin), call(watchSignup), call(watchVerifyEmail),- call(watchUpdateUserProfile), call(watchDeleteUserProfile),- call(watchLogout), call(watchAuthSSO), call(watchLinkSSO),- call(watchUnlinkSSO), call(watchUpdateShowLiveVisitorsInTitle),+ call(watchLogin),+ call(watchSignup),+ call(watchVerifyEmail),+ call(watchUpdateUserProfile),+ call(watchDeleteUserProfile),+ call(watchLogout),+ call(watchAuthSSO),+ call(watchLinkSSO),+ call(watchUnlinkSSO),+ call(watchUpdateShowLiveVisitorsInTitle),])}diff --git a/app/redux/sagas/auth/workers/deleteUserAccount.ts b/app/redux/sagas/auth/workers/deleteUserAccount.tsindex e5c42c349..44cba554e 100644--- a/app/redux/sagas/auth/workers/deleteUserAccount.ts+++ b/app/redux/sagas/auth/workers/deleteUserAccount.ts@@ -4,22 +4,26 @@ import { authActions } from 'redux/reducers/auth'import { alertsActions } from 'redux/reducers/alerts'const { deleteUser } = require('api')-export default function* deleteUserAccountWorker({ payload: { errorCallback, successCallback, t, deletionFeedback } }: {+export default function* deleteUserAccountWorker({+ payload: { errorCallback, successCallback, t, deletionFeedback },+}: {payload: {- errorCallback: (error: any) => void,- successCallback: () => void,- t: (key: string) => string,- deletionFeedback: string,- },+ errorCallback: (error: any) => void+ successCallback: () => void+ t: (key: string) => string+ deletionFeedback: string+ }}) {try {yield call(deleteUser, deletionFeedback)yield call(successCallback)yield put(authActions.deleteAccountSuccess())- yield put(alertsActions.accountDeleted({- message: t('apiNotifications.accountDeleted'),- type: 'success',- }))+ yield put(+ alertsActions.accountDeleted({+ message: t('apiNotifications.accountDeleted'),+ type: 'success',+ }),+ )} catch (error) {let messagediff --git a/app/redux/sagas/auth/workers/logout.ts b/app/redux/sagas/auth/workers/logout.tsindex 5d1c2a45b..da65a14dc 100644--- a/app/redux/sagas/auth/workers/logout.ts+++ b/app/redux/sagas/auth/workers/logout.ts@@ -8,7 +8,11 @@ const { getGeneralStats, logoutApi, logoutAllApi } = require('api')const debug = Debug('swetrix:rx:s:logout')-export default function* logoutWorker({ payload: { basedOn401Error, isLogoutAll } }: { payload: { basedOn401Error: boolean, isLogoutAll: boolean } }) {+export default function* logoutWorker({+ payload: { basedOn401Error, isLogoutAll },+}: {+ payload: { basedOn401Error: boolean; isLogoutAll: boolean }+}) {try {const refreshToken = getRefreshToken()diff --git a/app/redux/sagas/auth/workers/signin.ts b/app/redux/sagas/auth/workers/signin.tsindex 2369ad0a0..9d6223728 100644--- a/app/redux/sagas/auth/workers/signin.ts+++ b/app/redux/sagas/auth/workers/signin.ts@@ -10,21 +10,21 @@ import { setRefreshToken } from 'utils/refreshToken'import sagaActions from '../../actions/index'const { login } = require('api')-export default function* singinWorker({ payload: { credentials, callback } }: {+export default function* singinWorker({+ payload: { credentials, callback },+}: {payload: {credentials: {- email: string,- password: string,- dontRemember: boolean,- },- callback: (isSuccess: boolean, isTwoFactorAuthenticationEnabled: boolean) => void,- },+ email: string+ password: string+ dontRemember: boolean+ }+ callback: (isSuccess: boolean, isTwoFactorAuthenticationEnabled: boolean) => void+ }}) {try {const { dontRemember } = credentials- const {- user, accessToken, refreshToken,- } = yield call(login, _omit(credentials, ['dontRemember']))+ const { user, accessToken, refreshToken } = yield call(login, _omit(credentials, ['dontRemember']))yield put(authActions.setDontRemember(dontRemember))@@ -47,9 +47,11 @@ export default function* singinWorker({ payload: { credentials, callback } }: {} catch (error) {// @ts-ignoreconst err = _isObject(error) ? error.message : error- yield put(errorsActions.loginFailed({- message: err || 'apiNotifications.somethingWentWrong',- }))+ yield put(+ errorsActions.loginFailed({+ message: err || 'apiNotifications.somethingWentWrong',+ }),+ )callback(false, false)} finally {yield put(authActions.finishLoading())diff --git a/app/redux/sagas/auth/workers/signup.ts b/app/redux/sagas/auth/workers/signup.tsindex bc79a1385..95dd64b75 100644--- a/app/redux/sagas/auth/workers/signup.ts+++ b/app/redux/sagas/auth/workers/signup.ts@@ -9,15 +9,17 @@ import { REFERRAL_COOKIE } from 'redux/constants'import sagaActions from '../../actions'const { signup } = require('api')-export default function* signupWorder({ payload: { data: rawData, callback } }: {+export default function* signupWorder({+ payload: { data: rawData, callback },+}: {payload: {data: {- email: string,+ email: stringpassword: stringrepeat: stringdontRemember: booleancheckIfLeaked: boolean- },+ }callback: (isSuccess: boolean) => void}}) {@@ -25,7 +27,9 @@ export default function* signupWorder({ payload: { data: rawData, callback } }:const { dontRemember } = rawDataconst refCode = getCookie(REFERRAL_COOKIE)const {- user, accessToken, refreshToken, // theme,+ user,+ accessToken,+ refreshToken, // theme,// @ts-ignore} = yield call(signup, {email: rawData.email,diff --git a/app/redux/sagas/auth/workers/sso_auth.ts b/app/redux/sagas/auth/workers/sso_auth.tsindex aafc8d18c..be93e9d4d 100644--- a/app/redux/sagas/auth/workers/sso_auth.ts+++ b/app/redux/sagas/auth/workers/sso_auth.ts@@ -8,9 +8,7 @@ import { openBrowserWindow } from 'utils/generic'import { getCookie, deleteCookie } from 'utils/cookie'import { REFERRAL_COOKIE } from 'redux/constants'import sagaActions from '../../actions/index'-const {- getJWTBySSOHash, generateSSOAuthURL,-} = require('api')+const { getJWTBySSOHash, generateSSOAuthURL } = require('api')const AUTH_WINDOW_WIDTH = 600const AUTH_WINDOW_HEIGHT = 800@@ -26,25 +24,21 @@ interface ISSOAuth {}}-export default function* ssoAuth({- payload: {- callback, dontRemember, t, provider,- },-}: ISSOAuth) {+export default function* ssoAuth({ payload: { callback, dontRemember, t, provider } }: ISSOAuth) {const authWindow = openBrowserWindow('', AUTH_WINDOW_WIDTH, AUTH_WINDOW_HEIGHT)if (!authWindow) {- yield put(errorsActions.loginFailed({- message: t('apiNotifications.socialisationAuthGenericError'),- }))+ yield put(+ errorsActions.loginFailed({+ message: t('apiNotifications.socialisationAuthGenericError'),+ }),+ )callback(false, false)return}try {- const {- uuid, auth_url: authUrl, expires_in: expiresIn,- } = yield call(generateSSOAuthURL, provider)+ const { uuid, auth_url: authUrl, expires_in: expiresIn } = yield call(generateSSOAuthURL, provider)// Set the URL of the authentification browser windowauthWindow.location = authUrl@@ -58,9 +52,7 @@ export default function* ssoAuth({yield delay(HASH_CHECK_FREQUENCY)try {- const {- accessToken, refreshToken, user,- } = yield call(getJWTBySSOHash, uuid, provider, refCode)+ const { accessToken, refreshToken, user } = yield call(getJWTBySSOHash, uuid, provider, refCode)authWindow.close()if (refCode) {@@ -96,9 +88,11 @@ export default function* ssoAuth({}}} catch (reason) {- yield put(errorsActions.loginFailed({- message: t('apiNotifications.socialisationAuthGenericError'),- }))+ yield put(+ errorsActions.loginFailed({+ message: t('apiNotifications.socialisationAuthGenericError'),+ }),+ )callback(false, false)}}diff --git a/app/redux/sagas/auth/workers/sso_link.ts b/app/redux/sagas/auth/workers/sso_link.tsindex b04f7c0b2..35e5d8716 100644--- a/app/redux/sagas/auth/workers/sso_link.ts+++ b/app/redux/sagas/auth/workers/sso_link.ts@@ -4,9 +4,7 @@ import { authActions } from 'redux/reducers/auth'import { errorsActions } from 'redux/reducers/errors'import { alertsActions } from 'redux/reducers/alerts'import { openBrowserWindow } from 'utils/generic'-const {- linkBySSOHash, generateSSOAuthURL, authMe,-} = require('api')+const { linkBySSOHash, generateSSOAuthURL, authMe } = require('api')const AUTH_WINDOW_WIDTH = 600const AUTH_WINDOW_HEIGHT = 800@@ -25,17 +23,17 @@ export default function* ssoLink({ payload: { callback, t, provider } }: ISSOLinconst authWindow = openBrowserWindow('', AUTH_WINDOW_WIDTH, AUTH_WINDOW_HEIGHT)if (!authWindow) {- yield put(errorsActions.loginFailed({- message: t('apiNotifications.socialisationGenericError'),- }))+ yield put(+ errorsActions.loginFailed({+ message: t('apiNotifications.socialisationGenericError'),+ }),+ )callback(false)return}try {- const {- uuid, auth_url: authUrl, expires_in: expiresIn,- } = yield call(generateSSOAuthURL, provider)+ const { uuid, auth_url: authUrl, expires_in: expiresIn } = yield call(generateSSOAuthURL, provider)// Set the URL of the authentification browser windowauthWindow.location = authUrl@@ -54,10 +52,12 @@ export default function* ssoLink({ payload: { callback, t, provider } }: ISSOLinconst user = yield call(authMe)yield put(authActions.loginSuccessful(user))- yield put(alertsActions.generateAlerts({- message: t('apiNotifications.socialAccountLinked'),- type: 'success',- }))+ yield put(+ alertsActions.generateAlerts({+ message: t('apiNotifications.socialAccountLinked'),+ type: 'success',+ }),+ )callback(true)return@@ -70,9 +70,11 @@ export default function* ssoLink({ payload: { callback, t, provider } }: ISSOLin}}} catch (reason) {- yield put(errorsActions.loginFailed({- message: t('apiNotifications.socialisationGenericError'),- }))+ yield put(+ errorsActions.loginFailed({+ message: t('apiNotifications.socialisationGenericError'),+ }),+ )callback(false)}}diff --git a/app/redux/sagas/auth/workers/sso_unlink.ts b/app/redux/sagas/auth/workers/sso_unlink.tsindex 2eaca06e6..d9ded412e 100644--- a/app/redux/sagas/auth/workers/sso_unlink.ts+++ b/app/redux/sagas/auth/workers/sso_unlink.ts@@ -6,9 +6,7 @@ import { authActions } from 'redux/reducers/auth'import { errorsActions } from 'redux/reducers/errors'import { alertsActions } from 'redux/reducers/alerts'import { SSO_PROVIDERS } from 'redux/constants'-const {- unlinkSSO, authMe,-} = require('api')+const { unlinkSSO, authMe } = require('api')export interface ISSOUnlink {payload: {@@ -31,15 +29,19 @@ export default function* ssoUnlink({ payload: { provider, t, callback } }: ISSOUconst user = yield call(authMe)yield put(authActions.loginSuccessful(user))- yield put(alertsActions.generateAlerts({- message: t('apiNotifications.socialAccountUninked'),- type: 'success',- }))+ yield put(+ alertsActions.generateAlerts({+ message: t('apiNotifications.socialAccountUninked'),+ type: 'success',+ }),+ )callback(true)} catch (reason) {- yield put(errorsActions.loginFailed({- message: t('apiNotifications.socialisationUnlinkGenericError'),- }))+ yield put(+ errorsActions.loginFailed({+ message: t('apiNotifications.socialisationUnlinkGenericError'),+ }),+ )callback(false)}}diff --git a/app/redux/sagas/auth/workers/updateUserProfile.ts b/app/redux/sagas/auth/workers/updateUserProfile.tsindex 776b92258..2cad7741b 100644--- a/app/redux/sagas/auth/workers/updateUserProfile.ts+++ b/app/redux/sagas/auth/workers/updateUserProfile.ts@@ -5,7 +5,9 @@ import { errorsActions } from 'redux/reducers/errors'import { IUser } from '../../../models/IUser'const { changeUserDetails } = require('api')-export default function* updateUserProfileWorker({ payload: { data, callback } }: {+export default function* updateUserProfileWorker({+ payload: { data, callback },+}: {payload: {data: IUsercallback: (isSuccess: boolean) => void@@ -19,10 +21,12 @@ export default function* updateUserProfileWorker({ payload: { data, callback } }isSuccess = true} catch (e: unknown) {const error = e as { message: string } | string[] | string- yield put(errorsActions.updateUserProfileFailed({- // @ts-ignore- message: error?.message || (typeof error === 'string' ? error : error[0]),- }))+ yield put(+ errorsActions.updateUserProfileFailed({+ // @ts-ignore+ message: error?.message || (typeof error === 'string' ? error : error[0]),+ }),+ )} finally {yield put(authActions.finishLoading())callback(isSuccess)diff --git a/app/redux/sagas/auth/workers/update_show_live_visitors_in_title.ts b/app/redux/sagas/auth/workers/update_show_live_visitors_in_title.tsindex 66eee655e..7fe8de266 100644--- a/app/redux/sagas/auth/workers/update_show_live_visitors_in_title.ts+++ b/app/redux/sagas/auth/workers/update_show_live_visitors_in_title.ts@@ -10,9 +10,7 @@ interface IPayload {callback: (isSuccess: boolean) => void}-export default function* updateShowLiveVisitorsInTitle({ payload: { show, callback } }: {- payload: IPayload-}) {+export default function* updateShowLiveVisitorsInTitle({ payload: { show, callback } }: { payload: IPayload }) {let isSuccess = falsetry {@@ -22,10 +20,12 @@ export default function* updateShowLiveVisitorsInTitle({ payload: { show, callbaisSuccess = true} catch (e: unknown) {const error = e as { message: string } | string[] | string- yield put(errorsActions.updateUserProfileFailed({- // @ts-ignore- message: error?.message || (typeof error === 'string' ? error : error[0]),- }))+ yield put(+ errorsActions.updateUserProfileFailed({+ // @ts-ignore+ message: error?.message || (typeof error === 'string' ? error : error[0]),+ }),+ )} finally {callback(isSuccess)}diff --git a/app/redux/sagas/auth/workers/verifyEmail.ts b/app/redux/sagas/auth/workers/verifyEmail.tsindex eed2cf073..1dddcce7e 100644--- a/app/redux/sagas/auth/workers/verifyEmail.ts+++ b/app/redux/sagas/auth/workers/verifyEmail.ts@@ -3,14 +3,16 @@ import { call, put } from 'redux-saga/effects'import { authActions } from 'redux/reducers/auth'const { verifyEmail } = require('api')-export default function* verifyEmailWorker({ payload: { data, successfulCallback, errorCallback } }: {+export default function* verifyEmailWorker({+ payload: { data, successfulCallback, errorCallback },+}: {payload: {data: {- id: string,- },- successfulCallback: () => void,- errorCallback: (error: any) => void,- },+ id: string+ }+ successfulCallback: () => void+ errorCallback: (error: any) => void+ }}) {try {// @ts-ignorediff --git a/app/redux/sagas/ui/initialise.ts b/app/redux/sagas/ui/initialise.tsindex fb297e59e..334ae6d0e 100644--- a/app/redux/sagas/ui/initialise.ts+++ b/app/redux/sagas/ui/initialise.ts@@ -27,8 +27,8 @@ export default function* initialise() {yield put(sagaActions.loadMetainfo())const lastBlogPost: {- title: string,- handle: string,+ title: string+ handle: string} = yield call(getLastPost)yield put(UIActions.setLastBlogPost(lastBlogPost))}diff --git a/app/redux/sagas/ui/load_alerts.ts b/app/redux/sagas/ui/load_alerts.tsindex 9210f47f9..ff4146099 100644--- a/app/redux/sagas/ui/load_alerts.ts+++ b/app/redux/sagas/ui/load_alerts.ts@@ -18,16 +18,20 @@ export default function* loadProjectAlerts({ payload: { take = DEFAULT_ALERTS_TAconst { results, total, page_total: pageTotal } = yield call(getAlerts, take, skip)yield put(UIActions.setProjectAlerts(results))- yield put(UIActions.setProjectAlertsTotal({- total,- pageTotal,- }))+ yield put(+ UIActions.setProjectAlertsTotal({+ total,+ pageTotal,+ }),+ )} catch (e: unknown) {const { message } = e as { message: string }if (_isString(message)) {- yield put(errorsActions.setError({- message,- }))+ yield put(+ errorsActions.setError({+ message,+ }),+ )}debug('failed to load extensions: %s', message)} finally {diff --git a/app/redux/sagas/ui/load_extensions.ts b/app/redux/sagas/ui/load_extensions.tsindex aeefef3ca..7a83fa7d3 100644--- a/app/redux/sagas/ui/load_extensions.ts+++ b/app/redux/sagas/ui/load_extensions.ts@@ -3,9 +3,7 @@ import Debug from 'debug'import UIActions from 'redux/reducers/ui'import { isSelfhosted } from 'redux/constants'-const {- getInstalledExtensions,-} = require('api')+const { getInstalledExtensions } = require('api')const debug = Debug('swetrix:rx:s:load-extensions')diff --git a/app/redux/sagas/ui/load_metainfo.ts b/app/redux/sagas/ui/load_metainfo.tsindex a508baa38..6e3180a79 100644--- a/app/redux/sagas/ui/load_metainfo.ts+++ b/app/redux/sagas/ui/load_metainfo.ts@@ -4,9 +4,7 @@ import Debug from 'debug'import UIActions from 'redux/reducers/ui'import { isSelfhosted } from 'redux/constants'import { IMetainfo } from 'redux/models/IMetainfo'-const {- getPaymentMetainfo,-} = require('api')+const { getPaymentMetainfo } = require('api')const debug = Debug('swetrix:rx:s:metainfo')diff --git a/app/redux/sagas/ui/load_projects.ts b/app/redux/sagas/ui/load_projects.tsindex 4ea6662c0..1c4aa6244 100644--- a/app/redux/sagas/ui/load_projects.ts+++ b/app/redux/sagas/ui/load_projects.ts@@ -8,13 +8,13 @@ import UIActions from 'redux/reducers/ui'import { ENTRIES_PER_PAGE_DASHBOARD } from 'redux/constants'import { IOverall } from 'redux/models/IProject'-const {- getProjects, getOverallStats, getLiveVisitors, getOverallStatsCaptcha,-} = require('../../../api')+const { getProjects, getOverallStats, getLiveVisitors, getOverallStatsCaptcha } = require('../../../api')const debug = Debug('swetrix:rx:s:load-projects')-export default function* loadProjects({ payload: { take = ENTRIES_PER_PAGE_DASHBOARD, skip = 0, isCaptcha = false, search = '' } }) {+export default function* loadProjects({+ payload: { take = ENTRIES_PER_PAGE_DASHBOARD, skip = 0, isCaptcha = false, search = '' },+}) {const token = getAccessToken()if (!token) {@@ -25,18 +25,22 @@ export default function* loadProjects({ payload: { take = ENTRIES_PER_PAGE_DASHBif (isCaptcha) {yield put(UIActions.setCaptchaLoading(true))} else {- yield put(UIActions.setProjectsLoading({- isLoading: true,- shared: false,- }))+ yield put(+ UIActions.setProjectsLoading({+ isLoading: true,+ shared: false,+ }),+ )}let {// eslint-disable-next-line prefer-const, camelcase- results, totalMonthlyEvents, total,+ results,+ totalMonthlyEvents,+ total,} = yield call(getProjects, take, skip, isCaptcha, search)- const pids = _map(results, result => result.id)+ const pids = _map(results, (result) => result.id)let overall: IOverall = {}@@ -60,19 +64,25 @@ export default function* loadProjects({ payload: { take = ENTRIES_PER_PAGE_DASHByield put(UIActions.setCaptchaProjects(results))yield put(UIActions.setCaptchaTotal(total))} else {- yield put(UIActions.setProjects({- projects: results,- }))+ yield put(+ UIActions.setProjects({+ projects: results,+ }),+ )yield put(UIActions.setTotalMonthlyEvents(totalMonthlyEvents))- yield put(UIActions.setTotal({- total,- }))+ yield put(+ UIActions.setTotal({+ total,+ }),+ )}const liveStats: any[] = yield call(getLiveVisitors, pids)- yield put(UIActions.setLiveStats({- data: liveStats,- }))+ yield put(+ UIActions.setLiveStats({+ data: liveStats,+ }),+ )} catch (e: unknown) {const { message } = e as { message: string }if (_isString(message)) {diff --git a/app/redux/sagas/ui/load_shared_projects.ts b/app/redux/sagas/ui/load_shared_projects.tsindex 94a94ac29..5f673012f 100644--- a/app/redux/sagas/ui/load_shared_projects.ts+++ b/app/redux/sagas/ui/load_shared_projects.ts@@ -7,9 +7,7 @@ import UIActions from 'redux/reducers/ui'import { ENTRIES_PER_PAGE_DASHBOARD, isSelfhosted } from 'redux/constants'import { IOverall } from 'redux/models/IProject'-const {- getSharedProjects, getOverallStats, getLiveVisitors,-} = require('api')+const { getSharedProjects, getOverallStats, getLiveVisitors } = require('api')const debug = Debug('swetrix:rx:s:load-projects')@@ -19,14 +17,17 @@ export default function* loadSharedProjects({ payload: { take = ENTRIES_PER_PAGE}try {- yield put(UIActions.setProjectsLoading({- isLoading: true,- shared: true,- }))+ yield put(+ UIActions.setProjectsLoading({+ isLoading: true,+ shared: true,+ }),+ )let {// eslint-disable-next-line prefer-const- results, total,+ results,+ total,} = yield call(getSharedProjects, take, skip, search)if (total === 0) {@@ -53,19 +54,25 @@ export default function* loadSharedProjects({ payload: { take = ENTRIES_PER_PAGEdebug('failed to overall stats: %s', e)}- yield put(UIActions.setProjects({- projects: projectsWithShared,- shared: true,- }))- yield put(UIActions.setTotal({- total,- shared: true,- }))+ yield put(+ UIActions.setProjects({+ projects: projectsWithShared,+ shared: true,+ }),+ )+ yield put(+ UIActions.setTotal({+ total,+ shared: true,+ }),+ )const liveStats: any[] = yield call(getLiveVisitors, pids)- yield put(UIActions.setLiveStats({- data: liveStats,- }))+ yield put(+ UIActions.setLiveStats({+ data: liveStats,+ }),+ )} catch (e: unknown) {const { message } = e as { message: string }if (_isString(message)) {diff --git a/app/redux/sagas/ui/load_usageinfo.ts b/app/redux/sagas/ui/load_usageinfo.tsindex 4f3c10acf..4922d49c0 100644--- a/app/redux/sagas/ui/load_usageinfo.ts+++ b/app/redux/sagas/ui/load_usageinfo.ts@@ -4,9 +4,7 @@ import Debug from 'debug'import UIActions from 'redux/reducers/ui'import { isSelfhosted } from 'redux/constants'import { IUsageInfo } from 'redux/models/IUsageinfo'-const {- getUsageInfo,-} = require('api')+const { getUsageInfo } = require('api')const debug = Debug('swetrix:rx:s:usageinfo')@@ -15,7 +13,7 @@ export default function* loadUsageinfo() {return}- const isUsageinfoLoaded: boolean = yield select(state => state.ui.misc.usageinfoLoaded)+ const isUsageinfoLoaded: boolean = yield select((state) => state.ui.misc.usageinfoLoaded)if (isUsageinfoLoaded) {returndiff --git a/app/redux/sagas/ui/share_verify.ts b/app/redux/sagas/ui/share_verify.tsindex 151311d49..2bbadefdb 100644--- a/app/redux/sagas/ui/share_verify.ts+++ b/app/redux/sagas/ui/share_verify.ts@@ -2,15 +2,17 @@ import { call, put } from 'redux-saga/effects'import sagaActions from '../actions'const { verifyShare } = require('api')-export default function* shareVerify({ payload: { data, successfulCallback, errorCallback } }: {+export default function* shareVerify({+ payload: { data, successfulCallback, errorCallback },+}: {payload: {data: {- path: string,- id: string,- },- successfulCallback: () => void,- errorCallback: (error: any) => void,- },+ path: string+ id: string+ }+ successfulCallback: () => void+ errorCallback: (error: any) => void+ }}) {try {// @ts-ignorediff --git a/app/redux/sagas/ui/worker_general_stats.ts b/app/redux/sagas/ui/worker_general_stats.tsindex 5c781d81e..d5b52d8ab 100644--- a/app/redux/sagas/ui/worker_general_stats.ts+++ b/app/redux/sagas/ui/worker_general_stats.ts@@ -1,6 +1,4 @@-import {- put, call, delay,-} from 'redux-saga/effects'+import { put, call, delay } from 'redux-saga/effects'import Debug from 'debug'import UIActions from 'redux/reducers/ui'diff --git a/app/redux/sagas/ui/worker_is_events_available.ts b/app/redux/sagas/ui/worker_is_events_available.tsindex 4cd48741c..de2ae3299 100644--- a/app/redux/sagas/ui/worker_is_events_available.ts+++ b/app/redux/sagas/ui/worker_is_events_available.ts@@ -23,14 +23,14 @@ export default function* checkEventsAvailable() {return}- const isAuthenticated: boolean = yield select(state => state.auth.authenticated)+ const isAuthenticated: boolean = yield select((state) => state.auth.authenticated)if (!isAuthenticated) {yield delay(NOT_AUTHED_INTERVAL)continue}- const totalMonthlyEvents: number | null = yield select(state => state.ui.projects.totalMonthlyEvents)+ const totalMonthlyEvents: number | null = yield select((state) => state.ui.projects.totalMonthlyEvents)if (_isNull(totalMonthlyEvents)) {dataRequests++@@ -38,7 +38,7 @@ export default function* checkEventsAvailable() {continue}- const maxEventsCount: number = yield select(state => state.auth.user.maxEventsCount)+ const maxEventsCount: number = yield select((state) => state.auth.user.maxEventsCount)const eventsUsedPercentage = (totalMonthlyEvents * 100) / maxEventsCountdiff --git a/app/redux/sagas/ui/worker_live_visitors.ts b/app/redux/sagas/ui/worker_live_visitors.tsindex cbab800cf..8c6cd5b8f 100644--- a/app/redux/sagas/ui/worker_live_visitors.ts+++ b/app/redux/sagas/ui/worker_live_visitors.ts@@ -1,6 +1,4 @@-import {- put, call, delay, select,-} from 'redux-saga/effects'+import { put, call, delay, select } from 'redux-saga/effects'import _map from 'lodash/map'import _filter from 'lodash/filter'import _isEmpty from 'lodash/isEmpty'@@ -14,16 +12,19 @@ const { getLiveVisitors } = require('api')export default function* liveVisitors() {while (true) {yield delay(LIVE_VISITORS_UPDATE_INTERVAL)- const tab: string = yield select(state => state.ui.projects.dashboardTabs)+ const tab: string = yield select((state) => state.ui.projects.dashboardTabs)if (tabForSharedProject === tab) {- const sharedProjects: ISharedProject[] = yield select(state => state.ui.projects.sharedProjects)+ const sharedProjects: ISharedProject[] = yield select((state) => state.ui.projects.sharedProjects)if (_isEmpty(sharedProjects)) {continue}- const pids = _map(_filter(sharedProjects, ({ project }) => !project?.uiHidden), item => (item?.project?.id ? item.project.id : ''))+ const pids = _map(+ _filter(sharedProjects, ({ project }) => !project?.uiHidden),+ (item) => (item?.project?.id ? item.project.id : ''),+ )if (_isEmpty(pids)) {continue@@ -31,16 +32,21 @@ export default function* liveVisitors() {const liveStats: any[] = yield call(getLiveVisitors, pids)- yield put(UIActions.setLiveStats({- data: liveStats,- }))+ yield put(+ UIActions.setLiveStats({+ data: liveStats,+ }),+ )} else {- const projects: IProject[] = yield select(state => state.ui.projects.projects)+ const projects: IProject[] = yield select((state) => state.ui.projects.projects)if (_isEmpty(projects)) {continue}- const pids = _map(_filter(projects, ({ uiHidden }) => !uiHidden), project => project.id)+ const pids = _map(+ _filter(projects, ({ uiHidden }) => !uiHidden),+ (project) => project.id,+ )if (_isEmpty(pids)) {continue@@ -48,9 +54,11 @@ export default function* liveVisitors() {const liveStats: any[] = yield call(getLiveVisitors, pids)- yield put(UIActions.setLiveStats({- data: liveStats,- }))+ yield put(+ UIActions.setLiveStats({+ data: liveStats,+ }),+ )}}}diff --git a/app/root.tsx b/app/root.tsxindex a8cf1a0da..b3542a80d 100644--- a/app/root.tsx+++ b/app/root.tsx@@ -1,6 +1,4 @@-import type {- LinksFunction, LoaderArgs, HeadersFunction,-} from '@remix-run/node'+import type { LinksFunction, LoaderArgs, HeadersFunction } from '@remix-run/node'import { json, redirect } from '@remix-run/node'import { useState } from 'react'import {@@ -14,12 +12,8 @@ import {useRouteError,} from '@remix-run/react'import { store } from 'redux/store'-import {- isBrowser, CONTACT_EMAIL, LS_THEME_SETTING, isSelfhosted,-} from 'redux/constants'-import {- getCookie, generateCookieString,-} from 'utils/cookie'+import { isBrowser, CONTACT_EMAIL, LS_THEME_SETTING, isSelfhosted } from 'redux/constants'+import { getCookie, generateCookieString } from 'utils/cookie'import { ExclamationTriangleIcon, ChevronDownIcon, ChevronUpIcon } from '@heroicons/react/24/outline'import { Provider } from 'react-redux'import clsx from 'clsx'@@ -34,9 +28,7 @@ import { useChangeLanguage } from 'remix-i18next'import { useTranslation } from 'react-i18next'import AppWrapper from 'App'import { detectLanguage } from 'i18n'-import {- detectTheme, isAuthenticated, isWWW,-} from 'utils/server'+import { detectTheme, isAuthenticated, isWWW } from 'utils/server'import { LocaleLinks } from 'components/LocaleLinks'import { SEO } from 'components/SEO'@@ -112,31 +104,30 @@ export function ErrorBoundary() {</div><div className='py-8'><div className='text-center'>- <h1 className='text-4xl font-extrabold text-gray-900 dark:text-gray-50 tracking-tight sm:text-5xl'>Uh-oh..</h1>+ <h1 className='text-4xl font-extrabold text-gray-900 dark:text-gray-50 tracking-tight sm:text-5xl'>+ Uh-oh..+ </h1><p className='mt-2 text-base font-medium text-gray-800 dark:text-gray-300'>The app has crashed. We are sorry about that :(<br />- Please, tell us about it at- {' '}- {CONTACT_EMAIL}+ Please, tell us about it at {CONTACT_EMAIL}</p><p className='mt-6 text-base font-medium text-gray-800 dark:text-gray-300'>{isRouteErrorResponse(error) ? (<><span>- {error.status}- {' '}- {error.statusText}- </span>- <span>- {error.data}+ {error.status} {error.statusText}</span>+ <span>{error.data}</span></>) : error instanceof Error ? (<>{error.message}<br />- <span onClick={() => setCrashStackShown(prev => !prev)} className='flex justify-center items-center text-base text-gray-800 dark:text-gray-300 cursor-pointer hover:underline'>+ <span+ onClick={() => setCrashStackShown((prev) => !prev)}+ className='flex justify-center items-center text-base text-gray-800 dark:text-gray-300 cursor-pointer hover:underline'+ >{crashStackShown ? (<>Hide crash stack@@ -156,9 +147,7 @@ export function ErrorBoundary() {)}</>) : (- <>- Unknown error- </>+ <>Unknown error</>)}</p></div>@@ -208,16 +197,26 @@ export async function loader({ request }: LoaderArgs) {STAGING: process.env.STAGING,}- const init = storeThemeToCookie ? {- headers: {- // 21600 seconds = 6 hours- 'Set-Cookie': generateCookieString(LS_THEME_SETTING, theme, 21600),- },- } : undefined+ const init = storeThemeToCookie+ ? {+ headers: {+ // 21600 seconds = 6 hours+ 'Set-Cookie': generateCookieString(LS_THEME_SETTING, theme, 21600),+ },+ }+ : undefined- return json({- locale, url, theme, REMIX_ENV, isAuthed, pathname: urlObject.pathname,- }, init)+ return json(+ {+ locale,+ url,+ theme,+ REMIX_ENV,+ isAuthed,+ pathname: urlObject.pathname,+ },+ init,+ )}export const handle = {@@ -225,9 +224,7 @@ export const handle = {}export default function App() {- const {- locale, url, theme, REMIX_ENV, isAuthed,- } = useLoaderData<typeof loader>()+ const { locale, url, theme, REMIX_ENV, isAuthed } = useLoaderData<typeof loader>()const { i18n } = useTranslation('common')const urlObject = new URL(url)@@ -250,13 +247,17 @@ export default function App() {{theme === 'dark' && <link rel='stylesheet' href={FlatpickrDarkCss} />}{theme === 'light' && <link rel='stylesheet' href={FlatpickrLightCss} />}<LocaleLinks />- <link rel='preload' href={`/locales/${locale}.json`} as='fetch' type='application/json' crossOrigin='anonymous' />+ <link+ rel='preload'+ href={`/locales/${locale}.json`}+ as='fetch'+ type='application/json'+ crossOrigin='anonymous'+ /><script// eslint-disable-next-line react/no-dangerdangerouslySetInnerHTML={{- __html: `window.REMIX_ENV = ${JSON.stringify(- REMIX_ENV,- )}`,+ __html: `window.REMIX_ENV = ${JSON.stringify(REMIX_ENV)}`,}}/><script src='/env.js' />@@ -269,10 +270,7 @@ export default function App() {><Provider store={store}><AlertProvider template={AlertTemplate} {...options}>- <AppWrapper- ssrTheme={theme}- ssrAuthenticated={isAuthed}- />+ <AppWrapper ssrTheme={theme} ssrAuthenticated={isAuthed} /></AlertProvider></Provider><ScrollRestoration />diff --git a/app/routes/blog.$category.$slug.tsx b/app/routes/blog.$category.$slug.tsxindex d86b8bdac..47d0638f4 100644--- a/app/routes/blog.$category.$slug.tsx+++ b/app/routes/blog.$category.$slug.tsx@@ -17,31 +17,31 @@ export const meta: V2_MetaFunction = (loaderData: any) => {title: `${loaderData?.data?.title || 'Blog'} ${TITLE_SUFFIX}`,},{- property: "og:title",+ property: 'og:title',content: `${loaderData?.data?.title || 'Blog'} ${TITLE_SUFFIX}`,},{- property: "twitter:title",+ property: 'twitter:title',content: `${loaderData?.data?.title || 'Blog'} ${TITLE_SUFFIX}`,},{- property: "og:description",+ property: 'og:description',content: loaderData?.data?.intro || '',},{- property: "twitter:description",+ property: 'twitter:description',content: loaderData?.data?.intro || '',},{- property: "description",+ property: 'description',content: loaderData?.data?.intro || '',},{- property: "og:image",+ property: 'og:image',content: ogImageUrl,},{- property: "twitter:image",+ property: 'twitter:image',content: ogImageUrl,},]diff --git a/app/routes/blog.$slug.tsx b/app/routes/blog.$slug.tsxindex 3556fab9b..081f00a20 100644--- a/app/routes/blog.$slug.tsx+++ b/app/routes/blog.$slug.tsx@@ -6,9 +6,7 @@ import _last from 'lodash/last'import _join from 'lodash/join'import _isString from 'lodash/isString'import singlePostCss from 'css/mdfile.css'-import {- getPost, getSlugFromFilename, getDateFromFilename,-} from 'utils/getPosts'+import { getPost, getSlugFromFilename, getDateFromFilename } from 'utils/getPosts'import { getSitemap } from 'api'import { isSelfhosted, TITLE_SUFFIX, getOgImageUrl } from 'redux/constants'import Post from 'pages/Blog/Post'@@ -25,31 +23,31 @@ export const meta: V2_MetaFunction = (loaderData: any) => {title: `${loaderData?.data?.title || 'Blog'} ${TITLE_SUFFIX}`,},{- property: "og:title",+ property: 'og:title',content: `${loaderData?.data?.title || 'Blog'} ${TITLE_SUFFIX}`,},{- property: "twitter:title",+ property: 'twitter:title',content: `${loaderData?.data?.title || 'Blog'} ${TITLE_SUFFIX}`,},{- property: "og:description",+ property: 'og:description',content: loaderData?.data?.intro || '',},{- property: "twitter:description",+ property: 'twitter:description',content: loaderData?.data?.intro || '',},{- property: "description",+ property: 'description',content: loaderData?.data?.intro || '',},{- property: "og:image",+ property: 'og:image',content: ogImageUrl,},{- property: "twitter:image",+ property: 'twitter:image',content: ogImageUrl,},]@@ -58,7 +56,7 @@ export const meta: V2_MetaFunction = (loaderData: any) => {export const sitemap: SitemapFunction = async () => {const files = await getSitemap()- return _map(files, file => {+ return _map(files, (file) => {let handle: stringlet date: string@@ -72,7 +70,7 @@ export const sitemap: SitemapFunction = async () => {}return {- loc: `/blog/${handle}`,+ loc: `/blog/${handle}`,lastmod: date,changefreq: 'weekly',}diff --git a/app/routes/blog.tsx b/app/routes/blog.tsxindex 711a907ef..50907d515 100644--- a/app/routes/blog.tsx+++ b/app/routes/blog.tsx@@ -13,11 +13,11 @@ export const meta: V2_MetaFunction = () => {title: `Blog ${TITLE_SUFFIX}`,},{- property: "og:title",+ property: 'og:title',content: `Blog ${TITLE_SUFFIX}`,},{- property: "twitter:title",+ property: 'twitter:title',content: `Blog ${TITLE_SUFFIX}`,},]@@ -26,7 +26,7 @@ export const meta: V2_MetaFunction = () => {export default function Posts() {const posts: any[] = useLoaderData()- if (_filter(posts, post => !post.hidden).length === 0) {+ if (_filter(posts, (post) => !post.hidden).length === 0) {return (<div className='flex justify-center items-center min-h-min-footer'><h1 className='text-3xl font-bold text-slate-900 dark:text-slate-200'>No posts found</h1>@@ -41,7 +41,7 @@ export default function Posts() {<div className='hidden absolute top-3 bottom-0 right-full mr-7 md:mr-[3.25rem] w-px bg-slate-200 dark:bg-slate-700 sm:block'></div><div className='space-y-16'>- {_map(posts, post => {+ {_map(posts, (post) => {if (post.hidden) {return null}@@ -83,9 +83,7 @@ export default function Posts() {to={post.slug}><span className='absolute -inset-y-2.5 -inset-x-4 md:-inset-y-4 md:-inset-x-6 sm:rounded-2xl'></span>- <span className='relative'>- Read more- </span>+ <span className='relative'>Read more</span><svgclassName='relative mt-px overflow-visible ml-2.5 text-indigo-600 dark:text-gray-50'width='3'@@ -108,4 +106,4 @@ export default function Posts() {</div></div>)-}\ No newline at end of file+}diff --git a/app/routes/captchas.$id.tsx b/app/routes/captchas.$id.tsxindex 07470b59d..4d1ba2027 100644--- a/app/routes/captchas.$id.tsx+++ b/app/routes/captchas.$id.tsx@@ -2,9 +2,7 @@ import CaptchaView from 'pages/Captcha/View'import type { LinksFunction } from '@remix-run/node'import ProjectViewStyle from 'styles/ProjectViewStyle.css'-export const links: LinksFunction = () => [- { rel: 'stylesheet', href: ProjectViewStyle },-]+export const links: LinksFunction = () => [{ rel: 'stylesheet', href: ProjectViewStyle }]export default function Index() {return <CaptchaView />diff --git a/app/routes/index.tsx b/app/routes/index.tsxindex a50f85ecd..a3581fb6a 100644--- a/app/routes/index.tsx+++ b/app/routes/index.tsx@@ -24,9 +24,7 @@ export async function loader({ request }: LoaderArgs) {}export default function Index() {- const {- theme, isAuth,- } = useLoaderData<typeof loader>()+ const { theme, isAuth } = useLoaderData<typeof loader>()return <MainPage ssrTheme={theme} ssrAuthenticated={isAuth} />}diff --git a/app/routes/login.tsx b/app/routes/login.tsxindex da4a17bbf..20d523e05 100644--- a/app/routes/login.tsx+++ b/app/routes/login.tsx@@ -17,9 +17,7 @@ export async function loader({ request }: LoaderArgs) {}export default function Index() {- const {- theme,- } = useLoaderData<typeof loader>()+ const { theme } = useLoaderData<typeof loader>()return <Signin ssrTheme={theme} />}diff --git a/app/routes/open.tsx b/app/routes/open.tsxindex 335e1e623..e007f53f1 100644--- a/app/routes/open.tsx+++ b/app/routes/open.tsx@@ -6,9 +6,7 @@ import { isSelfhosted } from 'redux/constants'import Style from 'styles/ProjectViewStyle.css'export const links: LinksFunction = () => {- return [- { rel: 'stylesheet', href: Style },- ]+ return [{ rel: 'stylesheet', href: Style }]}export async function loader() {diff --git a/app/routes/projects.$id.password.tsx b/app/routes/projects.$id.password.tsxindex 342dd693a..2f2000301 100644--- a/app/routes/projects.$id.password.tsx+++ b/app/routes/projects.$id.password.tsx@@ -3,10 +3,7 @@ import type { LoaderArgs } from '@remix-run/node'import { useLoaderData } from '@remix-run/react'import { json } from '@remix-run/node'-import {- detectTheme, isEmbedded, getProjectPassword, isAuthenticated,-} from 'utils/server'-+import { detectTheme, isEmbedded, getProjectPassword, isAuthenticated } from 'utils/server'export async function loader({ request }: LoaderArgs) {const embedded = isEmbedded(request)@@ -15,14 +12,15 @@ export async function loader({ request }: LoaderArgs) {const isAuth = isAuthenticated(request)return json({- theme, embedded, queryPassword, isAuth,+ theme,+ embedded,+ queryPassword,+ isAuth,})}export default function Index() {- const {- theme, embedded, isAuth,- } = useLoaderData<typeof loader>()+ const { theme, embedded, isAuth } = useLoaderData<typeof loader>()return <ProjectProtectedPassword ssrTheme={theme} embedded={embedded} isAuth={isAuth} />}diff --git a/app/routes/projects.$id.tsx b/app/routes/projects.$id.tsxindex fd416a1b2..5d5bd7202 100644--- a/app/routes/projects.$id.tsx+++ b/app/routes/projects.$id.tsx@@ -5,14 +5,10 @@ import { json } from '@remix-run/node'import _split from 'lodash/split'import { API_URL } from 'redux/constants'-import {- detectTheme, isEmbedded, isAuthenticated, getProjectPassword, getProjectTabs,-} from 'utils/server'+import { detectTheme, isEmbedded, isAuthenticated, getProjectPassword, getProjectTabs } from 'utils/server'import ProjectViewStyle from 'styles/ProjectViewStyle.css'-export const links: LinksFunction = () => [- { rel: 'stylesheet', href: ProjectViewStyle },-]+export const links: LinksFunction = () => [{ rel: 'stylesheet', href: ProjectViewStyle }]export const meta: V2_MetaFunction = ({ location }) => {const { pathname } = location@@ -33,14 +29,24 @@ export async function loader({ request }: LoaderArgs) {const tabs = getProjectTabs(request)return json({- theme, embedded, isAuth, queryPassword, tabs,+ theme,+ embedded,+ isAuth,+ queryPassword,+ tabs,})}export default function Index() {- const {- theme, embedded, isAuth, queryPassword, tabs,- } = useLoaderData<typeof loader>()-- return <ViewProject ssrTheme={theme} ssrAuthenticated={isAuth} embedded={embedded} queryPassword={queryPassword} projectQueryTabs={tabs} />+ const { theme, embedded, isAuth, queryPassword, tabs } = useLoaderData<typeof loader>()++ return (+ <ViewProject+ ssrTheme={theme}+ ssrAuthenticated={isAuth}+ embedded={embedded}+ queryPassword={queryPassword}+ projectQueryTabs={tabs}+ />+ )}diff --git a/app/routes/ref.$id.$page.tsx b/app/routes/ref.$id.$page.tsxindex 96ce409c3..4dbf17144 100644--- a/app/routes/ref.$id.$page.tsx+++ b/app/routes/ref.$id.$page.tsx@@ -1,9 +1,7 @@import type { LoaderArgs } from '@remix-run/node'import { redirect } from '@remix-run/node'-import {- isSelfhosted, REFERRAL_COOKIE, REFERRAL_COOKIE_DAYS,-} from 'redux/constants'+import { isSelfhosted, REFERRAL_COOKIE, REFERRAL_COOKIE_DAYS } from 'redux/constants'import { generateCookieString } from 'utils/cookie'// This route sets the affiliate cookie ($id) and redirects to page specified at $pagediff --git a/app/routes/ref.$id.tsx b/app/routes/ref.$id.tsxindex e23125490..c286e4dd2 100644--- a/app/routes/ref.$id.tsx+++ b/app/routes/ref.$id.tsx@@ -17,9 +17,7 @@ export async function loader({ request }: LoaderArgs) {}export default function Index() {- const {- theme,- } = useLoaderData<typeof loader>()+ const { theme } = useLoaderData<typeof loader>()return <ReferralPage ssrTheme={theme} />}diff --git a/app/routes/signup.tsx b/app/routes/signup.tsxindex fe3e16379..d2df61c63 100644--- a/app/routes/signup.tsx+++ b/app/routes/signup.tsx@@ -28,9 +28,7 @@ export const sitemap: SitemapFunction = () => ({})export default function Index() {- const {- theme,- } = useLoaderData<typeof loader>()+ const { theme } = useLoaderData<typeof loader>()return <Singup ssrTheme={theme} />}diff --git a/app/styles/ButtonChristmas.css b/app/styles/ButtonChristmas.cssindex 1694f689e..9b24c6d4d 100644--- a/app/styles/ButtonChristmas.css+++ b/app/styles/ButtonChristmas.css@@ -1,45 +1,47 @@-.button::before {- content: '';- display: block;- position: absolute;- top: -10px;- left: -3px;- right: 0;- height: 23px;- background:- url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACsAAAAXCAYAAACS5bYWAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAABFpJREFUeNrUV0tIo1cUvpkYjQ4xxSA6DxuNqG0dtaUKOgs3s6i0dFd3pSsXdjeIixakiGA34sZuXCkoONLFwJTK4GMYLYXg29gatTpiXurkbd7vv9/5ub+IxuhA7eiFQ5Kbc8/57ne/e87/ywRBYLdl3GG3aNwqsLJ0k0tLS+fmcnNzWUVFBVMoFGx2djarvLxcm5OTw+bm5iytra2xc4ExNjY27iqVyvvwK6CpeDzuCYVC1urq6qDA9UcfPp+PHR4esmAwKK6tr68/l5/8rgQ2Ozub1dbWyiYmJooaGxt/VqvV38jlchX9l0qlwoFA4DWS/RKLxRxFRUVf5+XlPcaaT2AP0sVPJBL2SCRiAPBpu93+vKamZo/Ae71eZjabWV1dXVqw7CKwp43ksrCw8Bhg7MJ/PLDZ5PHx8cz29vYT5JGD/bSYLgTrcDgYdk6siSc6NjZWDaAe4ZoHQL+cmZnRpZPnhWDpD8kw7uKo9ML/NMCsd2tr61vkzboMrEyv138M7TyLRqMWMBsX3sMgaZhMpp+AR5EJrCocDpuEGzKg4x8khs+CVWxubvZfR9JkMik4nU7BarUKLpeLmLsKuwIqTLynp4fqmIzASrqQT09Pf1VVVfX0KsWZ6uHBwQHTaDSsoKAgo6/H4xHLEcrVyRwuEisrKzs5XrrIVAVwiUVDKRRrL+YI32ewdVhMApuHWvcj6vids6J2u90MF4yBHUZNgKoEBaRBQalJqFSqtJfUYrGIlQX+ydXVVTN+u0tKSjQNDQ1axJVl2iTypebn55d7e3v/kqoDgZU1NTU9LCws/Py0M+2ekuGincxJ3yF+18jIyHJLS0slQJUWFxczrBeBE0vE5tHRkbixlZWVfSR8gTX/0P5gH7S1tX3Z3t7+BW8qAvwSfr8/jA0EIRM/qoFtampqbW9vTw+XA+ojUruVd3Z2tvb19T2TQFEim81GgVJoCvvj4+NLOJZgaWmpemdn5y3a6BbcnJDAw8HBwac6ne6eqCW5XDwB3qVSqM9/DAwMUNy/eVLabT7sI25qwgujThCBhWE+mAt2yNc4SQKSZrOQQE1HS22VJkmPAGTr7+//fX19fRk+Zgq0trbGeFAKEAQT98BSqKOj47vm5uaa/Px8JeIk4GcaHh6eWlxcfAU/A8xG67BxAX3fwdcbYUpSDJ06Z49Ak8ZC3OL8f3YiA4PBYKdLQ2AJ9OTk5GpXV9cQiCVh79M94QtlPLDUE/1gPNrd3f0W33W4cBoco48zQuy/IZYAMnGqlSc4c66L9JruQUaSARXeT8HGKzxAqFBekni6+h46+pMzGiJGMgTOJh1yU/KNEGDvZWvfBawkA9ppwGg0mrRa7SOI2g+gxOgbJIpdFpj72PnxSnPX8vqRxTURgBQWKisrH+GThOm+CtAzoK/9/Uiqq/6hoaHfdnd3jaOjo7/yY7yxbwqkWy3sQzpS2C6YirwvUJk0y7hurfyGRrnduPGvAAMASmo8wzeVwfsAAAAASUVORK5CYII=) no-repeat 0 0,- url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAE0AAAAXCAYAAABOHMIhAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAABiZJREFUeNrsWMtPlFcUvzPMwIDysLyRR4uATDHWCiVgSmRlios2DeiiXUFs0nRBd6arxqQhJDapkYXhP4BqDKTQhZaFNQSCaBEVJjwdHsNr5DUMDDPDzPT3u7nTDEgRKrKgc5KT+z3uufec33de99P4fD4RpL2RNgjB3kn35MkTeRERESFiYmLkGBoaKnQ6nWSNRvPPZFxr+vv7k6KioiIdDsfa8vLyQkFBgcP3Bnel3MDAQArWI0eFhISE87nb7bZ7PJ4VvLYuLi5O5+fnu9+kMNfq6+tLjIyMzMY6KeBEbK/XarXReI3lPDZMWcc4v7GxYV1dXR3Jy8ub2E5HPvJ6vRSSDH0ku1wuAfsEZOV1IEFHoeNFdHS0yMrK2knR0Lm5uR+hxLdQMjbwHTZbB41h8RGwCdc9MzMzneHh4bGJiYlf4SN8ijkfwqiIncCAAR7Iz2GPSShudjqdfeCeqampvwBQfFxc3JdYqwTv8gB8/F48A8BgKecE14V+L7ju2tpae05OzkuCCZvkPOj8mizmC6vVKtmPu+bx48cC3qI1mUyFUOyywWD4SHlELBaLJmCHNcwAghuAOujtuF4FqHO4nsX4EsAS3I4TJ04ME1h8PDE9PS09TYZoY2Pj1729vd6lpSVfkDYTPG0UkfNDRUWFgQ5Gb2Mh0N29e9eG/GQfHh4W8/PzwUy/ObQ/gMfVVlZW1iAiZdQxp3nv3LljRoL/5erVq1UIxzSiiVD9X4EDYATynCwAzGO858hCQRoaGmJFZNJz8YIcBc4BF966dau6sLAwBxVSJCUlCSThQwuU3W6XkYUok1Vzm5znQx5bbm9v77p+/frPeNSNRzZ/ISBwrG4ZR48eLamtrf2+uLjYSEG9Xi/wTISFhQlWGXohyzO/CJlVl23KQRLbABoaHx+/Z1lUZ/Hq1SsJFj3JT3hmHx8fnydPTEzMj46OziHPW2w22wxeD4Kfgadh/4YEzU8Az4DhffAn5eXlX1y6dKkEoCTspAQ9Mjs7+0BBo8Fms1lkZGTsOo0QLLRNkvnR+fEJzIMHD0xtbW39CL8JTFtSbAOvBIyLHIGVm9VzE2gKuDAMSSpcT6KXyT137lx2cnLyMXhcGDb3wq3XuWF3d/fCzZs3P0c4v5eSknJQbYLo7Ox0gC2lpaVZ3Be67Th/dnZWoAJKsJC3XA8fPhxoamp6hMb+BaaMgWcUMGtszZjiFDNmvcDI91pzG0iY4ARwkwrxkcHBwUdgNrRMbnrqoRbkVzDcvn3bl5qaWsmcgFH4G8XdEGUWFhak51AuISFBnkoCTyFbyWKxCJwIxlC0fq2rq7tcVFRkRKskjh8/Lr0+kBjCCDV/knfdv3//WX19/R8IRRNemxlu4AXwKqM+EJwdj1HbPYSwh3sCPAJDABm2LLchCjS+5/kirKGhwWk0GrMuXrxYQuX9hm/XXTMXMY+srKwI5ApZrbYmZh7deEJhAUKjLe/pLTzSsCuHrK+1tbUJVe3P6upq87Vr174rKysrYHVj/uW+OH3IfEuw4F3ee/fuPQfAvwOs5yyE4CnlFOu7BWrTCWlreO6FACpBZGwUw4BvkANLobReHb3kGZYGsGzTq/zlO8AT1ru6uoZbWlqeA6gINJAfnz59OlVLoX8Jtebm5raampqfcMvQYgTknz9//sKVK1c+y83NTdIEuCnaKMuNGzd+6+np6cCtSTkAw9D9X8Dyh+dbgaaAC1XAnUlPTy+qqqq6cPbs2UzkmWjNljiDJzpwHFnCkW2yo6NjCKW8H54wjlezKvRT09LSTsJrz5w6dSoN+Yp51ADAPUj8VoDbDq9pxrwuJcNIYQllJTIi/xopBw/VA7DJp0+f9hA78CgL5F5C8J2CpoCj8sfA6WCe/FPRhsRlZmbGIs8Y4FFO5CJgtrSsvrRVGW1V93b1myoGnKAKEcHgnwsWpg1lNI0fphwrmdqbckeU18WrnlOjqp5/j7W3BWvfQVPKa5SBkcrYCNVB65TRTlWZ1lXiXVU5xbtlDb2SPaLWYwrgHIcqPg6Vc7fbX69Yoyqfa7/AeiegbWOEVhmsVcWDwPn224iDJgla8Hd38Hd3ELQgaIeI/hZgAIPEp0vmQJdoAAAAAElFTkSuQmCC) no-repeat 50% 0,- url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACEAAAAXCAYAAACFxybfAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAodJREFUeNrsVb1rWlEUv2pN/GqspKRSKFYXWzEloIWif0Fn6dJChQ7OQil0qd3EzcEpg0OgdHDr4CQODk7VRlLMEIVqApX4We0zflR9/Z1Ui4T34ksaaAYP/Hzc673n/M6550PG8zz73yKjn0wm83fDYDAwo9HINBrNnwOQg4MDs0ql2lQqlfdAWont7ng8Pjw+Ps44nc4G1pI9EXWaSOzt7TGO42aH5Pv7+08ajUZ0MBiUeXEZd7vdL5VK5fX29rZ+5tQiEmdxKrlcjsEYczgcynK5/BKKv/IXFNz/XiqVXkHdjUuRIA9SqdRD8or/R8Ez9fr9fqHVakUR4c2z0REjIQuHw2ZcrPBXLCA0RHTezEdHjIQqkUhEr9I4HOILhQLf6/VoOUFEvDMiQiToDx1Cdz+bzZ6bUFarlel0OkkVUK/XWbvdPoVer5fh3ntsfwJ+CJ2XA4p0Op1bpBgJyxDehQQ6nQ5DZXHBYDBZq9V+EhFUndnr9drEqoc2bwJbwGPgtohuVSwWe2Gz2TZMJpNgRKi6qtUqg2EWj8dTgUDgo0KhWPN4PC70EvXOzs67fD6/S6kiRIKeZA1YJ2MiJNbdbvfTUCjkV6vVK2hcDF8GI2w0GrGTkxM2HA5PDxaLxSOfz/cWEfk81X0XIMMFgJJ/srBjCgk8IdcfuVyuZ36//7nFYtkQyAMumUzuRiKRD0jMFLa+AZOpYwqgB/ziBVqmVBKUO7eAB/R0WG/Z7XaTVqtdbTabHJL6EK2djBaBPHA0NSqpbUsiMUeEBgpF4Q5AbZrmSJ/yEWgBTaBNHl9kdkgmMUeG7qwAq9PqovceTA3zlxlgsuswyuXsGsiSxJLEkoSY/BZgAEjRodi+uBruAAAAAElFTkSuQmCC) no-repeat 100% 0;-+ content: '';+ display: block;+ position: absolute;+ top: -10px;+ left: -3px;+ right: 0;+ height: 23px;+ background:+ url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACsAAAAXCAYAAACS5bYWAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAABFpJREFUeNrUV0tIo1cUvpkYjQ4xxSA6DxuNqG0dtaUKOgs3s6i0dFd3pSsXdjeIixakiGA34sZuXCkoONLFwJTK4GMYLYXg29gatTpiXurkbd7vv9/5ub+IxuhA7eiFQ5Kbc8/57ne/e87/ywRBYLdl3GG3aNwqsLJ0k0tLS+fmcnNzWUVFBVMoFGx2djarvLxcm5OTw+bm5iytra2xc4ExNjY27iqVyvvwK6CpeDzuCYVC1urq6qDA9UcfPp+PHR4esmAwKK6tr68/l5/8rgQ2Ozub1dbWyiYmJooaGxt/VqvV38jlchX9l0qlwoFA4DWS/RKLxRxFRUVf5+XlPcaaT2AP0sVPJBL2SCRiAPBpu93+vKamZo/Ae71eZjabWV1dXVqw7CKwp43ksrCw8Bhg7MJ/PLDZ5PHx8cz29vYT5JGD/bSYLgTrcDgYdk6siSc6NjZWDaAe4ZoHQL+cmZnRpZPnhWDpD8kw7uKo9ML/NMCsd2tr61vkzboMrEyv138M7TyLRqMWMBsX3sMgaZhMpp+AR5EJrCocDpuEGzKg4x8khs+CVWxubvZfR9JkMik4nU7BarUKLpeLmLsKuwIqTLynp4fqmIzASrqQT09Pf1VVVfX0KsWZ6uHBwQHTaDSsoKAgo6/H4xHLEcrVyRwuEisrKzs5XrrIVAVwiUVDKRRrL+YI32ewdVhMApuHWvcj6vids6J2u90MF4yBHUZNgKoEBaRBQalJqFSqtJfUYrGIlQX+ydXVVTN+u0tKSjQNDQ1axJVl2iTypebn55d7e3v/kqoDgZU1NTU9LCws/Py0M+2ekuGincxJ3yF+18jIyHJLS0slQJUWFxczrBeBE0vE5tHRkbixlZWVfSR8gTX/0P5gH7S1tX3Z3t7+BW8qAvwSfr8/jA0EIRM/qoFtampqbW9vTw+XA+ojUruVd3Z2tvb19T2TQFEim81GgVJoCvvj4+NLOJZgaWmpemdn5y3a6BbcnJDAw8HBwac6ne6eqCW5XDwB3qVSqM9/DAwMUNy/eVLabT7sI25qwgujThCBhWE+mAt2yNc4SQKSZrOQQE1HS22VJkmPAGTr7+//fX19fRk+Zgq0trbGeFAKEAQT98BSqKOj47vm5uaa/Px8JeIk4GcaHh6eWlxcfAU/A8xG67BxAX3fwdcbYUpSDJ06Z49Ak8ZC3OL8f3YiA4PBYKdLQ2AJ9OTk5GpXV9cQiCVh79M94QtlPLDUE/1gPNrd3f0W33W4cBoco48zQuy/IZYAMnGqlSc4c66L9JruQUaSARXeT8HGKzxAqFBekni6+h46+pMzGiJGMgTOJh1yU/KNEGDvZWvfBawkA9ppwGg0mrRa7SOI2g+gxOgbJIpdFpj72PnxSnPX8vqRxTURgBQWKisrH+GThOm+CtAzoK/9/Uiqq/6hoaHfdnd3jaOjo7/yY7yxbwqkWy3sQzpS2C6YirwvUJk0y7hurfyGRrnduPGvAAMASmo8wzeVwfsAAAAASUVORK5CYII=)+ no-repeat 0 0,+ url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAE0AAAAXCAYAAABOHMIhAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAABiZJREFUeNrsWMtPlFcUvzPMwIDysLyRR4uATDHWCiVgSmRlios2DeiiXUFs0nRBd6arxqQhJDapkYXhP4BqDKTQhZaFNQSCaBEVJjwdHsNr5DUMDDPDzPT3u7nTDEgRKrKgc5KT+z3uufec33de99P4fD4RpL2RNgjB3kn35MkTeRERESFiYmLkGBoaKnQ6nWSNRvPPZFxr+vv7k6KioiIdDsfa8vLyQkFBgcP3Bnel3MDAQArWI0eFhISE87nb7bZ7PJ4VvLYuLi5O5+fnu9+kMNfq6+tLjIyMzMY6KeBEbK/XarXReI3lPDZMWcc4v7GxYV1dXR3Jy8ub2E5HPvJ6vRSSDH0ku1wuAfsEZOV1IEFHoeNFdHS0yMrK2knR0Lm5uR+hxLdQMjbwHTZbB41h8RGwCdc9MzMzneHh4bGJiYlf4SN8ijkfwqiIncCAAR7Iz2GPSShudjqdfeCeqampvwBQfFxc3JdYqwTv8gB8/F48A8BgKecE14V+L7ju2tpae05OzkuCCZvkPOj8mizmC6vVKtmPu+bx48cC3qI1mUyFUOyywWD4SHlELBaLJmCHNcwAghuAOujtuF4FqHO4nsX4EsAS3I4TJ04ME1h8PDE9PS09TYZoY2Pj1729vd6lpSVfkDYTPG0UkfNDRUWFgQ5Gb2Mh0N29e9eG/GQfHh4W8/PzwUy/ObQ/gMfVVlZW1iAiZdQxp3nv3LljRoL/5erVq1UIxzSiiVD9X4EDYATynCwAzGO858hCQRoaGmJFZNJz8YIcBc4BF966dau6sLAwBxVSJCUlCSThQwuU3W6XkYUok1Vzm5znQx5bbm9v77p+/frPeNSNRzZ/ISBwrG4ZR48eLamtrf2+uLjYSEG9Xi/wTISFhQlWGXohyzO/CJlVl23KQRLbABoaHx+/Z1lUZ/Hq1SsJFj3JT3hmHx8fnydPTEzMj46OziHPW2w22wxeD4Kfgadh/4YEzU8Az4DhffAn5eXlX1y6dKkEoCTspAQ9Mjs7+0BBo8Fms1lkZGTsOo0QLLRNkvnR+fEJzIMHD0xtbW39CL8JTFtSbAOvBIyLHIGVm9VzE2gKuDAMSSpcT6KXyT137lx2cnLyMXhcGDb3wq3XuWF3d/fCzZs3P0c4v5eSknJQbYLo7Ox0gC2lpaVZ3Be67Th/dnZWoAJKsJC3XA8fPhxoamp6hMb+BaaMgWcUMGtszZjiFDNmvcDI91pzG0iY4ARwkwrxkcHBwUdgNrRMbnrqoRbkVzDcvn3bl5qaWsmcgFH4G8XdEGUWFhak51AuISFBnkoCTyFbyWKxCJwIxlC0fq2rq7tcVFRkRKskjh8/Lr0+kBjCCDV/knfdv3//WX19/R8IRRNemxlu4AXwKqM+EJwdj1HbPYSwh3sCPAJDABm2LLchCjS+5/kirKGhwWk0GrMuXrxYQuX9hm/XXTMXMY+srKwI5ApZrbYmZh7deEJhAUKjLe/pLTzSsCuHrK+1tbUJVe3P6upq87Vr174rKysrYHVj/uW+OH3IfEuw4F3ee/fuPQfAvwOs5yyE4CnlFOu7BWrTCWlreO6FACpBZGwUw4BvkANLobReHb3kGZYGsGzTq/zlO8AT1ru6uoZbWlqeA6gINJAfnz59OlVLoX8Jtebm5raampqfcMvQYgTknz9//sKVK1c+y83NTdIEuCnaKMuNGzd+6+np6cCtSTkAw9D9X8Dyh+dbgaaAC1XAnUlPTy+qqqq6cPbs2UzkmWjNljiDJzpwHFnCkW2yo6NjCKW8H54wjlezKvRT09LSTsJrz5w6dSoN+Yp51ADAPUj8VoDbDq9pxrwuJcNIYQllJTIi/xopBw/VA7DJp0+f9hA78CgL5F5C8J2CpoCj8sfA6WCe/FPRhsRlZmbGIs8Y4FFO5CJgtrSsvrRVGW1V93b1myoGnKAKEcHgnwsWpg1lNI0fphwrmdqbckeU18WrnlOjqp5/j7W3BWvfQVPKa5SBkcrYCNVB65TRTlWZ1lXiXVU5xbtlDb2SPaLWYwrgHIcqPg6Vc7fbX69Yoyqfa7/AeiegbWOEVhmsVcWDwPn224iDJgla8Hd38Hd3ELQgaIeI/hZgAIPEp0vmQJdoAAAAAElFTkSuQmCC)+ no-repeat 50% 0,+ url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACEAAAAXCAYAAACFxybfAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAodJREFUeNrsVb1rWlEUv2pN/GqspKRSKFYXWzEloIWif0Fn6dJChQ7OQil0qd3EzcEpg0OgdHDr4CQODk7VRlLMEIVqApX4We0zflR9/Z1Ui4T34ksaaAYP/Hzc673n/M6550PG8zz73yKjn0wm83fDYDAwo9HINBrNnwOQg4MDs0ql2lQqlfdAWont7ng8Pjw+Ps44nc4G1pI9EXWaSOzt7TGO42aH5Pv7+08ajUZ0MBiUeXEZd7vdL5VK5fX29rZ+5tQiEmdxKrlcjsEYczgcynK5/BKKv/IXFNz/XiqVXkHdjUuRIA9SqdRD8or/R8Ez9fr9fqHVakUR4c2z0REjIQuHw2ZcrPBXLCA0RHTezEdHjIQqkUhEr9I4HOILhQLf6/VoOUFEvDMiQiToDx1Cdz+bzZ6bUFarlel0OkkVUK/XWbvdPoVer5fh3ntsfwJ+CJ2XA4p0Op1bpBgJyxDehQQ6nQ5DZXHBYDBZq9V+EhFUndnr9drEqoc2bwJbwGPgtohuVSwWe2Gz2TZMJpNgRKi6qtUqg2EWj8dTgUDgo0KhWPN4PC70EvXOzs67fD6/S6kiRIKeZA1YJ2MiJNbdbvfTUCjkV6vVK2hcDF8GI2w0GrGTkxM2HA5PDxaLxSOfz/cWEfk81X0XIMMFgJJ/srBjCgk8IdcfuVyuZ36//7nFYtkQyAMumUzuRiKRD0jMFLa+AZOpYwqgB/ziBVqmVBKUO7eAB/R0WG/Z7XaTVqtdbTabHJL6EK2djBaBPHA0NSqpbUsiMUeEBgpF4Q5AbZrmSJ/yEWgBTaBNHl9kdkgmMUeG7qwAq9PqovceTA3zlxlgsuswyuXsGsiSxJLEkoSY/BZgAEjRodi+uBruAAAAAElFTkSuQmCC)+ no-repeat 100% 0;}.button3::before {- content: '';- display: block;- position: absolute;- top: -8px;- left: -3px;- right: 0;- height: 23px;- background:+ content: '';+ display: block;+ position: absolute;+ top: -8px;+ left: -3px;+ right: 0;+ height: 23px;+ background:/* url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACsAAAAXCAYAAACS5bYWAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAABFpJREFUeNrUV0tIo1cUvpkYjQ4xxSA6DxuNqG0dtaUKOgs3s6i0dFd3pSsXdjeIixakiGA34sZuXCkoONLFwJTK4GMYLYXg29gatTpiXurkbd7vv9/5ub+IxuhA7eiFQ5Kbc8/57ne/e87/ywRBYLdl3GG3aNwqsLJ0k0tLS+fmcnNzWUVFBVMoFGx2djarvLxcm5OTw+bm5iytra2xc4ExNjY27iqVyvvwK6CpeDzuCYVC1urq6qDA9UcfPp+PHR4esmAwKK6tr68/l5/8rgQ2Ozub1dbWyiYmJooaGxt/VqvV38jlchX9l0qlwoFA4DWS/RKLxRxFRUVf5+XlPcaaT2AP0sVPJBL2SCRiAPBpu93+vKamZo/Ae71eZjabWV1dXVqw7CKwp43ksrCw8Bhg7MJ/PLDZ5PHx8cz29vYT5JGD/bSYLgTrcDgYdk6siSc6NjZWDaAe4ZoHQL+cmZnRpZPnhWDpD8kw7uKo9ML/NMCsd2tr61vkzboMrEyv138M7TyLRqMWMBsX3sMgaZhMpp+AR5EJrCocDpuEGzKg4x8khs+CVWxubvZfR9JkMik4nU7BarUKLpeLmLsKuwIqTLynp4fqmIzASrqQT09Pf1VVVfX0KsWZ6uHBwQHTaDSsoKAgo6/H4xHLEcrVyRwuEisrKzs5XrrIVAVwiUVDKRRrL+YI32ewdVhMApuHWvcj6vids6J2u90MF4yBHUZNgKoEBaRBQalJqFSqtJfUYrGIlQX+ydXVVTN+u0tKSjQNDQ1axJVl2iTypebn55d7e3v/kqoDgZU1NTU9LCws/Py0M+2ekuGincxJ3yF+18jIyHJLS0slQJUWFxczrBeBE0vE5tHRkbixlZWVfSR8gTX/0P5gH7S1tX3Z3t7+BW8qAvwSfr8/jA0EIRM/qoFtampqbW9vTw+XA+ojUruVd3Z2tvb19T2TQFEim81GgVJoCvvj4+NLOJZgaWmpemdn5y3a6BbcnJDAw8HBwac6ne6eqCW5XDwB3qVSqM9/DAwMUNy/eVLabT7sI25qwgujThCBhWE+mAt2yNc4SQKSZrOQQE1HS22VJkmPAGTr7+//fX19fRk+Zgq0trbGeFAKEAQT98BSqKOj47vm5uaa/Px8JeIk4GcaHh6eWlxcfAU/A8xG67BxAX3fwdcbYUpSDJ06Z49Ak8ZC3OL8f3YiA4PBYKdLQ2AJ9OTk5GpXV9cQiCVh79M94QtlPLDUE/1gPNrd3f0W33W4cBoco48zQuy/IZYAMnGqlSc4c66L9JruQUaSARXeT8HGKzxAqFBekni6+h46+pMzGiJGMgTOJh1yU/KNEGDvZWvfBawkA9ppwGg0mrRa7SOI2g+gxOgbJIpdFpj72PnxSnPX8vqRxTURgBQWKisrH+GThOm+CtAzoK/9/Uiqq/6hoaHfdnd3jaOjo7/yY7yxbwqkWy3sQzpS2C6YirwvUJk0y7hurfyGRrnduPGvAAMASmo8wzeVwfsAAAAASUVORK5CYII=) no-repeat 0 0, *//* url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAE0AAAAXCAYAAABOHMIhAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAABiZJREFUeNrsWMtPlFcUvzPMwIDysLyRR4uATDHWCiVgSmRlios2DeiiXUFs0nRBd6arxqQhJDapkYXhP4BqDKTQhZaFNQSCaBEVJjwdHsNr5DUMDDPDzPT3u7nTDEgRKrKgc5KT+z3uufec33de99P4fD4RpL2RNgjB3kn35MkTeRERESFiYmLkGBoaKnQ6nWSNRvPPZFxr+vv7k6KioiIdDsfa8vLyQkFBgcP3Bnel3MDAQArWI0eFhISE87nb7bZ7PJ4VvLYuLi5O5+fnu9+kMNfq6+tLjIyMzMY6KeBEbK/XarXReI3lPDZMWcc4v7GxYV1dXR3Jy8ub2E5HPvJ6vRSSDH0ku1wuAfsEZOV1IEFHoeNFdHS0yMrK2knR0Lm5uR+hxLdQMjbwHTZbB41h8RGwCdc9MzMzneHh4bGJiYlf4SN8ijkfwqiIncCAAR7Iz2GPSShudjqdfeCeqampvwBQfFxc3JdYqwTv8gB8/F48A8BgKecE14V+L7ju2tpae05OzkuCCZvkPOj8mizmC6vVKtmPu+bx48cC3qI1mUyFUOyywWD4SHlELBaLJmCHNcwAghuAOujtuF4FqHO4nsX4EsAS3I4TJ04ME1h8PDE9PS09TYZoY2Pj1729vd6lpSVfkDYTPG0UkfNDRUWFgQ5Gb2Mh0N29e9eG/GQfHh4W8/PzwUy/ObQ/gMfVVlZW1iAiZdQxp3nv3LljRoL/5erVq1UIxzSiiVD9X4EDYATynCwAzGO858hCQRoaGmJFZNJz8YIcBc4BF966dau6sLAwBxVSJCUlCSThQwuU3W6XkYUok1Vzm5znQx5bbm9v77p+/frPeNSNRzZ/ISBwrG4ZR48eLamtrf2+uLjYSEG9Xi/wTISFhQlWGXohyzO/CJlVl23KQRLbABoaHx+/Z1lUZ/Hq1SsJFj3JT3hmHx8fnydPTEzMj46OziHPW2w22wxeD4Kfgadh/4YEzU8Az4DhffAn5eXlX1y6dKkEoCTspAQ9Mjs7+0BBo8Fms1lkZGTsOo0QLLRNkvnR+fEJzIMHD0xtbW39CL8JTFtSbAOvBIyLHIGVm9VzE2gKuDAMSSpcT6KXyT137lx2cnLyMXhcGDb3wq3XuWF3d/fCzZs3P0c4v5eSknJQbYLo7Ox0gC2lpaVZ3Be67Th/dnZWoAJKsJC3XA8fPhxoamp6hMb+BaaMgWcUMGtszZjiFDNmvcDI91pzG0iY4ARwkwrxkcHBwUdgNrRMbnrqoRbkVzDcvn3bl5qaWsmcgFH4G8XdEGUWFhak51AuISFBnkoCTyFbyWKxCJwIxlC0fq2rq7tcVFRkRKskjh8/Lr0+kBjCCDV/knfdv3//WX19/R8IRRNemxlu4AXwKqM+EJwdj1HbPYSwh3sCPAJDABm2LLchCjS+5/kirKGhwWk0GrMuXrxYQuX9hm/XXTMXMY+srKwI5ApZrbYmZh7deEJhAUKjLe/pLTzSsCuHrK+1tbUJVe3P6upq87Vr174rKysrYHVj/uW+OH3IfEuw4F3ee/fuPQfAvwOs5yyE4CnlFOu7BWrTCWlreO6FACpBZGwUw4BvkANLobReHb3kGZYGsGzTq/zlO8AT1ru6uoZbWlqeA6gINJAfnz59OlVLoX8Jtebm5raampqfcMvQYgTknz9//sKVK1c+y83NTdIEuCnaKMuNGzd+6+np6cCtSTkAw9D9X8Dyh+dbgaaAC1XAnUlPTy+qqqq6cPbs2UzkmWjNljiDJzpwHFnCkW2yo6NjCKW8H54wjlezKvRT09LSTsJrz5w6dSoN+Yp51ADAPUj8VoDbDq9pxrwuJcNIYQllJTIi/xopBw/VA7DJp0+f9hA78CgL5F5C8J2CpoCj8sfA6WCe/FPRhsRlZmbGIs8Y4FFO5CJgtrSsvrRVGW1V93b1myoGnKAKEcHgnwsWpg1lNI0fphwrmdqbckeU18WrnlOjqp5/j7W3BWvfQVPKa5SBkcrYCNVB65TRTlWZ1lXiXVU5xbtlDb2SPaLWYwrgHIcqPg6Vc7fbX69Yoyqfa7/AeiegbWOEVhmsVcWDwPn224iDJgla8Hd38Hd3ELQgaIeI/hZgAIPEp0vmQJdoAAAAAElFTkSuQmCC) no-repeat 50% 0, */- url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACEAAAAXCAYAAACFxybfAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAodJREFUeNrsVb1rWlEUv2pN/GqspKRSKFYXWzEloIWif0Fn6dJChQ7OQil0qd3EzcEpg0OgdHDr4CQODk7VRlLMEIVqApX4We0zflR9/Z1Ui4T34ksaaAYP/Hzc673n/M6550PG8zz73yKjn0wm83fDYDAwo9HINBrNnwOQg4MDs0ql2lQqlfdAWont7ng8Pjw+Ps44nc4G1pI9EXWaSOzt7TGO42aH5Pv7+08ajUZ0MBiUeXEZd7vdL5VK5fX29rZ+5tQiEmdxKrlcjsEYczgcynK5/BKKv/IXFNz/XiqVXkHdjUuRIA9SqdRD8or/R8Ez9fr9fqHVakUR4c2z0REjIQuHw2ZcrPBXLCA0RHTezEdHjIQqkUhEr9I4HOILhQLf6/VoOUFEvDMiQiToDx1Cdz+bzZ6bUFarlel0OkkVUK/XWbvdPoVer5fh3ntsfwJ+CJ2XA4p0Op1bpBgJyxDehQQ6nQ5DZXHBYDBZq9V+EhFUndnr9drEqoc2bwJbwGPgtohuVSwWe2Gz2TZMJpNgRKi6qtUqg2EWj8dTgUDgo0KhWPN4PC70EvXOzs67fD6/S6kiRIKeZA1YJ2MiJNbdbvfTUCjkV6vVK2hcDF8GI2w0GrGTkxM2HA5PDxaLxSOfz/cWEfk81X0XIMMFgJJ/srBjCgk8IdcfuVyuZ36//7nFYtkQyAMumUzuRiKRD0jMFLa+AZOpYwqgB/ziBVqmVBKUO7eAB/R0WG/Z7XaTVqtdbTabHJL6EK2djBaBPHA0NSqpbUsiMUeEBgpF4Q5AbZrmSJ/yEWgBTaBNHl9kdkgmMUeG7qwAq9PqovceTA3zlxlgsuswyuXsGsiSxJLEkoSY/BZgAEjRodi+uBruAAAAAElFTkSuQmCC) no-repeat 100% 0;-+ url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACEAAAAXCAYAAACFxybfAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAodJREFUeNrsVb1rWlEUv2pN/GqspKRSKFYXWzEloIWif0Fn6dJChQ7OQil0qd3EzcEpg0OgdHDr4CQODk7VRlLMEIVqApX4We0zflR9/Z1Ui4T34ksaaAYP/Hzc673n/M6550PG8zz73yKjn0wm83fDYDAwo9HINBrNnwOQg4MDs0ql2lQqlfdAWont7ng8Pjw+Ps44nc4G1pI9EXWaSOzt7TGO42aH5Pv7+08ajUZ0MBiUeXEZd7vdL5VK5fX29rZ+5tQiEmdxKrlcjsEYczgcynK5/BKKv/IXFNz/XiqVXkHdjUuRIA9SqdRD8or/R8Ez9fr9fqHVakUR4c2z0REjIQuHw2ZcrPBXLCA0RHTezEdHjIQqkUhEr9I4HOILhQLf6/VoOUFEvDMiQiToDx1Cdz+bzZ6bUFarlel0OkkVUK/XWbvdPoVer5fh3ntsfwJ+CJ2XA4p0Op1bpBgJyxDehQQ6nQ5DZXHBYDBZq9V+EhFUndnr9drEqoc2bwJbwGPgtohuVSwWe2Gz2TZMJpNgRKi6qtUqg2EWj8dTgUDgo0KhWPN4PC70EvXOzs67fD6/S6kiRIKeZA1YJ2MiJNbdbvfTUCjkV6vVK2hcDF8GI2w0GrGTkxM2HA5PDxaLxSOfz/cWEfk81X0XIMMFgJJ/srBjCgk8IdcfuVyuZ36//7nFYtkQyAMumUzuRiKRD0jMFLa+AZOpYwqgB/ziBVqmVBKUO7eAB/R0WG/Z7XaTVqtdbTabHJL6EK2djBaBPHA0NSqpbUsiMUeEBgpF4Q5AbZrmSJ/yEWgBTaBNHl9kdkgmMUeG7qwAq9PqovceTA3zlxlgsuswyuXsGsiSxJLEkoSY/BZgAEjRodi+uBruAAAAAElFTkSuQmCC)+ no-repeat 100% 0;}.button2::before {- content: '';- display: block;- position: absolute;- top: -10px;- left: -3px;- right: 0;- height: 23px;- background:- url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACsAAAAXCAYAAACS5bYWAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAABFpJREFUeNrUV0tIo1cUvpkYjQ4xxSA6DxuNqG0dtaUKOgs3s6i0dFd3pSsXdjeIixakiGA34sZuXCkoONLFwJTK4GMYLYXg29gatTpiXurkbd7vv9/5ub+IxuhA7eiFQ5Kbc8/57ne/e87/ywRBYLdl3GG3aNwqsLJ0k0tLS+fmcnNzWUVFBVMoFGx2djarvLxcm5OTw+bm5iytra2xc4ExNjY27iqVyvvwK6CpeDzuCYVC1urq6qDA9UcfPp+PHR4esmAwKK6tr68/l5/8rgQ2Ozub1dbWyiYmJooaGxt/VqvV38jlchX9l0qlwoFA4DWS/RKLxRxFRUVf5+XlPcaaT2AP0sVPJBL2SCRiAPBpu93+vKamZo/Ae71eZjabWV1dXVqw7CKwp43ksrCw8Bhg7MJ/PLDZ5PHx8cz29vYT5JGD/bSYLgTrcDgYdk6siSc6NjZWDaAe4ZoHQL+cmZnRpZPnhWDpD8kw7uKo9ML/NMCsd2tr61vkzboMrEyv138M7TyLRqMWMBsX3sMgaZhMpp+AR5EJrCocDpuEGzKg4x8khs+CVWxubvZfR9JkMik4nU7BarUKLpeLmLsKuwIqTLynp4fqmIzASrqQT09Pf1VVVfX0KsWZ6uHBwQHTaDSsoKAgo6/H4xHLEcrVyRwuEisrKzs5XrrIVAVwiUVDKRRrL+YI32ewdVhMApuHWvcj6vids6J2u90MF4yBHUZNgKoEBaRBQalJqFSqtJfUYrGIlQX+ydXVVTN+u0tKSjQNDQ1axJVl2iTypebn55d7e3v/kqoDgZU1NTU9LCws/Py0M+2ekuGincxJ3yF+18jIyHJLS0slQJUWFxczrBeBE0vE5tHRkbixlZWVfSR8gTX/0P5gH7S1tX3Z3t7+BW8qAvwSfr8/jA0EIRM/qoFtampqbW9vTw+XA+ojUruVd3Z2tvb19T2TQFEim81GgVJoCvvj4+NLOJZgaWmpemdn5y3a6BbcnJDAw8HBwac6ne6eqCW5XDwB3qVSqM9/DAwMUNy/eVLabT7sI25qwgujThCBhWE+mAt2yNc4SQKSZrOQQE1HS22VJkmPAGTr7+//fX19fRk+Zgq0trbGeFAKEAQT98BSqKOj47vm5uaa/Px8JeIk4GcaHh6eWlxcfAU/A8xG67BxAX3fwdcbYUpSDJ06Z49Ak8ZC3OL8f3YiA4PBYKdLQ2AJ9OTk5GpXV9cQiCVh79M94QtlPLDUE/1gPNrd3f0W33W4cBoco48zQuy/IZYAMnGqlSc4c66L9JruQUaSARXeT8HGKzxAqFBekni6+h46+pMzGiJGMgTOJh1yU/KNEGDvZWvfBawkA9ppwGg0mrRa7SOI2g+gxOgbJIpdFpj72PnxSnPX8vqRxTURgBQWKisrH+GThOm+CtAzoK/9/Uiqq/6hoaHfdnd3jaOjo7/yY7yxbwqkWy3sQzpS2C6YirwvUJk0y7hurfyGRrnduPGvAAMASmo8wzeVwfsAAAAASUVORK5CYII=) no-repeat 0 0,- /* url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAE0AAAAXCAYAAABOHMIhAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAABiZJREFUeNrsWMtPlFcUvzPMwIDysLyRR4uATDHWCiVgSmRlios2DeiiXUFs0nRBd6arxqQhJDapkYXhP4BqDKTQhZaFNQSCaBEVJjwdHsNr5DUMDDPDzPT3u7nTDEgRKrKgc5KT+z3uufec33de99P4fD4RpL2RNgjB3kn35MkTeRERESFiYmLkGBoaKnQ6nWSNRvPPZFxr+vv7k6KioiIdDsfa8vLyQkFBgcP3Bnel3MDAQArWI0eFhISE87nb7bZ7PJ4VvLYuLi5O5+fnu9+kMNfq6+tLjIyMzMY6KeBEbK/XarXReI3lPDZMWcc4v7GxYV1dXR3Jy8ub2E5HPvJ6vRSSDH0ku1wuAfsEZOV1IEFHoeNFdHS0yMrK2knR0Lm5uR+hxLdQMjbwHTZbB41h8RGwCdc9MzMzneHh4bGJiYlf4SN8ijkfwqiIncCAAR7Iz2GPSShudjqdfeCeqampvwBQfFxc3JdYqwTv8gB8/F48A8BgKecE14V+L7ju2tpae05OzkuCCZvkPOj8mizmC6vVKtmPu+bx48cC3qI1mUyFUOyywWD4SHlELBaLJmCHNcwAghuAOujtuF4FqHO4nsX4EsAS3I4TJ04ME1h8PDE9PS09TYZoY2Pj1729vd6lpSVfkDYTPG0UkfNDRUWFgQ5Gb2Mh0N29e9eG/GQfHh4W8/PzwUy/ObQ/gMfVVlZW1iAiZdQxp3nv3LljRoL/5erVq1UIxzSiiVD9X4EDYATynCwAzGO858hCQRoaGmJFZNJz8YIcBc4BF966dau6sLAwBxVSJCUlCSThQwuU3W6XkYUok1Vzm5znQx5bbm9v77p+/frPeNSNRzZ/ISBwrG4ZR48eLamtrf2+uLjYSEG9Xi/wTISFhQlWGXohyzO/CJlVl23KQRLbABoaHx+/Z1lUZ/Hq1SsJFj3JT3hmHx8fnydPTEzMj46OziHPW2w22wxeD4Kfgadh/4YEzU8Az4DhffAn5eXlX1y6dKkEoCTspAQ9Mjs7+0BBo8Fms1lkZGTsOo0QLLRNkvnR+fEJzIMHD0xtbW39CL8JTFtSbAOvBIyLHIGVm9VzE2gKuDAMSSpcT6KXyT137lx2cnLyMXhcGDb3wq3XuWF3d/fCzZs3P0c4v5eSknJQbYLo7Ox0gC2lpaVZ3Be67Th/dnZWoAJKsJC3XA8fPhxoamp6hMb+BaaMgWcUMGtszZjiFDNmvcDI91pzG0iY4ARwkwrxkcHBwUdgNrRMbnrqoRbkVzDcvn3bl5qaWsmcgFH4G8XdEGUWFhak51AuISFBnkoCTyFbyWKxCJwIxlC0fq2rq7tcVFRkRKskjh8/Lr0+kBjCCDV/knfdv3//WX19/R8IRRNemxlu4AXwKqM+EJwdj1HbPYSwh3sCPAJDABm2LLchCjS+5/kirKGhwWk0GrMuXrxYQuX9hm/XXTMXMY+srKwI5ApZrbYmZh7deEJhAUKjLe/pLTzSsCuHrK+1tbUJVe3P6upq87Vr174rKysrYHVj/uW+OH3IfEuw4F3ee/fuPQfAvwOs5yyE4CnlFOu7BWrTCWlreO6FACpBZGwUw4BvkANLobReHb3kGZYGsGzTq/zlO8AT1ru6uoZbWlqeA6gINJAfnz59OlVLoX8Jtebm5raampqfcMvQYgTknz9//sKVK1c+y83NTdIEuCnaKMuNGzd+6+np6cCtSTkAw9D9X8Dyh+dbgaaAC1XAnUlPTy+qqqq6cPbs2UzkmWjNljiDJzpwHFnCkW2yo6NjCKW8H54wjlezKvRT09LSTsJrz5w6dSoN+Yp51ADAPUj8VoDbDq9pxrwuJcNIYQllJTIi/xopBw/VA7DJp0+f9hA78CgL5F5C8J2CpoCj8sfA6WCe/FPRhsRlZmbGIs8Y4FFO5CJgtrSsvrRVGW1V93b1myoGnKAKEcHgnwsWpg1lNI0fphwrmdqbckeU18WrnlOjqp5/j7W3BWvfQVPKa5SBkcrYCNVB65TRTlWZ1lXiXVU5xbtlDb2SPaLWYwrgHIcqPg6Vc7fbX69Yoyqfa7/AeiegbWOEVhmsVcWDwPn224iDJgla8Hd38Hd3ELQgaIeI/hZgAIPEp0vmQJdoAAAAAElFTkSuQmCC) no-repeat 50% 0, */- url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACEAAAAXCAYAAACFxybfAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAodJREFUeNrsVb1rWlEUv2pN/GqspKRSKFYXWzEloIWif0Fn6dJChQ7OQil0qd3EzcEpg0OgdHDr4CQODk7VRlLMEIVqApX4We0zflR9/Z1Ui4T34ksaaAYP/Hzc673n/M6550PG8zz73yKjn0wm83fDYDAwo9HINBrNnwOQg4MDs0ql2lQqlfdAWont7ng8Pjw+Ps44nc4G1pI9EXWaSOzt7TGO42aH5Pv7+08ajUZ0MBiUeXEZd7vdL5VK5fX29rZ+5tQiEmdxKrlcjsEYczgcynK5/BKKv/IXFNz/XiqVXkHdjUuRIA9SqdRD8or/R8Ez9fr9fqHVakUR4c2z0REjIQuHw2ZcrPBXLCA0RHTezEdHjIQqkUhEr9I4HOILhQLf6/VoOUFEvDMiQiToDx1Cdz+bzZ6bUFarlel0OkkVUK/XWbvdPoVer5fh3ntsfwJ+CJ2XA4p0Op1bpBgJyxDehQQ6nQ5DZXHBYDBZq9V+EhFUndnr9drEqoc2bwJbwGPgtohuVSwWe2Gz2TZMJpNgRKi6qtUqg2EWj8dTgUDgo0KhWPN4PC70EvXOzs67fD6/S6kiRIKeZA1YJ2MiJNbdbvfTUCjkV6vVK2hcDF8GI2w0GrGTkxM2HA5PDxaLxSOfz/cWEfk81X0XIMMFgJJ/srBjCgk8IdcfuVyuZ36//7nFYtkQyAMumUzuRiKRD0jMFLa+AZOpYwqgB/ziBVqmVBKUO7eAB/R0WG/Z7XaTVqtdbTabHJL6EK2djBaBPHA0NSqpbUsiMUeEBgpF4Q5AbZrmSJ/yEWgBTaBNHl9kdkgmMUeG7qwAq9PqovceTA3zlxlgsuswyuXsGsiSxJLEkoSY/BZgAEjRodi+uBruAAAAAElFTkSuQmCC) no-repeat 100% 0;--}\ No newline at end of file+ content: '';+ display: block;+ position: absolute;+ top: -10px;+ left: -3px;+ right: 0;+ height: 23px;+ background:+ url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACsAAAAXCAYAAACS5bYWAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAABFpJREFUeNrUV0tIo1cUvpkYjQ4xxSA6DxuNqG0dtaUKOgs3s6i0dFd3pSsXdjeIixakiGA34sZuXCkoONLFwJTK4GMYLYXg29gatTpiXurkbd7vv9/5ub+IxuhA7eiFQ5Kbc8/57ne/e87/ywRBYLdl3GG3aNwqsLJ0k0tLS+fmcnNzWUVFBVMoFGx2djarvLxcm5OTw+bm5iytra2xc4ExNjY27iqVyvvwK6CpeDzuCYVC1urq6qDA9UcfPp+PHR4esmAwKK6tr68/l5/8rgQ2Ozub1dbWyiYmJooaGxt/VqvV38jlchX9l0qlwoFA4DWS/RKLxRxFRUVf5+XlPcaaT2AP0sVPJBL2SCRiAPBpu93+vKamZo/Ae71eZjabWV1dXVqw7CKwp43ksrCw8Bhg7MJ/PLDZ5PHx8cz29vYT5JGD/bSYLgTrcDgYdk6siSc6NjZWDaAe4ZoHQL+cmZnRpZPnhWDpD8kw7uKo9ML/NMCsd2tr61vkzboMrEyv138M7TyLRqMWMBsX3sMgaZhMpp+AR5EJrCocDpuEGzKg4x8khs+CVWxubvZfR9JkMik4nU7BarUKLpeLmLsKuwIqTLynp4fqmIzASrqQT09Pf1VVVfX0KsWZ6uHBwQHTaDSsoKAgo6/H4xHLEcrVyRwuEisrKzs5XrrIVAVwiUVDKRRrL+YI32ewdVhMApuHWvcj6vids6J2u90MF4yBHUZNgKoEBaRBQalJqFSqtJfUYrGIlQX+ydXVVTN+u0tKSjQNDQ1axJVl2iTypebn55d7e3v/kqoDgZU1NTU9LCws/Py0M+2ekuGincxJ3yF+18jIyHJLS0slQJUWFxczrBeBE0vE5tHRkbixlZWVfSR8gTX/0P5gH7S1tX3Z3t7+BW8qAvwSfr8/jA0EIRM/qoFtampqbW9vTw+XA+ojUruVd3Z2tvb19T2TQFEim81GgVJoCvvj4+NLOJZgaWmpemdn5y3a6BbcnJDAw8HBwac6ne6eqCW5XDwB3qVSqM9/DAwMUNy/eVLabT7sI25qwgujThCBhWE+mAt2yNc4SQKSZrOQQE1HS22VJkmPAGTr7+//fX19fRk+Zgq0trbGeFAKEAQT98BSqKOj47vm5uaa/Px8JeIk4GcaHh6eWlxcfAU/A8xG67BxAX3fwdcbYUpSDJ06Z49Ak8ZC3OL8f3YiA4PBYKdLQ2AJ9OTk5GpXV9cQiCVh79M94QtlPLDUE/1gPNrd3f0W33W4cBoco48zQuy/IZYAMnGqlSc4c66L9JruQUaSARXeT8HGKzxAqFBekni6+h46+pMzGiJGMgTOJh1yU/KNEGDvZWvfBawkA9ppwGg0mrRa7SOI2g+gxOgbJIpdFpj72PnxSnPX8vqRxTURgBQWKisrH+GThOm+CtAzoK/9/Uiqq/6hoaHfdnd3jaOjo7/yY7yxbwqkWy3sQzpS2C6YirwvUJk0y7hurfyGRrnduPGvAAMASmo8wzeVwfsAAAAASUVORK5CYII=)+ no-repeat 0 0,+ /* url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAE0AAAAXCAYAAABOHMIhAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAABiZJREFUeNrsWMtPlFcUvzPMwIDysLyRR4uATDHWCiVgSmRlios2DeiiXUFs0nRBd6arxqQhJDapkYXhP4BqDKTQhZaFNQSCaBEVJjwdHsNr5DUMDDPDzPT3u7nTDEgRKrKgc5KT+z3uufec33de99P4fD4RpL2RNgjB3kn35MkTeRERESFiYmLkGBoaKnQ6nWSNRvPPZFxr+vv7k6KioiIdDsfa8vLyQkFBgcP3Bnel3MDAQArWI0eFhISE87nb7bZ7PJ4VvLYuLi5O5+fnu9+kMNfq6+tLjIyMzMY6KeBEbK/XarXReI3lPDZMWcc4v7GxYV1dXR3Jy8ub2E5HPvJ6vRSSDH0ku1wuAfsEZOV1IEFHoeNFdHS0yMrK2knR0Lm5uR+hxLdQMjbwHTZbB41h8RGwCdc9MzMzneHh4bGJiYlf4SN8ijkfwqiIncCAAR7Iz2GPSShudjqdfeCeqampvwBQfFxc3JdYqwTv8gB8/F48A8BgKecE14V+L7ju2tpae05OzkuCCZvkPOj8mizmC6vVKtmPu+bx48cC3qI1mUyFUOyywWD4SHlELBaLJmCHNcwAghuAOujtuF4FqHO4nsX4EsAS3I4TJ04ME1h8PDE9PS09TYZoY2Pj1729vd6lpSVfkDYTPG0UkfNDRUWFgQ5Gb2Mh0N29e9eG/GQfHh4W8/PzwUy/ObQ/gMfVVlZW1iAiZdQxp3nv3LljRoL/5erVq1UIxzSiiVD9X4EDYATynCwAzGO858hCQRoaGmJFZNJz8YIcBc4BF966dau6sLAwBxVSJCUlCSThQwuU3W6XkYUok1Vzm5znQx5bbm9v77p+/frPeNSNRzZ/ISBwrG4ZR48eLamtrf2+uLjYSEG9Xi/wTISFhQlWGXohyzO/CJlVl23KQRLbABoaHx+/Z1lUZ/Hq1SsJFj3JT3hmHx8fnydPTEzMj46OziHPW2w22wxeD4Kfgadh/4YEzU8Az4DhffAn5eXlX1y6dKkEoCTspAQ9Mjs7+0BBo8Fms1lkZGTsOo0QLLRNkvnR+fEJzIMHD0xtbW39CL8JTFtSbAOvBIyLHIGVm9VzE2gKuDAMSSpcT6KXyT137lx2cnLyMXhcGDb3wq3XuWF3d/fCzZs3P0c4v5eSknJQbYLo7Ox0gC2lpaVZ3Be67Th/dnZWoAJKsJC3XA8fPhxoamp6hMb+BaaMgWcUMGtszZjiFDNmvcDI91pzG0iY4ARwkwrxkcHBwUdgNrRMbnrqoRbkVzDcvn3bl5qaWsmcgFH4G8XdEGUWFhak51AuISFBnkoCTyFbyWKxCJwIxlC0fq2rq7tcVFRkRKskjh8/Lr0+kBjCCDV/knfdv3//WX19/R8IRRNemxlu4AXwKqM+EJwdj1HbPYSwh3sCPAJDABm2LLchCjS+5/kirKGhwWk0GrMuXrxYQuX9hm/XXTMXMY+srKwI5ApZrbYmZh7deEJhAUKjLe/pLTzSsCuHrK+1tbUJVe3P6upq87Vr174rKysrYHVj/uW+OH3IfEuw4F3ee/fuPQfAvwOs5yyE4CnlFOu7BWrTCWlreO6FACpBZGwUw4BvkANLobReHb3kGZYGsGzTq/zlO8AT1ru6uoZbWlqeA6gINJAfnz59OlVLoX8Jtebm5raampqfcMvQYgTknz9//sKVK1c+y83NTdIEuCnaKMuNGzd+6+np6cCtSTkAw9D9X8Dyh+dbgaaAC1XAnUlPTy+qqqq6cPbs2UzkmWjNljiDJzpwHFnCkW2yo6NjCKW8H54wjlezKvRT09LSTsJrz5w6dSoN+Yp51ADAPUj8VoDbDq9pxrwuJcNIYQllJTIi/xopBw/VA7DJp0+f9hA78CgL5F5C8J2CpoCj8sfA6WCe/FPRhsRlZmbGIs8Y4FFO5CJgtrSsvrRVGW1V93b1myoGnKAKEcHgnwsWpg1lNI0fphwrmdqbckeU18WrnlOjqp5/j7W3BWvfQVPKa5SBkcrYCNVB65TRTlWZ1lXiXVU5xbtlDb2SPaLWYwrgHIcqPg6Vc7fbX69Yoyqfa7/AeiegbWOEVhmsVcWDwPn224iDJgla8Hd38Hd3ELQgaIeI/hZgAIPEp0vmQJdoAAAAAElFTkSuQmCC) no-repeat 50% 0, */+ url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACEAAAAXCAYAAACFxybfAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAodJREFUeNrsVb1rWlEUv2pN/GqspKRSKFYXWzEloIWif0Fn6dJChQ7OQil0qd3EzcEpg0OgdHDr4CQODk7VRlLMEIVqApX4We0zflR9/Z1Ui4T34ksaaAYP/Hzc673n/M6550PG8zz73yKjn0wm83fDYDAwo9HINBrNnwOQg4MDs0ql2lQqlfdAWont7ng8Pjw+Ps44nc4G1pI9EXWaSOzt7TGO42aH5Pv7+08ajUZ0MBiUeXEZd7vdL5VK5fX29rZ+5tQiEmdxKrlcjsEYczgcynK5/BKKv/IXFNz/XiqVXkHdjUuRIA9SqdRD8or/R8Ez9fr9fqHVakUR4c2z0REjIQuHw2ZcrPBXLCA0RHTezEdHjIQqkUhEr9I4HOILhQLf6/VoOUFEvDMiQiToDx1Cdz+bzZ6bUFarlel0OkkVUK/XWbvdPoVer5fh3ntsfwJ+CJ2XA4p0Op1bpBgJyxDehQQ6nQ5DZXHBYDBZq9V+EhFUndnr9drEqoc2bwJbwGPgtohuVSwWe2Gz2TZMJpNgRKi6qtUqg2EWj8dTgUDgo0KhWPN4PC70EvXOzs67fD6/S6kiRIKeZA1YJ2MiJNbdbvfTUCjkV6vVK2hcDF8GI2w0GrGTkxM2HA5PDxaLxSOfz/cWEfk81X0XIMMFgJJ/srBjCgk8IdcfuVyuZ36//7nFYtkQyAMumUzuRiKRD0jMFLa+AZOpYwqgB/ziBVqmVBKUO7eAB/R0WG/Z7XaTVqtdbTabHJL6EK2djBaBPHA0NSqpbUsiMUeEBgpF4Q5AbZrmSJ/yEWgBTaBNHl9kdkgmMUeG7qwAq9PqovceTA3zlxlgsuswyuXsGsiSxJLEkoSY/BZgAEjRodi+uBruAAAAAElFTkSuQmCC)+ no-repeat 100% 0;+}diff --git a/app/styles/Flatpicker.css b/app/styles/Flatpicker.cssindex 9ab1625d1..dd4fe7f4b 100644--- a/app/styles/Flatpicker.css+++ b/app/styles/Flatpicker.css@@ -7,23 +7,23 @@top: 30px;}-.flatpicker-custom .flatpickr-day.selected,-.flatpicker-custom .flatpickr-day.startRange,-.flatpicker-custom .flatpickr-day.endRange,-.flatpicker-custom .flatpickr-day.selected.inRange,-.flatpicker-custom .flatpickr-day.startRange.inRange,-.flatpicker-custom .flatpickr-day.endRange.inRange,-.flatpicker-custom .flatpickr-day.selected:focus,-.flatpicker-custom .flatpickr-day.startRange:focus,-.flatpicker-custom .flatpickr-day.endRange:focus,-.flatpicker-custom .flatpickr-day.selected:hover,-.flatpicker-custom .flatpickr-day.startRange:hover,-.flatpicker-custom .flatpickr-day.endRange:hover,-.flatpicker-custom .flatpickr-day.selected.prevMonthDay,-.flatpicker-custom .flatpickr-day.startRange.prevMonthDay,-.flatpicker-custom .flatpickr-day.endRange.prevMonthDay,-.flatpicker-custom .flatpickr-day.selected.nextMonthDay,-.flatpicker-custom .flatpickr-day.startRange.nextMonthDay,+.flatpicker-custom .flatpickr-day.selected,+.flatpicker-custom .flatpickr-day.startRange,+.flatpicker-custom .flatpickr-day.endRange,+.flatpicker-custom .flatpickr-day.selected.inRange,+.flatpicker-custom .flatpickr-day.startRange.inRange,+.flatpicker-custom .flatpickr-day.endRange.inRange,+.flatpicker-custom .flatpickr-day.selected:focus,+.flatpicker-custom .flatpickr-day.startRange:focus,+.flatpicker-custom .flatpickr-day.endRange:focus,+.flatpicker-custom .flatpickr-day.selected:hover,+.flatpicker-custom .flatpickr-day.startRange:hover,+.flatpicker-custom .flatpickr-day.endRange:hover,+.flatpicker-custom .flatpickr-day.selected.prevMonthDay,+.flatpicker-custom .flatpickr-day.startRange.prevMonthDay,+.flatpicker-custom .flatpickr-day.endRange.prevMonthDay,+.flatpicker-custom .flatpickr-day.selected.nextMonthDay,+.flatpicker-custom .flatpickr-day.startRange.nextMonthDay,.flatpicker-custom .flatpickr-day.endRange.nextMonthDay {background: #1d4ed8;-webkit-box-shadow: none;@@ -34,27 +34,27 @@/* if you need other color on dark theme */-.dark .flatpicker-custom .flatpickr-day.selected,-.dark .flatpicker-custom .flatpickr-day.startRange,-.dark .flatpicker-custom .flatpickr-day.endRange,-.dark .flatpicker-custom .flatpickr-day.selected.inRange,-.dark .flatpicker-custom .flatpickr-day.startRange.inRange,-.dark .flatpicker-custom .flatpickr-day.endRange.inRange,-.dark .flatpicker-custom .flatpickr-day.selected:focus,-.dark .flatpicker-custom .flatpickr-day.startRange:focus,-.dark .flatpicker-custom .flatpickr-day.endRange:focus,-.dark .flatpicker-custom .flatpickr-day.selected:hover,-.dark .flatpicker-custom .flatpickr-day.startRange:hover,-.dark .flatpicker-custom .flatpickr-day.endRange:hover,-.dark .flatpicker-custom .flatpickr-day.selected.prevMonthDay,-.dark .flatpicker-custom .flatpickr-day.startRange.prevMonthDay,-.dark .flatpicker-custom .flatpickr-day.endRange.prevMonthDay,-.dark .flatpicker-custom .flatpickr-day.selected.nextMonthDay,-.dark .flatpicker-custom .flatpickr-day.startRange.nextMonthDay,+.dark .flatpicker-custom .flatpickr-day.selected,+.dark .flatpicker-custom .flatpickr-day.startRange,+.dark .flatpicker-custom .flatpickr-day.endRange,+.dark .flatpicker-custom .flatpickr-day.selected.inRange,+.dark .flatpicker-custom .flatpickr-day.startRange.inRange,+.dark .flatpicker-custom .flatpickr-day.endRange.inRange,+.dark .flatpicker-custom .flatpickr-day.selected:focus,+.dark .flatpicker-custom .flatpickr-day.startRange:focus,+.dark .flatpicker-custom .flatpickr-day.endRange:focus,+.dark .flatpicker-custom .flatpickr-day.selected:hover,+.dark .flatpicker-custom .flatpickr-day.startRange:hover,+.dark .flatpicker-custom .flatpickr-day.endRange:hover,+.dark .flatpicker-custom .flatpickr-day.selected.prevMonthDay,+.dark .flatpicker-custom .flatpickr-day.startRange.prevMonthDay,+.dark .flatpicker-custom .flatpickr-day.endRange.prevMonthDay,+.dark .flatpicker-custom .flatpickr-day.selected.nextMonthDay,+.dark .flatpicker-custom .flatpickr-day.startRange.nextMonthDay,.dark .flatpicker-custom .flatpickr-day.endRange.nextMonthDay {background: #4f46e5;-webkit-box-shadow: none;box-shadow: none;color: #fff;border-color: #4f46e5;-}\ No newline at end of file+}diff --git a/app/styles/ProjectViewStyle.css b/app/styles/ProjectViewStyle.cssindex f96195b07..5652f98c0 100644--- a/app/styles/ProjectViewStyle.css+++ b/app/styles/ProjectViewStyle.css@@ -16,11 +16,11 @@ html.dark .bb-axis .domain {}.bb-target-unique .bb-bar {- stroke: #2563EB !important;+ stroke: #2563eb !important;}.bb-target-total .bb-bar {- stroke: #D97706 !important;+ stroke: #d97706 !important;}.bb-target-sessionDuration .bb-bar {@@ -28,27 +28,27 @@ html.dark .bb-axis .domain {}.bb-target-bounce .bb-bar {- stroke: #2AC4B3 !important;+ stroke: #2ac4b3 !important;}.bb-target-viewsPerUnique .bb-bar {- stroke: #F87171 !important;+ stroke: #f87171 !important;}.bb-target-dns .bb-bar {- stroke: #EC4319 !important;+ stroke: #ec4319 !important;}.bb-target-tls .bb-bar {- stroke: #F27059 !important;+ stroke: #f27059 !important;}.bb-target-conn .bb-bar {- stroke: #F7A265 !important;+ stroke: #f7a265 !important;}.bb-target-response .bb-bar {- stroke: #F5D376 !important;+ stroke: #f5d376 !important;}.bb-target-render .bb-bar {@@ -56,11 +56,11 @@ html.dark .bb-axis .domain {}.bb-target-dom_load .bb-bar {- stroke: #A5E6AB !important;+ stroke: #a5e6ab !important;}.bb-target-ttfb .bb-bar {- stroke: #00A8E8 !important;+ stroke: #00a8e8 !important;}.bb-target-frontend .bb-bar {@@ -68,11 +68,11 @@ html.dark .bb-axis .domain {}.bb-target-network .bb-bar {- stroke: #F7A265 !important;+ stroke: #f7a265 !important;}.bb-target-backend .bb-bar {- stroke: #00A8E8 !important;+ stroke: #00a8e8 !important;}.bb-target-events .bb-bar {@@ -84,11 +84,11 @@ html.dark .bb-axis .domain {}.bb-target-Technical-Expences .bb-bar {- stroke: #EC4319 !important;+ stroke: #ec4319 !important;}.bb-target-Business-Expences .bb-bar {- stroke: #F27059 !important;+ stroke: #f27059 !important;}.bb-target-MRR .bb-bar {diff --git a/app/styles/index.css b/app/styles/index.cssindex e4cabe5f2..eab74d441 100644--- a/app/styles/index.css+++ b/app/styles/index.css@@ -3,11 +3,11 @@ body {margin: 0;padding: 0;width: 100%;- -webkit-font-smoothing: antialiased+ -webkit-font-smoothing: antialiased;}.loader.available {- opacity: 0+ opacity: 0;}.loader {@@ -17,10 +17,10 @@ body {position: fixed;opacity: 1;pointer-events: none;- -webkit-transition: opacity cubic-bezier(.4, 0, .2, 1) 436ms;- -moz-transition: opacity cubic-bezier(.4, 0, .2, 1) 436ms;- transition: opacity cubic-bezier(.4, 0, .2, 1) 436ms;- z-index: 9999+ -webkit-transition: opacity cubic-bezier(0.4, 0, 0.2, 1) 436ms;+ -moz-transition: opacity cubic-bezier(0.4, 0, 0.2, 1) 436ms;+ transition: opacity cubic-bezier(0.4, 0, 0.2, 1) 436ms;+ z-index: 9999;}.logo-frame {@@ -36,7 +36,7 @@ body {-webkit-animation: fadein 436ms;-moz-animation: fadein 436ms;animation: fadein 436ms;- height: 98%+ height: 98%;}.logo-frame-img {@@ -45,14 +45,14 @@ body {padding-right: 10px;-webkit-align-self: center;-moz-align-self: center;- align-self: center+ align-self: center;}.loader-head {background-color: #c6dafc;height: 4px;overflow: hidden;- position: relative+ position: relative;}.loader-head .first,@@ -68,93 +68,103 @@ body {transform-origin: left center;-webkit-transform: scaleX(0);-moz-transform: scaleX(0);- transform: scaleX(0)+ transform: scaleX(0);}.loader-head .first {-webkit-animation: first 2s linear infinite;-moz-animation: first 2s linear infinite;- animation: first 2s linear infinite+ animation: first 2s linear infinite;}.loader-head .second {-webkit-animation: second 2s linear infinite;-moz-animation: second 2s linear infinite;- animation: second 2s linear infinite+ animation: second 2s linear infinite;}@-webkit-keyframes fadein {from {- opacity: 0+ opacity: 0;}to {- opacity: 1+ opacity: 1;}}@-moz-keyframes fadein {from {- opacity: 0+ opacity: 0;}to {- opacity: 1+ opacity: 1;}}@keyframes fadein {from {- opacity: 0+ opacity: 0;}to {- opacity: 1+ opacity: 1;}}@keyframes first {0% {- transform: translate(0) scaleX(0)+ transform: translate(0) scaleX(0);}25% {- transform: translate(0) scaleX(.5)+ transform: translate(0) scaleX(0.5);}50% {- transform: translate(25%) scaleX(.75)+ transform: translate(25%) scaleX(0.75);}75% {- transform: translate(100%) scaleX(0)+ transform: translate(100%) scaleX(0);}100% {- transform: translate(100%) scaleX(0)+ transform: translate(100%) scaleX(0);}}@keyframes second {0% {- transform: translate(0) scaleX(0)+ transform: translate(0) scaleX(0);}60% {- transform: translate(0) scaleX(0)+ transform: translate(0) scaleX(0);}80% {- transform: translate(0) scaleX(.6)+ transform: translate(0) scaleX(0.6);}100% {- transform: translate(100%) scaleX(.1)+ transform: translate(100%) scaleX(0.1);}}html {- font-family: 'Inter', 'Cantarell', 'Roboto', system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'Oxygen', 'Ubuntu', sans-serif;+ font-family:+ 'Inter',+ 'Cantarell',+ 'Roboto',+ system-ui,+ -apple-system,+ BlinkMacSystemFont,+ 'Helvetica Neue',+ 'Oxygen',+ 'Ubuntu',+ sans-serif;-webkit-font-smoothing: antialiased;-moz-osx-font-smoothing: grayscale;scroll-behavior: smooth;@@ -242,7 +252,7 @@ code {border: 0;border-radius: 50%;background-color: #6366f1;- background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%2212%22%20height%3D%228%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M8%20.5v7L12%204zM0%204l4%203.5v-7z%22%20fill%3D%22%23FFFFFF%22%20fill-rule%3D%22nonzero%22%2F%3E%3C%2Fsvg%3E");+ background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%2212%22%20height%3D%228%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M8%20.5v7L12%204zM0%204l4%203.5v-7z%22%20fill%3D%22%23FFFFFF%22%20fill-rule%3D%22nonzero%22%2F%3E%3C%2Fsvg%3E');background-position: center;background-repeat: no-repeat;cursor: grab;@@ -254,7 +264,7 @@ code {border: 0;border-radius: 50%;background-color: #6366f1;- background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%2212%22%20height%3D%228%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M8%20.5v7L12%204zM0%204l4%203.5v-7z%22%20fill%3D%22%23FFFFFF%22%20fill-rule%3D%22nonzero%22%2F%3E%3C%2Fsvg%3E");+ background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%2212%22%20height%3D%228%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M8%20.5v7L12%204zM0%204l4%203.5v-7z%22%20fill%3D%22%23FFFFFF%22%20fill-rule%3D%22nonzero%22%2F%3E%3C%2Fsvg%3E');background-position: center;background-repeat: no-repeat;cursor: grab;diff --git a/app/styles/tailwind.css b/app/styles/tailwind.cssindex bd6213e1d..b5c61c956 100644--- a/app/styles/tailwind.css+++ b/app/styles/tailwind.css@@ -1,3 +1,3 @@@tailwind base;@tailwind components;-@tailwind utilities;\ No newline at end of file+@tailwind utilities;diff --git a/app/ui/Alert.tsx b/app/ui/Alert.tsxindex af4780e5a..bbd3c52cd 100644--- a/app/ui/Alert.tsx+++ b/app/ui/Alert.tsx@@ -2,25 +2,21 @@import React, { memo } from 'react'import { useTranslation } from 'react-i18next'import PropTypes from 'prop-types'-import {- CheckCircleIcon, InformationCircleIcon, XCircleIcon, XMarkIcon,-} from '@heroicons/react/24/solid'+import { CheckCircleIcon, InformationCircleIcon, XCircleIcon, XMarkIcon } from '@heroicons/react/24/solid'interface IAlert {/* (string): The message to be displayed in the alert. */- message: string,+ message: string// (object): An object containing the options for the alert, including the type property, which can have the values 'info', 'success', or 'error'.options: {- type: 'info' | 'success' | 'error',- },+ type: 'info' | 'success' | 'error'+ }// (function): A callback function to be called when the alert is closed.- close: () => void,+ close: () => void}// AlertTemplate component-const AlertTemplate = ({- message, options, close,-}: IAlert): JSX.Element => {+const AlertTemplate = ({ message, options, close }: IAlert): JSX.Element => {const { t } = useTranslation('common')const { type } = optionsconst isInfo = type === 'info'@@ -42,9 +38,7 @@ const AlertTemplate = ({{isSuccess && t('common.success')}{isError && t('common.error')}</p>- <p className='mt-1 text-sm text-gray-500 dark:text-gray-300'>- {message}- </p>+ <p className='mt-1 text-sm text-gray-500 dark:text-gray-300'>{message}</p></div><div className='ml-4 flex flex-shrink-0'><button@@ -52,9 +46,7 @@ const AlertTemplate = ({className='inline-flex rounded-md bg-white dark:bg-slate-900 text-gray-400 hover:text-gray-500 dark:text-gray-200 dark:hover:text-gray-400 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2'onClick={close}>- <span className='sr-only'>- {t('common.close')}- </span>+ <span className='sr-only'>{t('common.close')}</span><XMarkIcon className='h-5 w-5' aria-hidden='true' /></button></div>@@ -79,7 +71,7 @@ AlertTemplate.defaultProps = {message: '',className: '',options: {},- close: () => { },+ close: () => {},}export default memo(AlertTemplate)diff --git a/app/ui/Badge.tsx b/app/ui/Badge.tsxindex 3a35c0144..0aa094022 100644--- a/app/ui/Badge.tsx+++ b/app/ui/Badge.tsx@@ -2,25 +2,28 @@ import React from 'react'import cx from 'clsx'interface IBadge {- label: string,- className?: string,- colour?: 'red' | 'yellow' | 'green' | 'indigo' | 'slate',+ label: string+ className?: string+ colour?: 'red' | 'yellow' | 'green' | 'indigo' | 'slate'}const Badge = ({ label, className, colour }: IBadge): JSX.Element => (<spanclassName={cx('inline-flex items-center rounded-md px-2 py-1 text-xs font-medium ring-1 ring-inset', className, {- 'ring-slate-500/10 text-slate-600 bg-slate-50 dark:bg-slate-400/10 dark:text-slate-400 dark:ring-slate-400/20': colour === 'slate',- 'bg-indigo-50 text-indigo-700 ring-indigo-700/10 dark:bg-indigo-400/10 dark:text-indigo-400 dark:ring-indigo-400/30': colour === 'indigo',- 'bg-yellow-50 text-yellow-800 ring-yellow-600/20 dark:bg-yellow-400/10 dark:text-yellow-500 dark:ring-yellow-400/20': colour === 'yellow',- 'bg-green-50 text-green-700 ring-green-600/20 dark:bg-green-500/10 dark:text-green-400 dark:ring-green-500/20': colour === 'green',- 'bg-red-50 text-red-700 ring-red-600/10 dark:bg-red-400/10 dark:text-red-400 dark:ring-red-400/20': colour === 'red',+ 'ring-slate-500/10 text-slate-600 bg-slate-50 dark:bg-slate-400/10 dark:text-slate-400 dark:ring-slate-400/20':+ colour === 'slate',+ 'bg-indigo-50 text-indigo-700 ring-indigo-700/10 dark:bg-indigo-400/10 dark:text-indigo-400 dark:ring-indigo-400/30':+ colour === 'indigo',+ 'bg-yellow-50 text-yellow-800 ring-yellow-600/20 dark:bg-yellow-400/10 dark:text-yellow-500 dark:ring-yellow-400/20':+ colour === 'yellow',+ 'bg-green-50 text-green-700 ring-green-600/20 dark:bg-green-500/10 dark:text-green-400 dark:ring-green-500/20':+ colour === 'green',+ 'bg-red-50 text-red-700 ring-red-600/10 dark:bg-red-400/10 dark:text-red-400 dark:ring-red-400/20':+ colour === 'red',})}>{label}</span>)-export {- Badge,-}+export { Badge }diff --git a/app/ui/Beta.tsx b/app/ui/Beta.tsxindex d40f2cc74..546f89d6e 100644--- a/app/ui/Beta.tsx+++ b/app/ui/Beta.tsx@@ -7,7 +7,7 @@ import { Badge } from './Badge'// Define the prop types for the componentinterface IBeta {- className?: string,+ className?: string}const Beta = ({@@ -19,9 +19,7 @@ const Beta = ({return (<TooltipclassName='max-w-content !w-full'- tooltipNode={(- <Badge className={className} label={t('beta.title')} colour='yellow' />- )}+ tooltipNode={<Badge className={className} label={t('beta.title')} colour='yellow' />}text={t('beta.description')}/>)diff --git a/app/ui/Button.tsx b/app/ui/Button.tsxindex 0047fab31..2f8e481e7 100644--- a/app/ui/Button.tsx+++ b/app/ui/Button.tsx@@ -7,37 +7,54 @@ import Spin from './icons/Spin'// Define the prop types for the componentinterface IButton extends React.DetailedHTMLProps<ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement> {// (string): The text to be displayed in the button.- text?: string,+ text?: string// (node): The content to be displayed in the button.- children?: JSX.Element | string,- primary?: boolean,- secondary?: boolean,- danger?: boolean,+ children?: JSX.Element | string+ primary?: boolean+ secondary?: boolean+ danger?: boolean// (function): The function to be called when the button is clicked.- onClick?: () => void,- white?: boolean,- small?: boolean,- regular?: boolean,- large?: boolean,- giant?: boolean,+ onClick?: () => void+ white?: boolean+ small?: boolean+ regular?: boolean+ large?: boolean+ giant?: boolean// (string): The type of button to be rendered.- type?: 'button' | 'submit' | 'reset',+ type?: 'button' | 'submit' | 'reset'// (string): Additional CSS classes to be applied to the button.- className?: string,+ className?: string// (boolean): Whether the button is in a loading state.- loading?: boolean,- semiSmall?: boolean,- semiDanger?: boolean,+ loading?: boolean+ semiSmall?: boolean+ semiDanger?: boolean// (boolean): Whether the button is in a focus state.- focus?: boolean,- noBorder?: boolean,+ focus?: boolean+ noBorder?: boolean// (boolean): Whether the button is disabled.- disabled?: boolean,+ disabled?: boolean}const Button = ({- text, children, primary, secondary, danger, onClick, white, small, regular, large,- giant, type, className, loading, semiSmall, semiDanger, noBorder, focus, disabled,+ text,+ children,+ primary,+ secondary,+ danger,+ onClick,+ white,+ small,+ regular,+ large,+ giant,+ type,+ className,+ loading,+ semiSmall,+ semiDanger,+ noBorder,+ focus,+ disabled,...props}: IButton): JSX.Element => (<button@@ -45,25 +62,29 @@ const Button = ({disabled={disabled || loading}type={type}onClick={onClick}- className={cx('relative inline-flex select-none items-center border leading-4 font-medium rounded-md', {- 'shadow-sm text-gray-50 bg-slate-900 hover:bg-slate-700 dark:bg-indigo-700 dark:hover:bg-indigo-800 border-transparent': primary,- 'text-slate-900 bg-slate-300 hover:bg-slate-200 border-transparent': secondary,- 'text-gray-700 bg-white hover:bg-gray-50 border-transparent': white,- 'text-gray-50 bg-red-500 hover:bg-red-600 dark:bg-red-600 dark:hover:bg-red-700 border-transparent': danger,- 'text-red-500 hover:text-red-600 border-red-600 dark:text-red-300 dark:hover:text-red-400 dark:border-red-500 border-1': semiDanger,- 'focus:border-none border-none text-gray-700 dark:text-white focus:ring-0 focus:ring-offset-0': noBorder,- 'px-2.5 py-1.5 text-xs': small,- 'px-2.5 py-1.5 text-sm': semiSmall,- 'px-4 py-2 text-sm': large,- 'px-6 py-3 text-base': giant,- 'px-3 py-2 text-sm': regular,- 'cursor-not-allowed': loading,- 'focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500': focus,- }, className)}- >- {loading && (- <Spin alwaysLight />+ className={cx(+ 'relative inline-flex select-none items-center border leading-4 font-medium rounded-md',+ {+ 'shadow-sm text-gray-50 bg-slate-900 hover:bg-slate-700 dark:bg-indigo-700 dark:hover:bg-indigo-800 border-transparent':+ primary,+ 'text-slate-900 bg-slate-300 hover:bg-slate-200 border-transparent': secondary,+ 'text-gray-700 bg-white hover:bg-gray-50 border-transparent': white,+ 'text-gray-50 bg-red-500 hover:bg-red-600 dark:bg-red-600 dark:hover:bg-red-700 border-transparent': danger,+ 'text-red-500 hover:text-red-600 border-red-600 dark:text-red-300 dark:hover:text-red-400 dark:border-red-500 border-1':+ semiDanger,+ 'focus:border-none border-none text-gray-700 dark:text-white focus:ring-0 focus:ring-offset-0': noBorder,+ 'px-2.5 py-1.5 text-xs': small,+ 'px-2.5 py-1.5 text-sm': semiSmall,+ 'px-4 py-2 text-sm': large,+ 'px-6 py-3 text-base': giant,+ 'px-3 py-2 text-sm': regular,+ 'cursor-not-allowed': loading,+ 'focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500': focus,+ },+ className,)}+ >+ {loading && <Spin alwaysLight />}{text || children}</button>)@@ -94,7 +115,7 @@ Button.propTypes = {// Define the default props for the componentButton.defaultProps = {text: null,- onClick: () => { },+ onClick: () => {},primary: false,secondary: false,white: false,diff --git a/app/ui/Chart.tsx b/app/ui/Chart.tsxindex a887dfa4a..4156021b7 100644--- a/app/ui/Chart.tsx+++ b/app/ui/Chart.tsx@@ -6,9 +6,9 @@ import 'billboard.js/dist/billboard.css'// Define the prop types for the componentinterface IChart {// (string): The ID of the chart container.- current: string,+ current: string// (object): The chart options.- options: any,+ options: any}const Chart = ({ current, options }: IChart): JSX.Element => {diff --git a/app/ui/Checkbox.tsx b/app/ui/Checkbox.tsxindex c586631ba..4a119e669 100644--- a/app/ui/Checkbox.tsx+++ b/app/ui/Checkbox.tsx@@ -4,26 +4,39 @@ import PropTypes from 'prop-types'// Define the prop types for the componentinterface ICheckbox {- label: string | JSX.Element,- hint?: string | JSX.Element,- id?: string,- name?: string,- className?: string,- onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void,- checked?: boolean,- hintClassName?: string,- disabled?: boolean,+ label: string | JSX.Element+ hint?: string | JSX.Element+ id?: string+ name?: string+ className?: string+ onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void+ checked?: boolean+ hintClassName?: string+ disabled?: boolean}const Checkbox = ({- label, hint, id, name, className, onChange, checked, hintClassName, disabled,+ label,+ hint,+ id,+ name,+ className,+ onChange,+ checked,+ hintClassName,+ disabled,}: ICheckbox): JSX.Element => {const identifier = id || namereturn (- <div className={cx('relative flex items-start whitespace-pre-line', {- 'cursor-not-allowed': disabled,- }, className)}+ <div+ className={cx(+ 'relative flex items-start whitespace-pre-line',+ {+ 'cursor-not-allowed': disabled,+ },+ className,+ )}><div className='flex items-center h-5'><input@@ -34,13 +47,25 @@ const Checkbox = ({type='checkbox'checked={checked}onChange={onChange}- className={cx('focus:ring-indigo-500 h-4 w-4 text-indigo-600 border-gray-300 dark:border-slate-800 dark:bg-slate-700 dark:checked:bg-indigo-600 rounded cursor-pointer', { '!cursor-not-allowed': disabled, 'opacity-50': disabled })}+ className={cx(+ 'focus:ring-indigo-500 h-4 w-4 text-indigo-600 border-gray-300 dark:border-slate-800 dark:bg-slate-700 dark:checked:bg-indigo-600 rounded cursor-pointer',+ { '!cursor-not-allowed': disabled, 'opacity-50': disabled },+ )}/></div><div className='ml-3 text-sm'>- <label htmlFor={identifier} className={cx('font-medium text-gray-700 dark:text-gray-200 cursor-pointer', { '!cursor-not-allowed': disabled })}>{label}</label>+ <label+ htmlFor={identifier}+ className={cx('font-medium text-gray-700 dark:text-gray-200 cursor-pointer', {+ '!cursor-not-allowed': disabled,+ })}+ >+ {label}+ </label>{hint && (- <p id={`${identifier}-description`} className={cx('text-gray-500 dark:text-gray-300', hintClassName)}>{hint}</p>+ <p id={`${identifier}-description`} className={cx('text-gray-500 dark:text-gray-300', hintClassName)}>+ {hint}+ </p>)}</div></div>@@ -49,9 +74,7 @@ const Checkbox = ({// Define the prop types for the componentCheckbox.propTypes = {- label: PropTypes.oneOfType([- PropTypes.string, PropTypes.node,- ]),+ label: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),checked: PropTypes.bool.isRequired,hint: PropTypes.string,onChange: PropTypes.func,@@ -66,7 +89,7 @@ Checkbox.propTypes = {Checkbox.defaultProps = {label: '',hint: '',- onChange: () => { },+ onChange: () => {},id: '',className: '',name: '',diff --git a/app/ui/Combobox.tsx b/app/ui/Combobox.tsxindex 7ef45edcc..a5d0d17b5 100644--- a/app/ui/Combobox.tsx+++ b/app/ui/Combobox.tsx@@ -11,27 +11,32 @@ import _toLower from 'lodash/toLower'import _includes from 'lodash/includes'interface ISelect {- title?: string,- className?: string,- buttonClassName?: string,- items: any[],- labelExtractor?: (item: any, index: number) => string,- keyExtractor?: (item: any, index: number) => string,- onSelect: (item: any) => void,- placeholder?: string,+ title?: string+ className?: string+ buttonClassName?: string+ items: any[]+ labelExtractor?: (item: any, index: number) => string+ keyExtractor?: (item: any, index: number) => string+ onSelect: (item: any) => void+ placeholder?: string}const Combobox = ({- title, className, items, labelExtractor, keyExtractor, onSelect,- buttonClassName, placeholder,+ title,+ className,+ items,+ labelExtractor,+ keyExtractor,+ onSelect,+ buttonClassName,+ placeholder,}: ISelect): JSX.Element => {const { t } = useTranslation('common')const [query, setQuery] = useState('')- const filteredItems =- _isEmpty(items)- ? items- : _filter(items, (item, index) => {+ const filteredItems = _isEmpty(items)+ ? items+ : _filter(items, (item, index) => {const label = labelExtractor ? labelExtractor(item, index) : itemreturn _includes(_toLower(label), _toLower(query))@@ -42,17 +47,17 @@ const Combobox = ({<div className={cx('relative mt-1', className)}><div className='relative w-full cursor-default rounded-lg'><HeadlessCombobox.Input- className={cx('relative w-full bg-white border border-gray-300 dark:text-gray-50 dark:border-gray-800 dark:bg-slate-800 rounded-md shadow-sm pl-3 pr-10 py-2 text-left cursor-default focus:outline-none focus:ring-1 focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm', buttonClassName)}+ className={cx(+ 'relative w-full bg-white border border-gray-300 dark:text-gray-50 dark:border-gray-800 dark:bg-slate-800 rounded-md shadow-sm pl-3 pr-10 py-2 text-left cursor-default focus:outline-none focus:ring-1 focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm',+ buttonClassName,+ )}// @ts-ignore- displayValue={(item) => labelExtractor ? labelExtractor(item, 0) : item}+ displayValue={(item) => (labelExtractor ? labelExtractor(item, 0) : item)}onChange={(event) => setQuery(event.target.value)}placeholder={placeholder}/><HeadlessCombobox.Button className='absolute inset-y-0 right-0 flex items-center pr-2'>- <ChevronUpDownIcon- className='h-5 w-5 text-gray-400'- aria-hidden='true'- />+ <ChevronUpDownIcon className='h-5 w-5 text-gray-400' aria-hidden='true' /></HeadlessCombobox.Button></div><Transition@@ -71,17 +76,17 @@ const Combobox = ({_map(filteredItems, (item, index) => (<HeadlessCombobox.Optionkey={keyExtractor ? keyExtractor(item, index) : item}- className={({ active }) => cx('dark:text-white cursor-default select-none relative py-2 pl-8 pr-4', {- 'text-white bg-indigo-600': active,- 'text-gray-900': !active,- })}+ className={({ active }) =>+ cx('dark:text-white cursor-default select-none relative py-2 pl-8 pr-4', {+ 'text-white bg-indigo-600': active,+ 'text-gray-900': !active,+ })+ }value={labelExtractor ? labelExtractor(item, index) : item}>{({ selected, active }) => (<>- <span- className={`block truncate ${selected ? 'font-medium' : 'font-normal'}`}- >+ <span className={`block truncate ${selected ? 'font-medium' : 'font-normal'}`}>{labelExtractor ? labelExtractor(item, index) : item}</span>{selected ? (diff --git a/app/ui/Dropdown.tsx b/app/ui/Dropdown.tsxindex 983e9153a..c3ffcd811 100644--- a/app/ui/Dropdown.tsx+++ b/app/ui/Dropdown.tsx@@ -9,43 +9,55 @@ import PropTypes from 'prop-types'// Define the prop types for the componentinterface IDropdown {- title: string | number | React.ReactNode,- desc?: string | number | React.ReactNode,- className?: string,+ title: string | number | React.ReactNode+ desc?: string | number | React.ReactNode+ className?: string/* (array): An array of items to be displayed in the dropdown menu. */- items: any[],+ items: any[]/* (function): A function that returns the label for each item in the dropdown menu. */- labelExtractor: (item: any) => string | number | React.ReactNode,+ labelExtractor: (item: any) => string | number | React.ReactNode/* (function): A function that returns the key for each item in the dropdown menu. */- keyExtractor: (item: any) => string | number | React.ReactNode,+ keyExtractor: (item: any) => string | number | React.ReactNode/* (function): A function that is called when an item is selected. */- onSelect: (item: any, e?: React.MouseEvent<HTMLElement>) => void | null,- aside?: boolean,- buttonClassName?: string,- selectItemClassName?: string,- menuItemsClassName?: string,- header?: string | JSX.Element,- chevron?: 'regular' | 'mini',- headless?: boolean,+ onSelect: (item: any, e?: React.MouseEvent<HTMLElement>) => void | null+ aside?: boolean+ buttonClassName?: string+ selectItemClassName?: string+ menuItemsClassName?: string+ header?: string | JSX.Element+ chevron?: 'regular' | 'mini'+ headless?: boolean}const Dropdown = ({- title, desc, className, items, labelExtractor, keyExtractor, onSelect, aside, buttonClassName,- selectItemClassName, menuItemsClassName, header, chevron, headless,+ title,+ desc,+ className,+ items,+ labelExtractor,+ keyExtractor,+ onSelect,+ aside,+ buttonClassName,+ selectItemClassName,+ menuItemsClassName,+ header,+ chevron,+ headless,}: IDropdown): JSX.Element => (<Menu as='div' className={cx('relative inline-block text-left', className)}>{({ open }) => (<>- {!_isEmpty(desc) && (- <p className='mb-2 text-sm text-gray-900'>{desc}</p>- )}+ {!_isEmpty(desc) && <p className='mb-2 text-sm text-gray-900'>{desc}</p>}<div><Menu.ButtonclassName={cx(buttonClassName, {'justify-between': aside,'justify-center': !aside,- 'inline-flex w-full rounded-md border border-gray-300 shadow-sm px-3 md:px-4 py-2 bg-white text-sm font-medium text-gray-700 dark:text-gray-50 dark:border-gray-800 dark:bg-slate-800 hover:bg-gray-50 dark:hover:bg-slate-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-gray-100 focus:ring-indigo-500': !headless,- 'inline-flex w-full px-3 md:px-4 py-2 text-sm font-medium text-gray-700 dark:text-gray-50 outline-none group': headless,+ 'inline-flex w-full rounded-md border border-gray-300 shadow-sm px-3 md:px-4 py-2 bg-white text-sm font-medium text-gray-700 dark:text-gray-50 dark:border-gray-800 dark:bg-slate-800 hover:bg-gray-50 dark:hover:bg-slate-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-gray-100 focus:ring-indigo-500':+ !headless,+ 'inline-flex w-full px-3 md:px-4 py-2 text-sm font-medium text-gray-700 dark:text-gray-50 outline-none group':+ headless,})}>{title}@@ -78,18 +90,24 @@ const Dropdown = ({leaveFrom='transform opacity-100 scale-100'leaveTo='transform opacity-0 scale-95'>- <Menu.Items static className={cx('z-50 py-1 origin-top-right absolute right-0 mt-2 w-40 min-w-max rounded-md shadow-lg bg-white dark:bg-slate-800 ring-1 ring-black ring-opacity-5 focus:outline-none', menuItemsClassName, {- 'divide-y divide-gray-100': header,- })}>- {header && (- <p className='text-gray-700 dark:text-gray-50 px-4 py-2 text-sm font-medium'>- {header}- </p>+ <Menu.Items+ static+ className={cx(+ 'z-50 py-1 origin-top-right absolute right-0 mt-2 w-40 min-w-max rounded-md shadow-lg bg-white dark:bg-slate-800 ring-1 ring-black ring-opacity-5 focus:outline-none',+ menuItemsClassName,+ {+ 'divide-y divide-gray-100': header,+ },)}- {_map(items, item => (+ >+ {header && <p className='text-gray-700 dark:text-gray-50 px-4 py-2 text-sm font-medium'>{header}</p>}+ {_map(items, (item) => (<Menu.Item key={keyExtractor ? keyExtractor(item) : item}><span- className={selectItemClassName || 'text-gray-700 dark:text-gray-50 dark:border-gray-800 dark:bg-slate-800 block px-4 py-2 text-sm cursor-pointer hover:bg-gray-200 dark:hover:bg-slate-700'}+ className={+ selectItemClassName ||+ 'text-gray-700 dark:text-gray-50 dark:border-gray-800 dark:bg-slate-800 block px-4 py-2 text-sm cursor-pointer hover:bg-gray-200 dark:hover:bg-slate-700'+ }role='menuitem'tabIndex={0}onClick={(e: React.MouseEvent<HTMLElement>) => onSelect(item, e)}@@ -106,13 +124,9 @@ const Dropdown = ({)Dropdown.propTypes = {- title: PropTypes.oneOfType([- PropTypes.string, PropTypes.node,- ]).isRequired,+ title: PropTypes.oneOfType([PropTypes.string, PropTypes.node]).isRequired,onSelect: PropTypes.func.isRequired,- items: PropTypes.arrayOf(PropTypes.oneOfType([- PropTypes.string, PropTypes.object,- ])),+ items: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.object])),className: PropTypes.string,buttonClassName: PropTypes.string,selectItemClassName: PropTypes.string,diff --git a/app/ui/Flatpicker.tsx b/app/ui/Flatpicker.tsxindex 9fa451374..3147395f0 100644--- a/app/ui/Flatpicker.tsx+++ b/app/ui/Flatpicker.tsx@@ -9,18 +9,21 @@ import cx from 'clsx'import { MAX_MONTHS_IN_PAST } from 'redux/constants'interface FlatPickerProps {- onChange?: (dates: Date[]) => void,- value?: Date[],- maxDateMonths?: number,- options?: any,- maxRange?: number,- className?: string,+ onChange?: (dates: Date[]) => void+ value?: Date[]+ maxDateMonths?: number+ options?: any+ maxRange?: number+ className?: string}-class FlatPicker extends React.Component<FlatPickerProps, {- maxDate: string,- minDate: Date | string,-}> {+class FlatPicker extends React.Component<+ FlatPickerProps,+ {+ maxDate: string+ minDate: Date | string+ }+> {private calendar = createRef<Flatpickr>()constructor(props: FlatPickerProps) {@@ -73,9 +76,7 @@ class FlatPicker extends React.Component<FlatPickerProps, {}public render() {- const {- value = [], maxDateMonths = MAX_MONTHS_IN_PAST, options, className,- } = this.props+ const { value = [], maxDateMonths = MAX_MONTHS_IN_PAST, options, className } = this.propsconst { maxDate, minDate } = this.stateif (options) {@@ -137,7 +138,7 @@ FlatPicker.propTypes = {// @ts-ignoreFlatPicker.defaultProps = {- onChange: () => { },+ onChange: () => {},value: [],maxDateMonths: MAX_MONTHS_IN_PAST,options: null,diff --git a/app/ui/Highlighted.tsx b/app/ui/Highlighted.tsxindex 7887d2d15..cfe4e13cb 100644--- a/app/ui/Highlighted.tsx+++ b/app/ui/Highlighted.tsx@@ -1,13 +1,11 @@import React from 'react'interface IHighlighted {- children: React.ReactNode,+ children: React.ReactNode}const Highlighted = ({ children }: IHighlighted) => (- <span className='px-1 bg-slate-200 text-gray-900 rounded dark:text-gray-50 dark:bg-slate-700'>- {children}- </span>+ <span className='px-1 bg-slate-200 text-gray-900 rounded dark:text-gray-50 dark:bg-slate-700'>{children}</span>)export default Highlighteddiff --git a/app/ui/Input.tsx b/app/ui/Input.tsxindex dd5d8abd9..0f7be73ed 100644--- a/app/ui/Input.tsx+++ b/app/ui/Input.tsx@@ -6,23 +6,35 @@ import { ExclamationCircleIcon } from '@heroicons/react/24/solid'import Beta from 'ui/Beta'interface IInput {- label: string | JSX.Element,- hint?: string | JSX.Element,- placeholder?: string,- type?: string,- id?: string,- name?: string,- className?: string,- onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void,- error?: string | null | boolean,- value?: string | number,- disabled?: boolean,- onKeyDown?: (e: React.KeyboardEvent<HTMLInputElement>) => void,- isBeta?: boolean,+ label: string | JSX.Element+ hint?: string | JSX.Element+ placeholder?: string+ type?: string+ id?: string+ name?: string+ className?: string+ onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void+ error?: string | null | boolean+ value?: string | number+ disabled?: boolean+ onKeyDown?: (e: React.KeyboardEvent<HTMLInputElement>) => void+ isBeta?: boolean}const Input = ({- label, hint, placeholder, type, id, name, className, onChange, error, value, disabled, onKeyDown, isBeta,+ label,+ hint,+ placeholder,+ type,+ id,+ name,+ className,+ onChange,+ error,+ value,+ disabled,+ onKeyDown,+ isBeta,}: IInput): JSX.Element => {const identifier = id || name || typeconst isError = !_isEmpty(error)@@ -55,10 +67,13 @@ const Input = ({id={identifier}onChange={onChange}onKeyDown={onKeyDown}- className={cx('shadow-sm focus:ring-indigo-500 focus:border-indigo-500 block w-full sm:text-sm border-gray-300 dark:text-gray-50 dark:placeholder-gray-400 dark:border-slate-800/25 dark:bg-slate-800 rounded-md', {- 'border-red-300 text-red-900 placeholder-red-300': isError,- 'cursor-text': disabled,- })}+ className={cx(+ 'shadow-sm focus:ring-indigo-500 focus:border-indigo-500 block w-full sm:text-sm border-gray-300 dark:text-gray-50 dark:placeholder-gray-400 dark:border-slate-800/25 dark:bg-slate-800 rounded-md',+ {+ 'border-red-300 text-red-900 placeholder-red-300': isError,+ 'cursor-text': disabled,+ },+ )}placeholder={placeholder}aria-describedby={`${identifier}-optional`}disabled={disabled}@@ -70,24 +85,21 @@ const Input = ({)}</div>{hint && (- <p- className='mt-2 text-sm text-gray-500 dark:text-gray-300 whitespace-pre-line'- id={`${identifier}-optional`}- >+ <p className='mt-2 text-sm text-gray-500 dark:text-gray-300 whitespace-pre-line' id={`${identifier}-optional`}>{hint}</p>)}{isError && (- <p className='mt-2 text-sm text-red-600 dark:text-red-500' id='email-error'>{error}</p>+ <p className='mt-2 text-sm text-red-600 dark:text-red-500' id='email-error'>+ {error}+ </p>)}</div>)}Input.propTypes = {- value: PropTypes.oneOfType([- PropTypes.string, PropTypes.number,- ]),+ value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),label: PropTypes.string,hint: PropTypes.string,placeholder: PropTypes.string,@@ -96,9 +108,7 @@ Input.propTypes = {id: PropTypes.string,type: PropTypes.string,className: PropTypes.string,- error: PropTypes.oneOfType([- PropTypes.string, PropTypes.bool,- ]),+ error: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),name: PropTypes.string,disabled: PropTypes.bool,isBeta: PropTypes.bool,@@ -109,8 +119,8 @@ Input.defaultProps = {label: '',hint: '',placeholder: '',- onChange: () => { },- onKeyDown: () => { },+ onChange: () => {},+ onKeyDown: () => {},id: '',type: '',className: '',diff --git a/app/ui/Modal.tsx b/app/ui/Modal.tsxindex 8a1c46cf4..7897a30d8 100644--- a/app/ui/Modal.tsx+++ b/app/ui/Modal.tsx@@ -3,33 +3,51 @@ import PropTypes from 'prop-types'import cx from 'clsx'import { Dialog, Transition } from '@headlessui/react'import {- CheckIcon, ExclamationTriangleIcon, InformationCircleIcon, UserGroupIcon, XMarkIcon,+ CheckIcon,+ ExclamationTriangleIcon,+ InformationCircleIcon,+ UserGroupIcon,+ XMarkIcon,} from '@heroicons/react/24/outline'import Beta from 'ui/Beta'import Spin from './icons/Spin'interface IModal {- className?: string,- type: 'error' | 'success' | 'info' | 'warning' | 'confirmed',- title: string,- message: React.ReactNode | string,- isOpened: boolean,- onClose: () => void,- onSubmit?: () => void,- closeText?: string,- submitText?: string,- submitDisabled?: boolean,- submitType?: 'regular' | 'danger',- size?: 'regular' | 'large',- customButtons?: JSX.Element,- isBeta?: boolean,- isLoading?: boolean,- overflowVisible?: boolean,+ className?: string+ type: 'error' | 'success' | 'info' | 'warning' | 'confirmed'+ title: string+ message: React.ReactNode | string+ isOpened: boolean+ onClose: () => void+ onSubmit?: () => void+ closeText?: string+ submitText?: string+ submitDisabled?: boolean+ submitType?: 'regular' | 'danger'+ size?: 'regular' | 'large'+ customButtons?: JSX.Element+ isBeta?: boolean+ isLoading?: boolean+ overflowVisible?: boolean}const Modal = ({- className, type, title, message, isOpened, onClose, onSubmit, closeText, submitText,- submitType, size, customButtons, isBeta, isLoading, submitDisabled, overflowVisible,+ className,+ type,+ title,+ message,+ isOpened,+ onClose,+ onSubmit,+ closeText,+ submitText,+ submitType,+ size,+ customButtons,+ isBeta,+ isLoading,+ submitDisabled,+ overflowVisible,}: IModal): JSX.Element => (<Transition.Root show={isOpened} as={Fragment}><Dialog@@ -66,12 +84,15 @@ const Modal = ({leaveTo='opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95'><div- className={cx('inline-block align-bottom bg-white dark:bg-slate-900 rounded-lg px-4 pt-5 pb-4 text-left shadow-xl transform transition-all sm:my-8 sm:align-middle sm:px-5 sm:py-4', {- 'sm:max-w-lg sm:w-full': size === 'regular',- 'max-w-5xl w-full': size === 'large',- 'overflow-visible': overflowVisible,- 'overflow-hidden': !overflowVisible,- })}+ className={cx(+ 'inline-block align-bottom bg-white dark:bg-slate-900 rounded-lg px-4 pt-5 pb-4 text-left shadow-xl transform transition-all sm:my-8 sm:align-middle sm:px-5 sm:py-4',+ {+ 'sm:max-w-lg sm:w-full': size === 'regular',+ 'max-w-5xl w-full': size === 'large',+ 'overflow-visible': overflowVisible,+ 'overflow-hidden': !overflowVisible,+ },+ )}><div className='sm:flex sm:items-start'>{type === 'success' && (@@ -110,9 +131,7 @@ const Modal = ({><div>{title}- {isBeta && (- <Beta className='ml-10' />- )}+ {isBeta && <Beta className='ml-10' />}</div>{!closeText && (<XMarkIcon@@ -122,9 +141,7 @@ const Modal = ({)}</Dialog.Title>)}- <div className='mt-2 text-sm text-gray-600 whitespace-pre-line dark:text-gray-200'>- {message}- </div>+ <div className='mt-2 text-sm text-gray-600 whitespace-pre-line dark:text-gray-200'>{message}</div></div></div><div className='px-4 py-3 sm:px-0 sm:pb-0 sm:flex sm:flex-row-reverse'>@@ -132,18 +149,19 @@ const Modal = ({{submitText && (<buttontype='button'- className={cx('w-full inline-flex justify-center rounded-md shadow-sm px-4 py-2 text-base font-medium text-white sm:ml-3 sm:w-auto sm:text-sm', {- 'bg-indigo-600': submitType === 'regular',- 'bg-red-600': submitType === 'danger',- 'cursor-not-allowed opacity-70': submitDisabled,- 'hover:bg-indigo-700': submitType === 'regular' && !submitDisabled,- 'hover:bg-red-700': submitType === 'danger' && !submitDisabled,- })}+ className={cx(+ 'w-full inline-flex justify-center rounded-md shadow-sm px-4 py-2 text-base font-medium text-white sm:ml-3 sm:w-auto sm:text-sm',+ {+ 'bg-indigo-600': submitType === 'regular',+ 'bg-red-600': submitType === 'danger',+ 'cursor-not-allowed opacity-70': submitDisabled,+ 'hover:bg-indigo-700': submitType === 'regular' && !submitDisabled,+ 'hover:bg-red-700': submitType === 'danger' && !submitDisabled,+ },+ )}onClick={onSubmit}>- {isLoading && (- <Spin alwaysLight />- )}+ {isLoading && <Spin alwaysLight />}{submitText}</button>)}@@ -168,9 +186,7 @@ Modal.propTypes = {type: PropTypes.oneOf(['error', 'success', 'info', 'warning', 'confirmed']),title: PropTypes.string,onClose: PropTypes.func.isRequired,- message: PropTypes.oneOfType([- PropTypes.string, PropTypes.node,- ]),+ message: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),className: PropTypes.string,isOpened: PropTypes.bool,onSubmit: PropTypes.func,@@ -189,7 +205,7 @@ Modal.defaultProps = {className: '',message: '',isOpened: false,- onSubmit: () => { },+ onSubmit: () => {},closeText: null,submitText: null,submitDisabled: false,diff --git a/app/ui/MultiProgress.tsx b/app/ui/MultiProgress.tsxindex c1c154198..115ccc4f0 100644--- a/app/ui/MultiProgress.tsx+++ b/app/ui/MultiProgress.tsx@@ -4,25 +4,20 @@ import PropTypes from 'prop-types'import _map from 'lodash/map'interface IProgress {- value: number,- lightColour: string,- darkColour: string,+ value: number+ lightColour: string+ darkColour: string}interface IMultiProgress {- progress: IProgress[],- theme: 'dark' | 'light',- className?: string,+ progress: IProgress[]+ theme: 'dark' | 'light'+ className?: string}const MultiProgress = ({ progress, theme, className }: IMultiProgress): JSX.Element => (- <div- className='relative'- data-testid='multiprogress'- >- <div- className={cx('overflow-hidden h-5 text-xs flex rounded bg-gray-200 dark:bg-slate-600', className)}- >+ <div className='relative' data-testid='multiprogress'>+ <div className={cx('overflow-hidden h-5 text-xs flex rounded bg-gray-200 dark:bg-slate-600', className)}>{_map(progress, ({ value, lightColour, darkColour }) => (<divkey={`${value}-${lightColour}-${darkColour}`}@@ -38,11 +33,13 @@ const MultiProgress = ({ progress, theme, className }: IMultiProgress): JSX.Elem)MultiProgress.propTypes = {- progress: PropTypes.arrayOf(PropTypes.shape({- value: PropTypes.number.isRequired,- lightColour: PropTypes.string.isRequired,- darkColour: PropTypes.string.isRequired,- })).isRequired,+ progress: PropTypes.arrayOf(+ PropTypes.shape({+ value: PropTypes.number.isRequired,+ lightColour: PropTypes.string.isRequired,+ darkColour: PropTypes.string.isRequired,+ }),+ ).isRequired,theme: PropTypes.oneOf(['dark', 'light']).isRequired,className: PropTypes.string,}diff --git a/app/ui/MultiSelect.tsx b/app/ui/MultiSelect.tsxindex 31fcb7ded..8c638ab7a 100644--- a/app/ui/MultiSelect.tsx+++ b/app/ui/MultiSelect.tsx@@ -6,7 +6,18 @@ import _includes from 'lodash/includes'import _isEmpty from 'lodash/isEmpty'const MultiSelect = ({- onRemove, onSelect, items, labelExtractor, keyExtractor, label, hint, placholder, className, itemExtractor, searchPlaseholder, onSearch,+ onRemove,+ onSelect,+ items,+ labelExtractor,+ keyExtractor,+ label,+ hint,+ placholder,+ className,+ itemExtractor,+ searchPlaseholder,+ onSearch,}: {className?: stringonRemove: (item: any) => void@@ -35,30 +46,64 @@ const MultiSelect = ({><div className='my-2 p-1 flex border rounded w-ful shadow-sm bg-white text-sm font-medium text-gray-700 dark:text-gray-50 dark:border-gray-800 dark:bg-slate-800 hover:bg-gray-50 dark:hover:bg-slate-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-gray-100 focus:ring-indigo-500 '><div className='flex flex-auto flex-wrap'>- {!_isEmpty(label) ? _map(label, (item) => (- <div key={keyExtractor ? keyExtractor(item) : item} className='flex justify-center items-center m-1 font-medium py-1 px-2 rounded-full text-indigo-700 dark:text-gray-50 bg-indigo-100 dark:bg-slate-800 border border-indigo-300 dark:border-slate-500'>- <div className='text-xs font-normal leading-none max-w-full flex-initial break-words flex'>{labelExtractor ? labelExtractor(item) : item}</div>- <div className='flex flex-auto flex-row-reverse'>- <div onClick={(e) => {- e.preventDefault()- e.stopPropagation()- onRemove(item)- }}- >- <svg xmlns='http://www.w3.org/2000/svg' width='100%' height='100%' fill='none' viewBox='0 0 24 24' stroke='currentColor' strokeWidth='2' strokeLinecap='round' strokeLinejoin='round' className='feather feather-x cursor-pointer hover:text-indigo-400 rounded-full w-4 h-4 ml-2'>- <line x1='18' y1='6' x2='6' y2='18' />- <line x1='6' y1='6' x2='18' y2='18' />- </svg>+ {!_isEmpty(label) ? (+ _map(label, (item) => (+ <div+ key={keyExtractor ? keyExtractor(item) : item}+ className='flex justify-center items-center m-1 font-medium py-1 px-2 rounded-full text-indigo-700 dark:text-gray-50 bg-indigo-100 dark:bg-slate-800 border border-indigo-300 dark:border-slate-500'+ >+ <div className='text-xs font-normal leading-none max-w-full flex-initial break-words flex'>+ {labelExtractor ? labelExtractor(item) : item}+ </div>+ <div className='flex flex-auto flex-row-reverse'>+ <div+ onClick={(e) => {+ e.preventDefault()+ e.stopPropagation()+ onRemove(item)+ }}+ >+ <svg+ xmlns='http://www.w3.org/2000/svg'+ width='100%'+ height='100%'+ fill='none'+ viewBox='0 0 24 24'+ stroke='currentColor'+ strokeWidth='2'+ strokeLinecap='round'+ strokeLinejoin='round'+ className='feather feather-x cursor-pointer hover:text-indigo-400 rounded-full w-4 h-4 ml-2'+ >+ <line x1='18' y1='6' x2='6' y2='18' />+ <line x1='6' y1='6' x2='18' y2='18' />+ </svg>+ </div></div></div>- </div>- )) : (+ ))+ ) : (<p className='text-gray-300 dark:text-gray-50 flex justify-center items-center px-2'>{placholder}</p>)}</div><div className='text-gray-300 w-8 py-1 pl-2 pr-1 border-l flex items-center border-gray-200'>- <button type='button' onClick={() => setSelected(!selected)} className='cursor-pointer w-6 h-6 text-gray-600 dark:text-gray-300 outline-none focus:outline-none'>- <svg xmlns='http://www.w3.org/2000/svg' width='100%' height='100%' fill='none' viewBox='0 0 24 24' stroke='currentColor' strokeWidth='2' strokeLinecap='round' strokeLinejoin='round' className=' rotate-180 w-4 h-4'>+ <button+ type='button'+ onClick={() => setSelected(!selected)}+ className='cursor-pointer w-6 h-6 text-gray-600 dark:text-gray-300 outline-none focus:outline-none'+ >+ <svg+ xmlns='http://www.w3.org/2000/svg'+ width='100%'+ height='100%'+ fill='none'+ viewBox='0 0 24 24'+ stroke='currentColor'+ strokeWidth='2'+ strokeLinecap='round'+ strokeLinejoin='round'+ className=' rotate-180 w-4 h-4'+ ><polyline points='18 15 12 9 6 15' /></svg></button>@@ -69,25 +114,36 @@ const MultiSelect = ({<div className=' shadow top-100 bg-white dark:bg-slate-800 z-40 w-full lef-0 rounded max-h-select overflow-y-auto overflow-x-hidden max-h-[200px]'><div className='flex flex-col w-full'>{onSearch && (- <div className='relative cursor-pointer w-full border-gray-100 dark:border-slate-700 rounded-t border-b hover:bg-indigo-100 dark:hover:bg-slate-700'>- <input- className='overflow-x-auto flex w-full items-center p-2 pl-2 bg-white dark:bg-slate-800 border-transparent border-l-2 relative hover:border-b-indigo-100 dark:hover:border-b-slate-700 focus:outline-none focus:border-transparent focus:ring-0 focus:box-shadow-none'- placeholder={searchPlaseholder}- onChange={(e) => {- e.preventDefault()- e.stopPropagation()- onSearch(e.target.value || '')- }}- type='text'- />- <MagnifyingGlassIcon className='absolute right-2 top-[0.7rem] h-5 w-5 text-gray-400 dark:text-gray-300' aria-hidden='true' />- </div>+ <div className='relative cursor-pointer w-full border-gray-100 dark:border-slate-700 rounded-t border-b hover:bg-indigo-100 dark:hover:bg-slate-700'>+ <input+ className='overflow-x-auto flex w-full items-center p-2 pl-2 bg-white dark:bg-slate-800 border-transparent border-l-2 relative hover:border-b-indigo-100 dark:hover:border-b-slate-700 focus:outline-none focus:border-transparent focus:ring-0 focus:box-shadow-none'+ placeholder={searchPlaseholder}+ onChange={(e) => {+ e.preventDefault()+ e.stopPropagation()+ onSearch(e.target.value || '')+ }}+ type='text'+ />+ <MagnifyingGlassIcon+ className='absolute right-2 top-[0.7rem] h-5 w-5 text-gray-400 dark:text-gray-300'+ aria-hidden='true'+ />+ </div>)}{_map(items, (item) => (- <div key={keyExtractor ? `${keyExtractor(item)}select` : `${item}select`} onClick={() => onSelect(item)} className='cursor-pointer w-full border-gray-100 dark:border-slate-500 rounded-t border-b hover:bg-indigo-100 dark:hover:bg-slate-700'>- <div className={cx('overflow-x-auto flex w-full items-center p-2 pl-2 border-transparent border-l-2 relative hover:border-indigo-100 dark:hover:border-slate-700', {- '!border-indigo-500 border-l-2 dark:!border-slate-400': _includes(label, item),- })}+ <div+ key={keyExtractor ? `${keyExtractor(item)}select` : `${item}select`}+ onClick={() => onSelect(item)}+ className='cursor-pointer w-full border-gray-100 dark:border-slate-500 rounded-t border-b hover:bg-indigo-100 dark:hover:bg-slate-700'+ >+ <div+ className={cx(+ 'overflow-x-auto flex w-full items-center p-2 pl-2 border-transparent border-l-2 relative hover:border-indigo-100 dark:hover:border-slate-700',+ {+ '!border-indigo-500 border-l-2 dark:!border-slate-400': _includes(label, item),+ },+ )}><div className='w-full items-center flex break-words'><div className='mx-2 leading-6 flex'>{itemExtractor ? itemExtractor(item) : item}</div>@@ -100,9 +156,7 @@ const MultiSelect = ({)}</div></div>- {hint && (- <p className='mt-2 text-sm text-gray-500 dark:text-gray-300 whitespace-pre-line'>{hint}</p>- )}+ {hint && <p className='mt-2 text-sm text-gray-500 dark:text-gray-300 whitespace-pre-line'>{hint}</p>}</div>)}diff --git a/app/ui/Pagination.tsx b/app/ui/Pagination.tsxindex 459e264ae..b5a7c2ad2 100644--- a/app/ui/Pagination.tsx+++ b/app/ui/Pagination.tsx@@ -7,75 +7,78 @@ import PropTypes from 'prop-types'import { usePagination, DOTS } from 'hooks/usePagination'interface IPagination {- page: number,- setPage: (item: number) => void,- pageAmount: number,- total: number,- className?: string,+ page: number+ setPage: (item: number) => void+ pageAmount: number+ total: number+ className?: string}-const Pagination = ({- page, setPage, pageAmount, total, className,-}: IPagination): JSX.Element => {+const Pagination = ({ page, setPage, pageAmount, total, className }: IPagination): JSX.Element => {const { t } = useTranslation('common')const paginationRange = usePagination(total, page)return (<nav className={cx('border-t-0 border-gray-200 px-4 flex items-center justify-between sm:px-0', className)}><div className='-mt-px w-0 flex-1 flex group'>- {- page > 1 && (- <button- type='button'- onClick={() => setPage(page - 1)}- className='pt-4 pr-1 inline-flex items-center text-sm font-medium dark:group-hover:text-gray-400 group-hover:text-gray-700 dark:text-gray-300 text-gray-500'- >- <ArrowLongLeftIcon className='mr-3 h-5 w-5 dark:group-hover:text-gray-400 group-hover:text-gray-700 dark:text-gray-300 text-gray-500 transition-none' aria-hidden='true' />- { t('project.prev') }- </button>- )- }+ {page > 1 && (+ <button+ type='button'+ onClick={() => setPage(page - 1)}+ className='pt-4 pr-1 inline-flex items-center text-sm font-medium dark:group-hover:text-gray-400 group-hover:text-gray-700 dark:text-gray-300 text-gray-500'+ >+ <ArrowLongLeftIcon+ className='mr-3 h-5 w-5 dark:group-hover:text-gray-400 group-hover:text-gray-700 dark:text-gray-300 text-gray-500 transition-none'+ aria-hidden='true'+ />+ {t('project.prev')}+ </button>+ )}</div><div className='hidden md:-mt-px md:flex'>- {- _map(paginationRange, (item, index) => {- if (item === DOTS) {- return (- <span className='border-transparent text-gray-500 dark:text-gray-300 border-t-2 pt-4 px-4 inline-flex items-center text-sm font-medium' key={item + index}>- { DOTS }- </span>- )- }-+ {_map(paginationRange, (item, index) => {+ if (item === DOTS) {return (- <button- key={item}- type='button'- onClick={() => setPage(item)}- className={cx({- 'border-slate-900 text-slate-900 dark:text-gray-50 dark:border-gray-50 border-t-2 pt-4 px-4 inline-flex items-center text-sm font-medium': item === page,- 'border-transparent text-gray-500 dark:text-gray-300 hover:text-gray-700 dark:hover:text-gray-400 hover:border-gray-300 border-t-2 pt-4 px-4 inline-flex items-center text-sm font-medium': item !== page,- })}+ <span+ className='border-transparent text-gray-500 dark:text-gray-300 border-t-2 pt-4 px-4 inline-flex items-center text-sm font-medium'+ key={item + index}>- {item}- </button>+ {DOTS}+ </span>)- })- }- </div>- <div className='-mt-px w-0 flex-1 flex justify-end group'>- {- page !== pageAmount && (+ }++ return (<button+ key={item}type='button'- onClick={() => setPage(page + 1)}- className='pt-4 pl-1 inline-flex items-center text-sm font-medium dark:group-hover:text-gray-400 group-hover:text-gray-700 dark:text-gray-300 text-gray-500'+ onClick={() => setPage(item)}+ className={cx({+ 'border-slate-900 text-slate-900 dark:text-gray-50 dark:border-gray-50 border-t-2 pt-4 px-4 inline-flex items-center text-sm font-medium':+ item === page,+ 'border-transparent text-gray-500 dark:text-gray-300 hover:text-gray-700 dark:hover:text-gray-400 hover:border-gray-300 border-t-2 pt-4 px-4 inline-flex items-center text-sm font-medium':+ item !== page,+ })}>- { t('project.next') }- <ArrowLongRightIcon className='ml-3 h-5 w-5 dark:group-hover:text-gray-400 group-hover:text-gray-700 dark:text-gray-300 text-gray-500 transition-none' aria-hidden='true' />+ {item}</button>)- }+ })}+ </div>+ <div className='-mt-px w-0 flex-1 flex justify-end group'>+ {page !== pageAmount && (+ <button+ type='button'+ onClick={() => setPage(page + 1)}+ className='pt-4 pl-1 inline-flex items-center text-sm font-medium dark:group-hover:text-gray-400 group-hover:text-gray-700 dark:text-gray-300 text-gray-500'+ >+ {t('project.next')}+ <ArrowLongRightIcon+ className='ml-3 h-5 w-5 dark:group-hover:text-gray-400 group-hover:text-gray-700 dark:text-gray-300 text-gray-500 transition-none'+ aria-hidden='true'+ />+ </button>+ )}</div></nav>)diff --git a/app/ui/Progress.tsx b/app/ui/Progress.tsxindex 5e0388550..03758f336 100644--- a/app/ui/Progress.tsx+++ b/app/ui/Progress.tsx@@ -2,13 +2,16 @@ import React, { memo } from 'react'import PropTypes from 'prop-types'interface IProgress {- now: number,+ now: number}const Progress = ({ now }: IProgress): JSX.Element => (<div className='relative' data-testid='progress'><div className='overflow-hidden h-2 text-xs flex rounded bg-blue-200 dark:bg-slate-600'>- <div style={{ width: `${now}%` }} className='shadow-none flex flex-col text-center whitespace-nowrap text-white justify-center bg-blue-500 dark:bg-blue-700' />+ <div+ style={{ width: `${now}%` }}+ className='shadow-none flex flex-col text-center whitespace-nowrap text-white justify-center bg-blue-500 dark:bg-blue-700'+ /></div></div>)diff --git a/app/ui/Select.tsx b/app/ui/Select.tsxindex 5e0b73fba..4569e8722 100644--- a/app/ui/Select.tsx+++ b/app/ui/Select.tsx@@ -6,40 +6,55 @@ import { CheckIcon, ChevronUpDownIcon } from '@heroicons/react/24/solid'import _map from 'lodash/map'interface ISelect {- title?: string,- label: string,- className?: string,- labelClassName?: string,- buttonClassName?: string,- capitalise?: boolean,- items: any[],- id?: string,- labelExtractor?: (item: any, index: number) => string,- keyExtractor?: (item: any, index: number) => string,- iconExtractor?: (item: any, index: number) => JSX.Element | null,- onSelect: (item: any) => void,+ title?: string+ label: string+ className?: string+ labelClassName?: string+ buttonClassName?: string+ capitalise?: boolean+ items: any[]+ id?: string+ labelExtractor?: (item: any, index: number) => string+ keyExtractor?: (item: any, index: number) => string+ iconExtractor?: (item: any, index: number) => JSX.Element | null+ onSelect: (item: any) => void}const Select = ({- title, label, className, items, labelExtractor, keyExtractor, iconExtractor, onSelect, id,- buttonClassName, capitalise, labelClassName,+ title,+ label,+ className,+ items,+ labelExtractor,+ keyExtractor,+ iconExtractor,+ onSelect,+ id,+ buttonClassName,+ capitalise,+ labelClassName,}: ISelect): JSX.Element => (// @ts-ignore<Listbox id={id || ''} value={title} onChange={onSelect}>{({ open }) => (<>- <Listbox.Label className='block text-sm whitespace-pre-line font-medium text-gray-700 dark:text-gray-100'>{label}</Listbox.Label>+ <Listbox.Label className='block text-sm whitespace-pre-line font-medium text-gray-700 dark:text-gray-100'>+ {label}+ </Listbox.Label><div className={cx('mt-1 relative', className)}><Listbox.Button- className={cx('relative w-full bg-white border border-gray-300 dark:text-gray-50 dark:border-gray-800 dark:bg-slate-800 rounded-md shadow-sm pl-3 pr-10 py-2 text-left cursor-default focus:outline-none focus:ring-1 focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm', buttonClassName)}+ className={cx(+ 'relative w-full bg-white border border-gray-300 dark:text-gray-50 dark:border-gray-800 dark:bg-slate-800 rounded-md shadow-sm pl-3 pr-10 py-2 text-left cursor-default focus:outline-none focus:ring-1 focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm',+ buttonClassName,+ )}><spanclassName={cx('block truncate', {'first-letter:capitalize': capitalise,})}>- {title}- </span>+ {title}+ </span><span className='absolute inset-y-0 right-0 flex items-center pr-2 pointer-events-none'><ChevronUpDownIcon className='h-5 w-5 text-gray-400' aria-hidden='true' /></span>@@ -59,28 +74,32 @@ const Select = ({{_map(items, (item, index) => (<Listbox.Optionkey={keyExtractor ? keyExtractor(item, index) : item}- className={({ active }) => cx('dark:text-white cursor-default select-none relative py-2 pl-8 pr-4', {- 'text-white bg-indigo-600': active,- 'text-gray-900': !active,- })}+ className={({ active }) =>+ cx('dark:text-white cursor-default select-none relative py-2 pl-8 pr-4', {+ 'text-white bg-indigo-600': active,+ 'text-gray-900': !active,+ })+ }value={labelExtractor ? labelExtractor(item, index) : item}>{({ selected, active }) => (<><span- className={cx('block truncate', {- 'font-semibold': selected,- 'font-normal': !selected,- 'first-letter:capitalize': capitalise,- }, labelClassName)}+ className={cx(+ 'block truncate',+ {+ 'font-semibold': selected,+ 'font-normal': !selected,+ 'first-letter:capitalize': capitalise,+ },+ labelClassName,+ )}>{labelExtractor ? labelExtractor(item, index) : item}</span>{iconExtractor && (- <span- className={cx('absolute inset-y-0 left-0 flex items-center pl-1.5')}- >+ <span className={cx('absolute inset-y-0 left-0 flex items-center pl-1.5')}>{iconExtractor(item, index)}</span>)}@@ -110,9 +129,7 @@ const Select = ({Select.propTypes = {title: PropTypes.string.isRequired,onSelect: PropTypes.func.isRequired,- items: PropTypes.arrayOf(PropTypes.oneOfType([- PropTypes.string, PropTypes.object,- ])),+ items: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.object])),className: PropTypes.string,labelClassName: PropTypes.string,buttonClassName: PropTypes.string,diff --git a/app/ui/Textarea.tsx b/app/ui/Textarea.tsxindex 47ea48b4d..6382d5fa9 100644--- a/app/ui/Textarea.tsx+++ b/app/ui/Textarea.tsx@@ -6,22 +6,33 @@ import { ExclamationCircleIcon } from '@heroicons/react/24/solid'import Beta from 'ui/Beta'interface ITextarea {- value: string | number,- label?: string,- hint?: string,- placeholder?: string,- onChange?: (e: React.ChangeEvent<HTMLTextAreaElement>) => void,- id?: string,- type?: string,- className?: string,- error?: string | boolean,- name?: string,- disabled?: boolean,- isBeta?: boolean,+ value: string | number+ label?: string+ hint?: string+ placeholder?: string+ onChange?: (e: React.ChangeEvent<HTMLTextAreaElement>) => void+ id?: string+ type?: string+ className?: string+ error?: string | boolean+ name?: string+ disabled?: boolean+ isBeta?: boolean}const Textarea = ({- label, hint, placeholder, type, id, name, className, onChange, error, value, disabled, isBeta,+ label,+ hint,+ placeholder,+ type,+ id,+ name,+ className,+ onChange,+ error,+ value,+ disabled,+ isBeta,}: ITextarea) => {const identifier = `textarea-${id || name || type}`const isError = !_isEmpty(error)@@ -43,10 +54,13 @@ const Textarea = ({rows={4}name={identifier}id={identifier}- className={cx('shadow-sm focus:ring-indigo-500 focus:border-indigo-500 block w-full sm:text-sm border-gray-300 dark:text-gray-50 dark:placeholder-gray-400 dark:border-slate-800/25 dark:bg-slate-800 rounded-md', {- 'border-red-300 text-red-900 placeholder-red-300': isError,- 'cursor-text': disabled,- })}+ className={cx(+ 'shadow-sm focus:ring-indigo-500 focus:border-indigo-500 block w-full sm:text-sm border-gray-300 dark:text-gray-50 dark:placeholder-gray-400 dark:border-slate-800/25 dark:bg-slate-800 rounded-md',+ {+ 'border-red-300 text-red-900 placeholder-red-300': isError,+ 'cursor-text': disabled,+ },+ )}value={value}onChange={onChange}placeholder={placeholder}@@ -58,18 +72,20 @@ const Textarea = ({</div>)}</div>- <p className='mt-2 text-sm text-gray-500 dark:text-gray-300 whitespace-pre-line' id={`${identifier}-optional`}>{hint}</p>+ <p className='mt-2 text-sm text-gray-500 dark:text-gray-300 whitespace-pre-line' id={`${identifier}-optional`}>+ {hint}+ </p>{isError && (- <p className='mt-2 text-sm text-red-600 dark:text-red-500' id='email-error'>{error}</p>+ <p className='mt-2 text-sm text-red-600 dark:text-red-500' id='email-error'>+ {error}+ </p>)}</div>)}Textarea.propTypes = {- value: PropTypes.oneOfType([- PropTypes.string, PropTypes.number,- ]).isRequired,+ value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,label: PropTypes.string,hint: PropTypes.string,placeholder: PropTypes.string,@@ -77,9 +93,7 @@ Textarea.propTypes = {id: PropTypes.string,type: PropTypes.string,className: PropTypes.string,- error: PropTypes.oneOfType([- PropTypes.string, PropTypes.bool,- ]),+ error: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),name: PropTypes.string,disabled: PropTypes.bool,isBeta: PropTypes.bool,@@ -89,7 +103,7 @@ Textarea.defaultProps = {label: '',hint: '',placeholder: '',- onChange: () => { },+ onChange: () => {},id: '',type: '',className: '',diff --git a/app/ui/TimezonePicker.tsx b/app/ui/TimezonePicker.tsxindex 9b852cbca..e76a878fd 100644--- a/app/ui/TimezonePicker.tsx+++ b/app/ui/TimezonePicker.tsx@@ -36,50 +36,51 @@ const options = _reduce(return selectOptions},[],-)- .sort((a, b) => a.offset - b.offset)+).sort((a, b) => a.offset - b.offset)interface ITimezoneSelect {- value: string | {- value: string,- label: string,- },- onChange: (item: string) => void,+ value:+ | string+ | {+ value: string+ label: string+ }+ onChange: (item: string) => void}-const TimezoneSelect = ({- value, onChange,-}: ITimezoneSelect): JSX.Element => {- const { t }: {- t: (key: string) => string,+const TimezoneSelect = ({ value, onChange }: ITimezoneSelect): JSX.Element => {+ const {+ t,+ }: {+ t: (key: string) => string} = useTranslation('common')- const labelExtractor = (option: {- label: string,- }) => option?.label- const keyExtractor = (option: {- value: string,- }) => option?.value+ const labelExtractor = (option: { label: string }) => option?.label+ const keyExtractor = (option: { value: string }) => option?.valueconst handleChange = (label: string) => {- const tz = _find(options, timezone => labelExtractor(timezone) === label)+ const tz = _find(options, (timezone) => labelExtractor(timezone) === label)const key = keyExtractor(tz)onChange(key)}- const parseTimezone = (zone: string | {- value: string,- label: string,- }) => {+ const parseTimezone = (+ zone:+ | string+ | {+ value: string+ label: string+ },+ ) => {if (typeof zone === 'object' && zone.value && zone.label) {return zone}if (typeof zone === 'string') {- return _find(options, tz => tz.value === zone)+ return _find(options, (tz) => tz.value === zone)}if (zone.value && !zone.label) {- return _find(options, tz => tz.value === zone.value)+ return _find(options, (tz) => tz.value === zone.value)}return null@@ -100,14 +101,12 @@ const TimezoneSelect = ({}TimezoneSelect.propTypes = {- value: PropTypes.oneOfType([- PropTypes.string, PropTypes.object,- ]).isRequired,+ value: PropTypes.oneOfType([PropTypes.string, PropTypes.object]).isRequired,onChange: PropTypes.func,}TimezoneSelect.defaultProps = {- onChange: () => { },+ onChange: () => {},}export default TimezoneSelectdiff --git a/app/ui/Tooltip.tsx b/app/ui/Tooltip.tsxindex eeaff401b..e7ced6495 100644--- a/app/ui/Tooltip.tsx+++ b/app/ui/Tooltip.tsx@@ -4,14 +4,12 @@ import { QuestionMarkCircleIcon } from '@heroicons/react/24/solid'import cx from 'clsx'interface ITooltip {- text: string | number | React.ReactNode,- className?: string,- tooltipNode?: JSX.Element,+ text: string | number | React.ReactNode+ className?: string+ tooltipNode?: JSX.Element}-const Tooltip = ({- text, className, tooltipNode,-}: ITooltip): JSX.Element => (+const Tooltip = ({ text, className, tooltipNode }: ITooltip): JSX.Element => (<div className={cx('relative flex flex-col group items-center', className)} data-testid='tooltip-wrapper'>{tooltipNode || (<QuestionMarkCircleIcon className='w-5 h-5 text-gray-700 dark:text-gray-300' data-testid='tooltip-icon' />@@ -26,9 +24,7 @@ const Tooltip = ({)Tooltip.propTypes = {- text: PropTypes.oneOfType([- PropTypes.string, PropTypes.number, PropTypes.node,- ]).isRequired,+ text: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.node]).isRequired,className: PropTypes.string,tooltipNode: PropTypes.node,}diff --git a/app/ui/__test__/Button.test.tsx b/app/ui/__test__/Button.test.tsxindex c298b5f13..6e1ce09f2 100644--- a/app/ui/__test__/Button.test.tsx+++ b/app/ui/__test__/Button.test.tsx@@ -12,7 +12,11 @@ describe('Button component', () => {})it('renders with children', () => {- const { getByText } = render(<Button><span>Click me</span></Button>)+ const { getByText } = render(+ <Button>+ <span>Click me</span>+ </Button>,+ )expect(getByText('Click me')).toBeInTheDocument()})diff --git a/app/ui/__test__/Checkbox.test.tsx b/app/ui/__test__/Checkbox.test.tsxindex 1b667eba9..c547ee8ab 100644--- a/app/ui/__test__/Checkbox.test.tsx+++ b/app/ui/__test__/Checkbox.test.tsx@@ -12,17 +12,13 @@ describe('Checkbox', () => {})test('renders a checkbox with a custom id', () => {- const { getByRole } = render(- <Checkbox id='custom-id' label='Checkbox' checked />,- )+ const { getByRole } = render(<Checkbox id='custom-id' label='Checkbox' checked />)expect(getByRole('checkbox')).toHaveAttribute('id', 'custom-id')})test('clicking the checkbox calls the onChange handler', () => {const onChange = jest.fn()- const { getByRole } = render(- <Checkbox label='Checkbox' checked onChange={onChange} />,- )+ const { getByRole } = render(<Checkbox label='Checkbox' checked onChange={onChange} />)fireEvent.click(getByRole('checkbox'))expect(onChange).toHaveBeenCalled()})diff --git a/app/ui/__test__/Modal.test.tsx b/app/ui/__test__/Modal.test.tsxindex 1411fcf09..400417527 100644--- a/app/ui/__test__/Modal.test.tsx+++ b/app/ui/__test__/Modal.test.tsx@@ -11,11 +11,11 @@ global.ResizeObserver = require('resize-observer-polyfill')describe('Modal component', () => {const defaultProps: {- type: 'error' | 'success' | 'info' | 'warning' | 'confirmed',- title: string,- message: string,- isOpened: boolean,- onClose: () => void,+ type: 'error' | 'success' | 'info' | 'warning' | 'confirmed'+ title: string+ message: string+ isOpened: boolean+ onClose: () => void} = {type: 'success',title: 'Success',@@ -50,17 +50,13 @@ describe('Modal component', () => {})it('renders with default props', () => {- const { getByText } = render(- <HocWithI18n {...defaultProps} />,- )+ const { getByText } = render(<HocWithI18n {...defaultProps} />)expect(getByText('Success')).toBeInTheDocument()expect(getByText('Action completed successfully')).toBeInTheDocument()})it('calls onClose when close button is clicked', () => {- const { getByText } = render(- <HocWithI18n {...defaultProps} closeText='Close' />,- )+ const { getByText } = render(<HocWithI18n {...defaultProps} closeText='Close' />)const closeButton = getByText('Close')fireEvent.click(closeButton)expect(defaultProps.onClose).toHaveBeenCalled()@@ -68,9 +64,7 @@ describe('Modal component', () => {it('calls onSubmit when submit button is clicked', () => {const onSubmit = jest.fn()- const { getByText } = render(- <HocWithI18n {...defaultProps} onSubmit={onSubmit} submitText='Submit' />,- )+ const { getByText } = render(<HocWithI18n {...defaultProps} onSubmit={onSubmit} submitText='Submit' />)const submitButton = getByText('Submit')fireEvent.click(submitButton)expect(onSubmit).toHaveBeenCalled()@@ -78,16 +72,12 @@ describe('Modal component', () => {it('renders custom buttons', () => {const customButtons = <button type='button'>Custom Button</button>- const { getByText } = render(- <HocWithI18n {...defaultProps} customButtons={customButtons} />,- )+ const { getByText } = render(<HocWithI18n {...defaultProps} customButtons={customButtons} />)expect(getByText('Custom Button')).toBeInTheDocument()})it('renders beta badge when isBeta prop is true', () => {- const { getByText } = render(- <HocWithI18n {...defaultProps} isBeta />,- )+ const { getByText } = render(<HocWithI18n {...defaultProps} isBeta />)expect(getByText('beta.title')).toBeInTheDocument()})})diff --git a/app/ui/__test__/Pagination.test.tsx b/app/ui/__test__/Pagination.test.tsxindex 0fbb02562..d6ac02972 100644--- a/app/ui/__test__/Pagination.test.tsx+++ b/app/ui/__test__/Pagination.test.tsx@@ -9,10 +9,10 @@ import Pagination from '../Pagination'describe('Pagination', () => {let defaultProps: {- page: number,- setPage: (item: number) => void,- pageAmount: number,- total: number,+ page: number+ setPage: (item: number) => void+ pageAmount: number+ total: number} = {page: 1,setPage: () => {@@ -57,9 +57,7 @@ describe('Pagination', () => {})it('renders with default props', () => {- const { getByText } = render(- <HocWithI18n {...defaultProps} />,- )+ const { getByText } = render(<HocWithI18n {...defaultProps} />)expect(getByText('1')).toBeInTheDocument()expect(getByText('10')).toBeInTheDocument()expect(getByText('project.next')).toBeInTheDocument()@@ -67,9 +65,7 @@ describe('Pagination', () => {it('renders on page > 1', () => {defaultProps.page = 2- const { getByText } = render(- <HocWithI18n {...defaultProps} />,- )+ const { getByText } = render(<HocWithI18n {...defaultProps} />)expect(getByText('1')).toBeInTheDocument()expect(getByText('10')).toBeInTheDocument()expect(getByText('project.prev')).toBeInTheDocument()@@ -78,9 +74,7 @@ describe('Pagination', () => {it('renders on page > 1 and page < pageAmount', () => {defaultProps.page = 5- const { getByText } = render(- <HocWithI18n {...defaultProps} />,- )+ const { getByText } = render(<HocWithI18n {...defaultProps} />)expect(getByText('1')).toBeInTheDocument()expect(getByText('10')).toBeInTheDocument()expect(getByText('project.prev')).toBeInTheDocument()@@ -89,9 +83,7 @@ describe('Pagination', () => {it('renders on page = pageAmount', () => {defaultProps.page = 10- const { getByText } = render(- <HocWithI18n {...defaultProps} />,- )+ const { getByText } = render(<HocWithI18n {...defaultProps} />)expect(getByText('1')).toBeInTheDocument()expect(getByText('10')).toBeInTheDocument()expect(getByText('project.prev')).toBeInTheDocument()@@ -100,9 +92,7 @@ describe('Pagination', () => {it('renders on page = pageAmount and pageAmount < total', () => {defaultProps.page = 10defaultProps.total = 101- const { getByText } = render(- <HocWithI18n {...defaultProps} />,- )+ const { getByText } = render(<HocWithI18n {...defaultProps} />)expect(getByText('1')).toBeInTheDocument()expect(getByText('9')).toBeInTheDocument()expect(getByText('project.prev')).toBeInTheDocument()diff --git a/app/ui/__test__/Select.test.tsx b/app/ui/__test__/Select.test.tsxindex 2cf843a12..5d766a656 100644--- a/app/ui/__test__/Select.test.tsx+++ b/app/ui/__test__/Select.test.tsx@@ -8,16 +8,16 @@ import Select from '../Select'describe('Select', () => {const defaultProps: {- title: string,- label: string,- className?: string,- items: any[],- id?: string,- labelExtractor?: (item: any, index: number) => string,- keyExtractor?: (item: any, index: number) => string,- iconExtractor?: (item: any, index: number) => JSX.Element | null,- onSelect: (item: any) => void,- capitalise: boolean,+ title: string+ label: string+ className?: string+ items: any[]+ id?: string+ labelExtractor?: (item: any, index: number) => string+ keyExtractor?: (item: any, index: number) => string+ iconExtractor?: (item: any, index: number) => JSX.Element | null+ onSelect: (item: any) => void+ capitalise: boolean} = {title: 'Select Title',label: 'Select',diff --git a/app/ui/__test__/TimezonePicker.test.tsx b/app/ui/__test__/TimezonePicker.test.tsxindex 13ce677ce..7d175e1f6 100644--- a/app/ui/__test__/TimezonePicker.test.tsx+++ b/app/ui/__test__/TimezonePicker.test.tsx@@ -40,9 +40,7 @@ describe('TimezonePricker', () => {})it('calls onChange function when an option is selected', () => {- const { getByText, getByRole } = render(- <HocWithI18n value='Europe/London' onChange={onChange} />,- )+ const { getByText, getByRole } = render(<HocWithI18n value='Europe/London' onChange={onChange} />)fireEvent.click(getByRole('button'))diff --git a/app/ui/__test__/Tooltip.test.tsx b/app/ui/__test__/Tooltip.test.tsxindex c7a2f0568..996ad7ce2 100644--- a/app/ui/__test__/Tooltip.test.tsx+++ b/app/ui/__test__/Tooltip.test.tsx@@ -8,9 +8,7 @@ import Tooltip from '../Tooltip'describe('Tooltip', () => {it('should render the tooltip text when hovering over the icon', () => {const text = 'This is a tooltip'- const { getByTestId, getByText } = render(- <Tooltip text={text} />,- )+ const { getByTestId, getByText } = render(<Tooltip text={text} />)const tooltipIcon = getByTestId('tooltip-icon')fireEvent.mouseEnter(tooltipIcon)const tooltipText = getByText(text)@@ -19,18 +17,14 @@ describe('Tooltip', () => {it('should render a custom tooltip icon when provided', () => {const CustomIcon = () => <div data-testid='custom-icon' />- const { getByTestId } = render(- <Tooltip tooltipNode={<CustomIcon />} text='dds' />,- )+ const { getByTestId } = render(<Tooltip tooltipNode={<CustomIcon />} text='dds' />)const customIcon = getByTestId('custom-icon')expect(customIcon).toBeInTheDocument()})it('should render a custom class name when provided', () => {const className = 'custom-class'- const { getByTestId } = render(- <Tooltip text='Tooltip' className={className} />,- )+ const { getByTestId } = render(<Tooltip text='Tooltip' className={className} />)const tooltipWrapper = getByTestId('tooltip-wrapper')expect(tooltipWrapper).toHaveClass(className)})diff --git a/app/ui/icons/Angular.tsx b/app/ui/icons/Angular.tsxindex e9965e8b4..eb4d55feb 100644--- a/app/ui/icons/Angular.tsx+++ b/app/ui/icons/Angular.tsx@@ -1,23 +1,22 @@import React from 'react'import PropTypes from 'prop-types'-const Angular = ({ className }: {- className?: string,-}): JSX.Element => (- <svg- className={className}- x='0px'- y='0px'- viewBox='0 0 250 250'- xmlSpace='preserve'- >- <title>- Angular- </title>+const Angular = ({ className }: { className?: string }): JSX.Element => (+ <svg className={className} x='0px' y='0px' viewBox='0 0 250 250' xmlSpace='preserve'>+ <title>Angular</title><g>- <polygon className='fill-[#DD0031]' points='125,30 125,30 125,30 31.9,63.2 46.1,186.3 125,230 125,230 125,230 203.9,186.3 218.1,63.2 ' />- <polygon className='fill-[#C3002F]' points='125,30 125,52.2 125,52.1 125,153.4 125,153.4 125,230 125,230 203.9,186.3 218.1,63.2 125,30 ' />- <path className='fill-[#FFFFFF]' d='M125,52.1L66.8,182.6h0h21.7h0l11.7-29.2h49.4l11.7,29.2h0h21.7h0L125,52.1L125,52.1L125,52.1L125,52.1 L125,52.1z M142,135.4H108l17-40.9L142,135.4z' />+ <polygon+ className='fill-[#DD0031]'+ points='125,30 125,30 125,30 31.9,63.2 46.1,186.3 125,230 125,230 125,230 203.9,186.3 218.1,63.2 '+ />+ <polygon+ className='fill-[#C3002F]'+ points='125,30 125,52.2 125,52.1 125,153.4 125,153.4 125,230 125,230 203.9,186.3 218.1,63.2 125,30 '+ />+ <path+ className='fill-[#FFFFFF]'+ d='M125,52.1L66.8,182.6h0h21.7h0l11.7-29.2h49.4l11.7,29.2h0h21.7h0L125,52.1L125,52.1L125,52.1L125,52.1 L125,52.1z M142,135.4H108l17-40.9L142,135.4z'+ /></g></svg>)diff --git a/app/ui/icons/BackgroundSvg.tsx b/app/ui/icons/BackgroundSvg.tsxindex c12d8fb83..9822ab6f9 100644--- a/app/ui/icons/BackgroundSvg.tsx+++ b/app/ui/icons/BackgroundSvg.tsx@@ -9,17 +9,34 @@ interface IBackgroundSvg {theme: 'dark' | 'light'}-const BackgroundSvg: React.FC<IBackgroundSvg> = ({- className, type, children, theme,-}): JSX.Element => {+const BackgroundSvg: React.FC<IBackgroundSvg> = ({ className, type, children, theme }): JSX.Element => {if (type === 'shapes') {return (- <svg className={className} width='112' height='112' viewBox='0 0 112 112' fill='none' xmlns='http://www.w3.org/2000/svg'>+ <svg+ className={className}+ width='112'+ height='112'+ viewBox='0 0 112 112'+ fill='none'+ xmlns='http://www.w3.org/2000/svg'+ ><g opacity='0.3'>- <path d='M96.9136 36.5354L110.571 36.3167L109.988 -0.000432262L73.6711 0.581055L73.8887 14.1353L96.5481 13.7725L96.9136 36.5354Z' fill={cx({ '#E4E4E4': theme === 'light', '#576780': theme === 'dark' })} />- <path d='M72.7847 61.4494L86.339 61.2324L85.7559 24.9153L49.5422 25.4951L49.7615 39.1528L72.4209 38.79L72.7847 61.4494Z' fill={cx({ '#E4E4E4': theme === 'light', '#576780': theme === 'dark' })} />- <path d='M48.5526 86.3665L62.2104 86.1478L61.6289 49.9341L25.3118 50.5156L25.5294 64.0699L48.1888 63.7071L48.5526 86.3665Z' fill={cx({ '#E4E4E4': theme === 'light', '#576780': theme === 'dark' })} />- <path d='M24.4254 111.385L38.0832 111.167L37.5001 74.8497L1.18292 75.4312L1.40221 89.0889L24.0616 88.7261L24.4254 111.385Z' fill={cx({ '#E4E4E4': theme === 'light', '#576780': theme === 'dark' })} />+ <path+ d='M96.9136 36.5354L110.571 36.3167L109.988 -0.000432262L73.6711 0.581055L73.8887 14.1353L96.5481 13.7725L96.9136 36.5354Z'+ fill={cx({ '#E4E4E4': theme === 'light', '#576780': theme === 'dark' })}+ />+ <path+ d='M72.7847 61.4494L86.339 61.2324L85.7559 24.9153L49.5422 25.4951L49.7615 39.1528L72.4209 38.79L72.7847 61.4494Z'+ fill={cx({ '#E4E4E4': theme === 'light', '#576780': theme === 'dark' })}+ />+ <path+ d='M48.5526 86.3665L62.2104 86.1478L61.6289 49.9341L25.3118 50.5156L25.5294 64.0699L48.1888 63.7071L48.5526 86.3665Z'+ fill={cx({ '#E4E4E4': theme === 'light', '#576780': theme === 'dark' })}+ />+ <path+ d='M24.4254 111.385L38.0832 111.167L37.5001 74.8497L1.18292 75.4312L1.40221 89.0889L24.0616 88.7261L24.4254 111.385Z'+ fill={cx({ '#E4E4E4': theme === 'light', '#576780': theme === 'dark' })}+ /></g></svg>)@@ -27,11 +44,27 @@ const BackgroundSvg: React.FC<IBackgroundSvg> = ({if (type === 'circle') {return (- <svg className={className} width='117' height='284' viewBox='0 0 117 284' fill='none' xmlns='http://www.w3.org/2000/svg'>+ <svg+ className={className}+ width='117'+ height='284'+ viewBox='0 0 117 284'+ fill='none'+ xmlns='http://www.w3.org/2000/svg'+ ><g opacity='0.2' clipPath='url(#clip0_180_2875)'>- <path d='M142.097 0C63.5443 0 0 63.5443 0 142.097C0 220.456 63.5443 284.195 142.097 284.195C220.456 284.195 284.195 220.651 284.195 142.097C284 63.5443 220.456 0 142.097 0ZM142.097 275.034C68.6122 275.034 9.16129 215.583 9.16129 142.097C9.16129 68.6122 68.6122 9.16129 142.097 9.16129C215.583 9.16129 275.034 68.6122 275.034 142.097C275.034 215.388 215.388 275.034 142.097 275.034Z' fill={cx({ '#E4E4E4': theme === 'light', '#576780': theme === 'dark' })} />- <path d='M142.099 30.6025C80.6984 30.6025 30.7986 80.5023 30.7986 141.902C30.7986 203.303 80.6984 253.202 142.099 253.202C203.499 253.202 253.398 203.498 253.398 142.097C253.398 80.5023 203.499 30.6025 142.099 30.6025ZM142.099 236.244C90.0546 236.244 47.7567 193.946 47.7567 141.902C47.7567 89.8585 90.0546 47.5607 142.099 47.5607C194.142 47.5607 236.44 89.8585 236.44 141.902C236.44 193.946 194.142 236.244 142.099 236.244Z' fill={cx({ '#E4E4E4': theme === 'light', '#576780': theme === 'dark' })} />- <path d='M142.098 79.5278C107.597 79.5278 79.5284 107.596 79.5284 142.097C79.5284 176.598 107.402 204.667 142.098 204.667C176.599 204.667 204.668 176.598 204.668 142.097C204.473 107.596 176.599 79.5278 142.098 79.5278ZM142.098 175.624C123.581 175.624 108.572 160.615 108.572 142.097C108.572 123.58 123.581 108.571 142.098 108.571C160.616 108.571 175.624 123.58 175.624 142.097C175.624 160.615 160.616 175.624 142.098 175.624Z' fill={cx({ '#E4E4E4': theme === 'light', '#576780': theme === 'dark' })} />+ <path+ d='M142.097 0C63.5443 0 0 63.5443 0 142.097C0 220.456 63.5443 284.195 142.097 284.195C220.456 284.195 284.195 220.651 284.195 142.097C284 63.5443 220.456 0 142.097 0ZM142.097 275.034C68.6122 275.034 9.16129 215.583 9.16129 142.097C9.16129 68.6122 68.6122 9.16129 142.097 9.16129C215.583 9.16129 275.034 68.6122 275.034 142.097C275.034 215.388 215.388 275.034 142.097 275.034Z'+ fill={cx({ '#E4E4E4': theme === 'light', '#576780': theme === 'dark' })}+ />+ <path+ d='M142.099 30.6025C80.6984 30.6025 30.7986 80.5023 30.7986 141.902C30.7986 203.303 80.6984 253.202 142.099 253.202C203.499 253.202 253.398 203.498 253.398 142.097C253.398 80.5023 203.499 30.6025 142.099 30.6025ZM142.099 236.244C90.0546 236.244 47.7567 193.946 47.7567 141.902C47.7567 89.8585 90.0546 47.5607 142.099 47.5607C194.142 47.5607 236.44 89.8585 236.44 141.902C236.44 193.946 194.142 236.244 142.099 236.244Z'+ fill={cx({ '#E4E4E4': theme === 'light', '#576780': theme === 'dark' })}+ />+ <path+ d='M142.098 79.5278C107.597 79.5278 79.5284 107.596 79.5284 142.097C79.5284 176.598 107.402 204.667 142.098 204.667C176.599 204.667 204.668 176.598 204.668 142.097C204.473 107.596 176.599 79.5278 142.098 79.5278ZM142.098 175.624C123.581 175.624 108.572 160.615 108.572 142.097C108.572 123.58 123.581 108.571 142.098 108.571C160.616 108.571 175.624 123.58 175.624 142.097C175.624 160.615 160.616 175.624 142.098 175.624Z'+ fill={cx({ '#E4E4E4': theme === 'light', '#576780': theme === 'dark' })}+ /></g><defs><clipPath id='clip0_180_2875'>@@ -44,20 +77,49 @@ const BackgroundSvg: React.FC<IBackgroundSvg> = ({if (type === 'semicircle') {return (- <svg className={className} width='90' height='39' viewBox='0 0 90 39' fill='none' xmlns='http://www.w3.org/2000/svg'>- <path d='M67.0128 35.3452C75.976 35.3452 83.2775 28.1547 83.2775 19.3277C83.2775 10.5007 75.976 3.31012 67.0128 3.31012L67.0128 35.3452Z' fill={cx({ '#F7F7F7': theme === 'light', '#576780': theme === 'dark' })} />- <path d='M41.6388 35.3452C50.602 35.3452 57.9035 28.1547 57.9035 19.3277C57.9035 10.5007 50.602 3.31012 41.6388 3.31012L41.6388 35.3452Z' fill={cx({ '#F7F7F7': theme === 'light', '#576780': theme === 'dark' })} />- <path d='M16.2648 35.3452C25.228 35.3452 32.5295 28.1547 32.5295 19.3277C32.5295 10.5007 25.228 3.31012 16.2648 3.31012L16.2648 35.3452Z' fill={cx({ '#F7F7F7': theme === 'light', '#576780': theme === 'dark' })} />+ <svg+ className={className}+ width='90'+ height='39'+ viewBox='0 0 90 39'+ fill='none'+ xmlns='http://www.w3.org/2000/svg'+ >+ <path+ d='M67.0128 35.3452C75.976 35.3452 83.2775 28.1547 83.2775 19.3277C83.2775 10.5007 75.976 3.31012 67.0128 3.31012L67.0128 35.3452Z'+ fill={cx({ '#F7F7F7': theme === 'light', '#576780': theme === 'dark' })}+ />+ <path+ d='M41.6388 35.3452C50.602 35.3452 57.9035 28.1547 57.9035 19.3277C57.9035 10.5007 50.602 3.31012 41.6388 3.31012L41.6388 35.3452Z'+ fill={cx({ '#F7F7F7': theme === 'light', '#576780': theme === 'dark' })}+ />+ <path+ d='M16.2648 35.3452C25.228 35.3452 32.5295 28.1547 32.5295 19.3277C32.5295 10.5007 25.228 3.31012 16.2648 3.31012L16.2648 35.3452Z'+ fill={cx({ '#F7F7F7': theme === 'light', '#576780': theme === 'dark' })}+ /></svg>)}if (type === 'twolinecircle') {return (- <svg className={className} width='103' height='100' viewBox='0 0 103 100' fill={cx({ '#E4E4E4': theme === 'light', '#576780': theme === 'dark' })} xmlns='http://www.w3.org/2000/svg'>+ <svg+ className={className}+ width='103'+ height='100'+ viewBox='0 0 103 100'+ fill={cx({ '#E4E4E4': theme === 'light', '#576780': theme === 'dark' })}+ xmlns='http://www.w3.org/2000/svg'+ ><g opacity='0.2' clipPath='url(#clip0_561_1360)'>- <path d='M97.5669 0C43.6308 0 0 43.6308 0 97.5669C0 151.369 43.6308 195.134 97.5669 195.134C151.369 195.134 195.134 151.503 195.134 97.5669C195 43.6308 151.369 0 97.5669 0ZM97.5669 188.844C47.1105 188.844 6.29032 148.023 6.29032 97.5669C6.29032 47.1105 47.1105 6.29032 97.5669 6.29032C148.023 6.29032 188.844 47.1105 188.844 97.5669C188.844 147.89 147.89 188.844 97.5669 188.844Z' fill={cx({ '#E4E4E4': theme === 'light', '#576780': theme === 'dark' })} />- <path d='M97.5677 21.0125C55.4092 21.0125 21.147 55.2746 21.147 97.4332C21.147 139.592 55.4092 173.854 97.5677 173.854C139.726 173.854 173.988 139.726 173.988 97.567C173.988 55.2746 139.726 21.0125 97.5677 21.0125ZM97.5677 162.21C61.8333 162.21 32.7908 133.168 32.7908 97.4332C32.7908 61.6988 61.8333 32.6562 97.5677 32.6562C133.302 32.6562 162.345 61.6988 162.345 97.4332C162.345 133.168 133.302 162.21 97.5677 162.21Z' fill={cx({ '#E4E4E4': theme === 'light', '#576780': theme === 'dark' })} />+ <path+ d='M97.5669 0C43.6308 0 0 43.6308 0 97.5669C0 151.369 43.6308 195.134 97.5669 195.134C151.369 195.134 195.134 151.503 195.134 97.5669C195 43.6308 151.369 0 97.5669 0ZM97.5669 188.844C47.1105 188.844 6.29032 148.023 6.29032 97.5669C6.29032 47.1105 47.1105 6.29032 97.5669 6.29032C148.023 6.29032 188.844 47.1105 188.844 97.5669C188.844 147.89 147.89 188.844 97.5669 188.844Z'+ fill={cx({ '#E4E4E4': theme === 'light', '#576780': theme === 'dark' })}+ />+ <path+ d='M97.5677 21.0125C55.4092 21.0125 21.147 55.2746 21.147 97.4332C21.147 139.592 55.4092 173.854 97.5677 173.854C139.726 173.854 173.988 139.726 173.988 97.567C173.988 55.2746 139.726 21.0125 97.5677 21.0125ZM97.5677 162.21C61.8333 162.21 32.7908 133.168 32.7908 97.4332C32.7908 61.6988 61.8333 32.6562 97.5677 32.6562C133.302 32.6562 162.345 61.6988 162.345 97.4332C162.345 133.168 133.302 162.21 97.5677 162.21Z'+ fill={cx({ '#E4E4E4': theme === 'light', '#576780': theme === 'dark' })}+ /></g><defs><clipPath id='clip0_561_1360'>@@ -70,10 +132,23 @@ const BackgroundSvg: React.FC<IBackgroundSvg> = ({if (type === 'twolinecircle2') {return (- <svg className={className} width='183' height='182' viewBox='0 0 183 182' fill={cx({ '#E4E4E4': theme === 'light', '#576780': theme === 'dark' })} xmlns='http://www.w3.org/2000/svg'>+ <svg+ className={className}+ width='183'+ height='182'+ viewBox='0 0 183 182'+ fill={cx({ '#E4E4E4': theme === 'light', '#576780': theme === 'dark' })}+ xmlns='http://www.w3.org/2000/svg'+ ><g opacity='0.2' clipPath='url(#clip0_561_1038)'>- <path d='M142.097 -102C63.5443 -102 0 -38.4557 0 40.0975C0 118.456 63.5443 182.195 142.097 182.195C220.456 182.195 284.195 118.651 284.195 40.0975C284 -38.4557 220.456 -102 142.097 -102ZM142.097 173.034C68.6122 173.034 9.16129 113.583 9.16129 40.0975C9.16129 -33.3878 68.6122 -92.8387 142.097 -92.8387C215.583 -92.8387 275.034 -33.3878 275.034 40.0975C275.034 113.388 215.388 173.034 142.097 173.034Z' fill={cx({ '#E4E4E4': theme === 'light', '#576780': theme === 'dark' })} />- <path d='M142.099 -71.3972C80.6984 -71.3972 30.7986 -21.4974 30.7986 39.9027C30.7986 101.303 80.6984 151.203 142.099 151.203C203.499 151.203 253.398 101.498 253.398 40.0976C253.398 -21.4974 203.499 -71.3972 142.099 -71.3972ZM142.099 134.245C90.0546 134.245 47.7567 91.9466 47.7567 39.9027C47.7567 -12.1412 90.0546 -54.4391 142.099 -54.4391C194.142 -54.4391 236.44 -12.1412 236.44 39.9027C236.44 91.9466 194.142 134.245 142.099 134.245Z' fill={cx({ '#E4E4E4': theme === 'light', '#576780': theme === 'dark' })} />+ <path+ d='M142.097 -102C63.5443 -102 0 -38.4557 0 40.0975C0 118.456 63.5443 182.195 142.097 182.195C220.456 182.195 284.195 118.651 284.195 40.0975C284 -38.4557 220.456 -102 142.097 -102ZM142.097 173.034C68.6122 173.034 9.16129 113.583 9.16129 40.0975C9.16129 -33.3878 68.6122 -92.8387 142.097 -92.8387C215.583 -92.8387 275.034 -33.3878 275.034 40.0975C275.034 113.388 215.388 173.034 142.097 173.034Z'+ fill={cx({ '#E4E4E4': theme === 'light', '#576780': theme === 'dark' })}+ />+ <path+ d='M142.099 -71.3972C80.6984 -71.3972 30.7986 -21.4974 30.7986 39.9027C30.7986 101.303 80.6984 151.203 142.099 151.203C203.499 151.203 253.398 101.498 253.398 40.0976C253.398 -21.4974 203.499 -71.3972 142.099 -71.3972ZM142.099 134.245C90.0546 134.245 47.7567 91.9466 47.7567 39.9027C47.7567 -12.1412 90.0546 -54.4391 142.099 -54.4391C194.142 -54.4391 236.44 -12.1412 236.44 39.9027C236.44 91.9466 194.142 134.245 142.099 134.245Z'+ fill={cx({ '#E4E4E4': theme === 'light', '#576780': theme === 'dark' })}+ /></g><defs><clipPath id='clip0_561_1038'>@@ -86,11 +161,26 @@ const BackgroundSvg: React.FC<IBackgroundSvg> = ({if (type === 'threecircle') {return (- <svg width='115' height='205' viewBox='0 0 115 205' fill={cx({ '#E4E4E4': theme === 'light', '#576780': theme === 'dark' })} xmlns='http://www.w3.org/2000/svg'>+ <svg+ width='115'+ height='205'+ viewBox='0 0 115 205'+ fill={cx({ '#E4E4E4': theme === 'light', '#576780': theme === 'dark' })}+ xmlns='http://www.w3.org/2000/svg'+ ><g opacity='0.2' clipPath='url(#clip0_561_1345)'>- <path d='M102.57 0C45.8682 0 0 45.8682 0 102.57C0 159.132 45.8682 205.141 102.57 205.141C159.132 205.141 205.141 159.272 205.141 102.57C205 45.8682 159.132 0 102.57 0ZM102.57 198.528C49.5264 198.528 6.6129 155.614 6.6129 102.57C6.6129 49.5264 49.5264 6.6129 102.57 6.6129C155.614 6.6129 198.528 49.5264 198.528 102.57C198.528 155.474 155.474 198.528 102.57 198.528Z' fill={cx({ '#E4E4E4': theme === 'light', '#576780': theme === 'dark' })} />- <path d='M102.571 22.0898C58.2507 22.0898 22.2314 58.1091 22.2314 102.43C22.2314 146.75 58.2507 182.769 102.571 182.769C146.892 182.769 182.911 146.891 182.911 102.57C182.911 58.1091 146.892 22.0898 102.571 22.0898ZM102.571 170.528C65.0043 170.528 34.4724 139.997 34.4724 102.43C34.4724 64.8627 65.0043 34.3307 102.571 34.3307C140.138 34.3307 170.67 64.8627 170.67 102.43C170.67 139.997 140.138 170.528 102.571 170.528Z' fill={cx({ '#E4E4E4': theme === 'light', '#576780': theme === 'dark' })} />- <path d='M102.571 57.4053C77.6668 57.4053 57.406 77.6661 57.406 102.57C57.406 127.474 77.5261 147.735 102.571 147.735C127.475 147.735 147.735 127.474 147.735 102.57C147.595 77.6661 127.475 57.4053 102.571 57.4053ZM102.571 126.77C89.2042 126.77 78.3703 115.936 78.3703 102.57C78.3703 89.2035 89.2042 78.3696 102.571 78.3696C115.937 78.3696 126.771 89.2035 126.771 102.57C126.771 115.936 115.937 126.77 102.571 126.77Z' fill={cx({ '#E4E4E4': theme === 'light', '#576780': theme === 'dark' })} />+ <path+ d='M102.57 0C45.8682 0 0 45.8682 0 102.57C0 159.132 45.8682 205.141 102.57 205.141C159.132 205.141 205.141 159.272 205.141 102.57C205 45.8682 159.132 0 102.57 0ZM102.57 198.528C49.5264 198.528 6.6129 155.614 6.6129 102.57C6.6129 49.5264 49.5264 6.6129 102.57 6.6129C155.614 6.6129 198.528 49.5264 198.528 102.57C198.528 155.474 155.474 198.528 102.57 198.528Z'+ fill={cx({ '#E4E4E4': theme === 'light', '#576780': theme === 'dark' })}+ />+ <path+ d='M102.571 22.0898C58.2507 22.0898 22.2314 58.1091 22.2314 102.43C22.2314 146.75 58.2507 182.769 102.571 182.769C146.892 182.769 182.911 146.891 182.911 102.57C182.911 58.1091 146.892 22.0898 102.571 22.0898ZM102.571 170.528C65.0043 170.528 34.4724 139.997 34.4724 102.43C34.4724 64.8627 65.0043 34.3307 102.571 34.3307C140.138 34.3307 170.67 64.8627 170.67 102.43C170.67 139.997 140.138 170.528 102.571 170.528Z'+ fill={cx({ '#E4E4E4': theme === 'light', '#576780': theme === 'dark' })}+ />+ <path+ d='M102.571 57.4053C77.6668 57.4053 57.406 77.6661 57.406 102.57C57.406 127.474 77.5261 147.735 102.571 147.735C127.475 147.735 147.735 127.474 147.735 102.57C147.595 77.6661 127.475 57.4053 102.571 57.4053ZM102.571 126.77C89.2042 126.77 78.3703 115.936 78.3703 102.57C78.3703 89.2035 89.2042 78.3696 102.571 78.3696C115.937 78.3696 126.771 89.2035 126.771 102.57C126.771 115.936 115.937 126.77 102.571 126.77Z'+ fill={cx({ '#E4E4E4': theme === 'light', '#576780': theme === 'dark' })}+ /></g><defs><clipPath id='clip0_561_1345'>diff --git a/app/ui/icons/BarChart.tsx b/app/ui/icons/BarChart.tsxindex 6c8c36335..ae131ee32 100644--- a/app/ui/icons/BarChart.tsx+++ b/app/ui/icons/BarChart.tsx@@ -3,14 +3,16 @@ import cx from 'clsx'import PropTypes from 'prop-types'interface IBarChart {- className?: string,+ className?: string}const BarChart = ({ className }: IBarChart): JSX.Element => (- <svg- className={cx('fill-gray-700 dark:fill-gray-50', className)} viewBox='0 0 448 512'>+ <svg className={cx('fill-gray-700 dark:fill-gray-50', className)} viewBox='0 0 448 512'>{/* Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2023 Fonticons, Inc. */}- <path xmlns='http://www.w3.org/2000/svg' d='M160 80c0-26.5 21.5-48 48-48h32c26.5 0 48 21.5 48 48V432c0 26.5-21.5 48-48 48H208c-26.5 0-48-21.5-48-48V80zM0 272c0-26.5 21.5-48 48-48H80c26.5 0 48 21.5 48 48V432c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V272zM368 96h32c26.5 0 48 21.5 48 48V432c0 26.5-21.5 48-48 48H368c-26.5 0-48-21.5-48-48V144c0-26.5 21.5-48 48-48z'/>+ <path+ xmlns='http://www.w3.org/2000/svg'+ d='M160 80c0-26.5 21.5-48 48-48h32c26.5 0 48 21.5 48 48V432c0 26.5-21.5 48-48 48H208c-26.5 0-48-21.5-48-48V80zM0 272c0-26.5 21.5-48 48-48H80c26.5 0 48 21.5 48 48V432c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V272zM368 96h32c26.5 0 48 21.5 48 48V432c0 26.5-21.5 48-48 48H368c-26.5 0-48-21.5-48-48V144c0-26.5 21.5-48 48-48z'+ /></svg>)diff --git a/app/ui/icons/Cloudflare.tsx b/app/ui/icons/Cloudflare.tsxindex 2c574e4f1..ab44b54e3 100644--- a/app/ui/icons/Cloudflare.tsx+++ b/app/ui/icons/Cloudflare.tsx@@ -2,10 +2,7 @@ import React from 'react'import cx from 'clsx'import PropTypes from 'prop-types'-const Cloudflare = ({ theme, className }: {- theme: 'dark' | 'light',- className?: string,-}): JSX.Element => {+const Cloudflare = ({ theme, className }: { theme: 'dark' | 'light'; className?: string }): JSX.Element => {const cn = cx(className, {'fill-white': theme === 'dark','fill-slate-800': theme === 'light',@@ -13,21 +10,49 @@ const Cloudflare = ({ theme, className }: {return (<svg className={className} viewBox='0 0 602 203' fill='none'>- <title>- Cloudflare- </title>- <path d='M510.338 128.167L511.809 123.081C513.562 117.031 512.91 111.438 509.969 107.329C507.262 103.544 502.752 101.315 497.274 101.056L393.528 99.7432C393.206 99.7369 392.89 99.655 392.606 99.504C392.321 99.353 392.077 99.1373 391.891 98.8742C391.71 98.6023 391.594 98.2918 391.553 97.9674C391.513 97.6429 391.549 97.3135 391.658 97.0053C391.836 96.4971 392.159 96.0521 392.587 95.7254C393.016 95.3987 393.53 95.2045 394.068 95.1668L498.775 93.8398C511.196 93.2698 524.644 83.1988 529.352 70.9178L535.323 55.3265C535.568 54.6672 535.624 53.9529 535.485 53.2637C528.705 22.7889 501.487 0 468.944 0C438.96 0 413.501 19.3385 404.369 46.2179C398.198 41.5895 390.504 39.4618 382.83 40.2608C368.445 41.6882 356.879 53.2613 355.455 67.6379C355.09 71.2277 355.357 74.8538 356.246 78.3513C332.747 79.0358 313.902 98.2738 313.902 121.922C313.905 124.033 314.061 126.141 314.369 128.23C314.437 128.712 314.676 129.154 315.043 129.475C315.41 129.796 315.881 129.974 316.368 129.977L507.902 130.001C507.92 130.002 507.938 130.002 507.956 130.001C508.498 129.991 509.022 129.808 509.451 129.478C509.88 129.147 510.191 128.688 510.338 128.167Z' fill='#F6821F' />- <path d='M544.899 56.4571C543.938 56.4571 542.98 56.4813 542.026 56.5295C541.872 56.5405 541.721 56.5736 541.577 56.6277C541.327 56.7131 541.101 56.8578 540.919 57.0494C540.737 57.241 540.604 57.4739 540.532 57.728L536.453 71.8078C534.699 77.8584 535.351 83.4464 538.295 87.5556C541 91.3448 545.51 93.5688 550.987 93.8281L573.104 95.155C573.415 95.1653 573.719 95.2479 573.993 95.3963C574.266 95.5448 574.501 95.7549 574.679 96.0101C574.863 96.2834 574.98 96.5959 575.02 96.9225C575.061 97.2492 575.024 97.5808 574.913 97.8906C574.735 98.3978 574.412 98.842 573.985 99.1686C573.558 99.4951 573.044 99.69 572.508 99.7292L549.528 101.056C537.051 101.631 523.606 111.697 518.902 123.978L517.242 128.314C517.173 128.495 517.147 128.69 517.168 128.883C517.189 129.076 517.255 129.262 517.362 129.424C517.469 129.586 517.612 129.721 517.781 129.817C517.95 129.912 518.14 129.967 518.334 129.975C518.355 129.975 518.374 129.975 518.395 129.975H597.467C597.927 129.979 598.375 129.833 598.744 129.558C599.112 129.283 599.381 128.896 599.508 128.454C600.909 123.459 601.617 118.296 601.612 113.108C601.603 81.8228 576.215 56.4571 544.899 56.4571Z' fill='#FBAD41' />+ <title>Cloudflare</title>+ <path+ d='M510.338 128.167L511.809 123.081C513.562 117.031 512.91 111.438 509.969 107.329C507.262 103.544 502.752 101.315 497.274 101.056L393.528 99.7432C393.206 99.7369 392.89 99.655 392.606 99.504C392.321 99.353 392.077 99.1373 391.891 98.8742C391.71 98.6023 391.594 98.2918 391.553 97.9674C391.513 97.6429 391.549 97.3135 391.658 97.0053C391.836 96.4971 392.159 96.0521 392.587 95.7254C393.016 95.3987 393.53 95.2045 394.068 95.1668L498.775 93.8398C511.196 93.2698 524.644 83.1988 529.352 70.9178L535.323 55.3265C535.568 54.6672 535.624 53.9529 535.485 53.2637C528.705 22.7889 501.487 0 468.944 0C438.96 0 413.501 19.3385 404.369 46.2179C398.198 41.5895 390.504 39.4618 382.83 40.2608C368.445 41.6882 356.879 53.2613 355.455 67.6379C355.09 71.2277 355.357 74.8538 356.246 78.3513C332.747 79.0358 313.902 98.2738 313.902 121.922C313.905 124.033 314.061 126.141 314.369 128.23C314.437 128.712 314.676 129.154 315.043 129.475C315.41 129.796 315.881 129.974 316.368 129.977L507.902 130.001C507.92 130.002 507.938 130.002 507.956 130.001C508.498 129.991 509.022 129.808 509.451 129.478C509.88 129.147 510.191 128.688 510.338 128.167Z'+ fill='#F6821F'+ />+ <path+ d='M544.899 56.4571C543.938 56.4571 542.98 56.4813 542.026 56.5295C541.872 56.5405 541.721 56.5736 541.577 56.6277C541.327 56.7131 541.101 56.8578 540.919 57.0494C540.737 57.241 540.604 57.4739 540.532 57.728L536.453 71.8078C534.699 77.8584 535.351 83.4464 538.295 87.5556C541 91.3448 545.51 93.5688 550.987 93.8281L573.104 95.155C573.415 95.1653 573.719 95.2479 573.993 95.3963C574.266 95.5448 574.501 95.7549 574.679 96.0101C574.863 96.2834 574.98 96.5959 575.02 96.9225C575.061 97.2492 575.024 97.5808 574.913 97.8906C574.735 98.3978 574.412 98.842 573.985 99.1686C573.558 99.4951 573.044 99.69 572.508 99.7292L549.528 101.056C537.051 101.631 523.606 111.697 518.902 123.978L517.242 128.314C517.173 128.495 517.147 128.69 517.168 128.883C517.189 129.076 517.255 129.262 517.362 129.424C517.469 129.586 517.612 129.721 517.781 129.817C517.95 129.912 518.14 129.967 518.334 129.975C518.355 129.975 518.374 129.975 518.395 129.975H597.467C597.927 129.979 598.375 129.833 598.744 129.558C599.112 129.283 599.381 128.896 599.508 128.454C600.909 123.459 601.617 118.296 601.612 113.108C601.603 81.8228 576.215 56.4571 544.899 56.4571Z'+ fill='#FBAD41'+ /><path d='M66.9595 153.39H80.4491V190.214H104.022V202.024H66.9595V153.39Z' className={cn} />- <path d='M117.993 177.847V177.709C117.993 163.744 129.257 152.416 144.276 152.416C159.295 152.416 170.418 163.604 170.418 177.569V177.709C170.418 191.674 159.152 202.995 144.138 202.995C129.124 202.995 117.993 191.812 117.993 177.847ZM156.65 177.847V177.709C156.65 170.701 151.577 164.575 144.138 164.575C136.767 164.575 131.829 170.551 131.829 177.569V177.709C131.829 184.718 136.905 190.841 144.276 190.841C151.715 190.841 156.65 184.865 156.65 177.847Z' className={cn} />- <path d='M186.928 180.695V153.388H200.626V180.419C200.626 187.427 204.173 190.77 209.594 190.77C215.016 190.77 218.562 187.575 218.562 180.765V153.388H232.262V180.34C232.262 196.043 223.294 202.918 209.456 202.918C195.618 202.918 186.928 195.91 186.928 180.688' className={cn} />- <path d='M252.906 153.392H271.679C289.064 153.392 299.145 163.396 299.145 177.429V177.571C299.145 191.602 288.924 202.026 271.403 202.026H252.906V153.392ZM271.89 190.07C279.958 190.07 285.307 185.631 285.307 177.77V177.632C285.307 169.853 279.958 165.335 271.89 165.335H266.396V190.074L271.89 190.07Z' className={cn} />- <path d='M318.75 153.39H357.686V165.204H332.24V173.469H355.254V184.654H332.24V202.024H318.75V153.39Z' className={cn} />+ <path+ d='M117.993 177.847V177.709C117.993 163.744 129.257 152.416 144.276 152.416C159.295 152.416 170.418 163.604 170.418 177.569V177.709C170.418 191.674 159.152 202.995 144.138 202.995C129.124 202.995 117.993 191.812 117.993 177.847ZM156.65 177.847V177.709C156.65 170.701 151.577 164.575 144.138 164.575C136.767 164.575 131.829 170.551 131.829 177.569V177.709C131.829 184.718 136.905 190.841 144.276 190.841C151.715 190.841 156.65 184.865 156.65 177.847Z'+ className={cn}+ />+ <path+ d='M186.928 180.695V153.388H200.626V180.419C200.626 187.427 204.173 190.77 209.594 190.77C215.016 190.77 218.562 187.575 218.562 180.765V153.388H232.262V180.34C232.262 196.043 223.294 202.918 209.456 202.918C195.618 202.918 186.928 195.91 186.928 180.688'+ className={cn}+ />+ <path+ d='M252.906 153.392H271.679C289.064 153.392 299.145 163.396 299.145 177.429V177.571C299.145 191.602 288.924 202.026 271.403 202.026H252.906V153.392ZM271.89 190.07C279.958 190.07 285.307 185.631 285.307 177.77V177.632C285.307 169.853 279.958 165.335 271.89 165.335H266.396V190.074L271.89 190.07Z'+ className={cn}+ />+ <path+ d='M318.75 153.39H357.686V165.204H332.24V173.469H355.254V184.654H332.24V202.024H318.75V153.39Z'+ className={cn}+ /><path d='M376.457 153.39H389.946V190.214H413.519V202.024H376.457V153.39Z' className={cn} />- <path d='M448.768 153.042H461.766L482.489 202.024H468.027L464.478 193.338H445.703L442.229 202.024H428.045L448.768 153.042ZM460.586 182.849L455.162 169.021L449.668 182.849H460.586Z' className={cn} />- <path d='M499.865 153.388H522.879C530.323 153.388 535.464 155.336 538.732 158.67C541.587 161.45 543.045 165.211 543.045 169.998V170.135C543.045 177.567 539.071 182.501 533.032 185.07L544.645 202.026H529.065L519.262 187.294H513.354V202.026H499.865V153.388ZM522.255 176.735C526.844 176.735 529.488 174.511 529.488 170.967V170.829C529.488 167.007 526.706 165.064 522.182 165.064H513.354V176.744L522.255 176.735Z' className={cn} />- <path d='M562.508 153.39H601.652V164.856H575.86V172.217H599.223V182.849H575.86V190.562H602V202.024H562.508V153.39Z' className={cn} />- <path d='M37.425 183.547C35.536 187.815 31.5615 190.838 26.2802 190.838C18.9065 190.838 13.8333 184.724 13.8333 177.707V177.567C13.8333 170.558 18.7686 164.573 26.14 164.573C31.6971 164.573 35.9287 167.989 37.7149 172.635H51.9339C49.6568 161.06 39.4776 152.418 26.2802 152.418C11.2593 152.418 0 163.753 0 177.707V177.845C0 191.81 11.1214 203 26.14 203C38.9867 203 49.0279 194.688 51.6768 183.549L37.425 183.547Z' className={cn} />+ <path+ d='M448.768 153.042H461.766L482.489 202.024H468.027L464.478 193.338H445.703L442.229 202.024H428.045L448.768 153.042ZM460.586 182.849L455.162 169.021L449.668 182.849H460.586Z'+ className={cn}+ />+ <path+ d='M499.865 153.388H522.879C530.323 153.388 535.464 155.336 538.732 158.67C541.587 161.45 543.045 165.211 543.045 169.998V170.135C543.045 177.567 539.071 182.501 533.032 185.07L544.645 202.026H529.065L519.262 187.294H513.354V202.026H499.865V153.388ZM522.255 176.735C526.844 176.735 529.488 174.511 529.488 170.967V170.829C529.488 167.007 526.706 165.064 522.182 165.064H513.354V176.744L522.255 176.735Z'+ className={cn}+ />+ <path+ d='M562.508 153.39H601.652V164.856H575.86V172.217H599.223V182.849H575.86V190.562H602V202.024H562.508V153.39Z'+ className={cn}+ />+ <path+ d='M37.425 183.547C35.536 187.815 31.5615 190.838 26.2802 190.838C18.9065 190.838 13.8333 184.724 13.8333 177.707V177.567C13.8333 170.558 18.7686 164.573 26.14 164.573C31.6971 164.573 35.9287 167.989 37.7149 172.635H51.9339C49.6568 161.06 39.4776 152.418 26.2802 152.418C11.2593 152.418 0 163.753 0 177.707V177.845C0 191.81 11.1214 203 26.14 203C38.9867 203 49.0279 194.688 51.6768 183.549L37.425 183.547Z'+ className={cn}+ /></svg>)}diff --git a/app/ui/icons/Gatsby.tsx b/app/ui/icons/Gatsby.tsxindex 998280a0f..a84fb6328 100644--- a/app/ui/icons/Gatsby.tsx+++ b/app/ui/icons/Gatsby.tsx@@ -2,10 +2,7 @@ import React from 'react'import cx from 'clsx'import PropTypes from 'prop-types'-const Gatsby = ({ theme, className }: {- theme: 'dark' | 'light',- className?: string,-}): JSX.Element => (+const Gatsby = ({ theme, className }: { theme: 'dark' | 'light'; className?: string }): JSX.Element => (<svgclassName={cx(className, {'fill-white': theme === 'dark',@@ -13,9 +10,7 @@ const Gatsby = ({ theme, className }: {})}viewBox='0 0 106 28'>- <title>- Gatsby- </title>+ <title>Gatsby</title><g><path d='M14,0C6.3,0,0,6.3,0,14s6.3,14,14,14s14-6.3,14-14S21.7,0,14,0z M6.2,21.8c-2.1-2.1-3.2-4.9-3.2-7.6L13.9,25 C11.1,24.9,8.3,23.9,6.2,21.8z M16.4,24.7L3.3,11.6C4.4,6.7,8.8,3,14,3c3.7,0,6.9,1.8,8.9,4.5l-1.5,1.3C19.7,6.5,17,5,14,5 c-3.9,0-7.2,2.5-8.5,6L17,22.5c2.9-1,5.1-3.5,5.8-6.5H18v-2h7C25,19.2,21.3,23.6,16.4,24.7z' /></g>diff --git a/app/ui/icons/Ghost.tsx b/app/ui/icons/Ghost.tsxindex bdd5a0bbb..d4a386774 100644--- a/app/ui/icons/Ghost.tsx+++ b/app/ui/icons/Ghost.tsx@@ -2,10 +2,7 @@ import React from 'react'import cx from 'clsx'import PropTypes from 'prop-types'-const Ghost = ({ theme, className }: {- theme: 'dark' | 'light',- className?: string,-}): JSX.Element => {+const Ghost = ({ theme, className }: { theme: 'dark' | 'light'; className?: string }): JSX.Element => {const cn = cx(className, {'fill-white': theme === 'dark','fill-slate-800': theme === 'light',@@ -13,9 +10,7 @@ const Ghost = ({ theme, className }: {return (<svg className={className} viewBox='0 0 671.98 288'>- <title>- Ghost- </title>+ <title>Ghost</title><g opacity='0.7'><rect x='112.197' y='168.302' className={cn} width='31.703' height='15.852' /><rect x='159.75' y='168.302' className={cn} width='31.683' height='15.852' />@@ -24,11 +19,26 @@ const Ghost = ({ theme, className }: {<rect x='175.602' y='104.898' className={cn} width='15.851' height='15.851' /></g><g>- <path className={cn} d='M421.575,104.807c-25.458,0-38.606,18.003-38.606,40.211c0,22.209,12.824,40.214,38.606,40.214 s38.606-18.005,38.606-40.214C460.182,122.81,447.032,104.807,421.575,104.807z M440.835,145.09L440.835,145.09 c-0.018,14.281-4.83,25.848-19.26,25.848s-19.243-11.566-19.258-25.848l0,0c0-0.012,0-0.023,0-0.035s0-0.023,0-0.036l0,0 c0.015-14.28,4.829-25.846,19.259-25.846c14.429,0,19.241,11.566,19.259,25.846l0,0c0,0.013,0,0.024,0,0.036 S440.835,145.078,440.835,145.09z' />- <path className={cn} d='M307.584,184.153V72.975c0,0,14.664-2.083,15.801-2.236c1.288-0.174,2.998,0.743,2.998,2.556 c0,1.985,0,41.214,0,41.214c3.043-2.893,6.394-5.225,10.046-7.002c3.655-1.775,7.941-2.664,12.865-2.664 c4.263,0,8.04,0.723,11.338,2.17c3.3,1.444,6.053,3.476,8.26,6.087c2.207,2.615,3.882,5.735,5.024,9.363 c1.141,3.628,1.712,7.624,1.712,11.988v49.701h-18.8v-49.701c0-4.769-1.104-8.461-3.311-11.076 c-2.208-2.612-5.519-3.919-9.935-3.919c-3.247,0-6.29,0.736-9.13,2.209c-2.843,1.472-5.532,3.474-8.069,6.013v56.475H307.584z' />- <path className={cn} d='M558.565,185.224c-12.937,0-21.045-7.529-21.045-21.575v-41.628h-14.58c0,0,3.099-10.718,3.344-11.562 c0.246-0.843,0.887-1.749,2.174-1.928s9.044-1.261,9.044-1.261l3.583-22.794c0,0,10.527-1.484,12.196-1.733 c1.576-0.236,3.005,0.899,3.005,2.616c0,1.715,0,21.911,0,21.911h18.44v14.751h-18.44v41.067c0,5.607,3.414,7.75,6.686,7.75 c2,0,4.739-1.062,6.783-2.01c1.263-0.584,3.22-0.151,3.726,1.612c0.447,1.562,2.824,9.853,2.824,9.853 C574.254,181.617,567.771,185.224,558.565,185.224z' />- <path className={cn} d='M512.609,122.267c-3.664-1.19-10.551-3.095-17.102-3.095c-6.675,0-11.927,2.306-11.927,7.856 c0,6.932,11.319,8.95,19.067,11.776c5.18,1.889,19.071,5.572,19.071,20.512c0,18.148-15.071,25.907-31.148,25.907 c-16.079,0-25.578-5.98-25.578-5.98s2.494-8.81,2.999-10.549c0.457-1.565,2.276-2.114,3.435-1.669 c4.138,1.595,11.61,3.812,20.056,3.812c8.551,0,12.688-2.611,12.688-8.177c0-7.408-11.547-9.672-19.184-12.081 c-5.261-1.658-19.186-5.525-19.186-21.956c0-16.186,14.213-23.78,29.403-23.78c12.858,0,19.165,2.689,23.876,5.089 c0,0-2.625,9.149-3.015,10.512C515.604,122.064,514.275,122.807,512.609,122.267z' />- <path className={cn} d='M300.245,107.523c0-1.751-1.496-2.753-2.923-2.59c-6.309,0.723-10.81,3.692-13.722,6.456 c-5.718-4.48-13.655-6.619-22.563-6.619c-17.86,0-31.814,8.62-31.814,27.416c0,10.79,4.593,18.225,11.887,22.602 c-5.417,2.564-9.025,8.005-9.025,13.354c0,8.948,7.069,11.75,7.069,11.75s-12.36,5.999-12.36,18.001 c0,15.364,14.139,21.576,31.416,21.576c24.904,0,42.038-10.286,42.038-29.173c0-11.624-8.895-18.041-28.279-18.804 c-11.503-0.454-18.954-0.868-20.8-1.479c-2.439-0.81-3.638-2.763-3.638-4.919c0-2.38,1.955-4.646,5.037-6.202 c2.688,0.476,5.525,0.711,8.471,0.711c17.875,0,31.815-8.595,31.815-27.416c0-4.564-0.824-8.526-2.322-11.911 c2.626-1.401,5.857-2.387,9.715-2.387C300.245,117.889,300.245,109.12,300.245,107.523z M251.026,184.25 c0,0,9.379,0.355,18.751,0.789c10.529,0.487,13.81,2.756,13.81,8.208c0,6.661-9.15,13.14-21.937,13.14 c-12.138,0-18.201-4.223-18.201-11.254C243.449,191.099,245.579,186.586,251.026,184.25z M261.071,146.483 c-8.461,0-15.062-4.494-15.062-14.297c0-9.804,6.607-14.298,15.062-14.298c8.456,0,15.062,4.482,15.062,14.298 S269.535,146.483,261.071,146.483z' />+ <path+ className={cn}+ d='M421.575,104.807c-25.458,0-38.606,18.003-38.606,40.211c0,22.209,12.824,40.214,38.606,40.214 s38.606-18.005,38.606-40.214C460.182,122.81,447.032,104.807,421.575,104.807z M440.835,145.09L440.835,145.09 c-0.018,14.281-4.83,25.848-19.26,25.848s-19.243-11.566-19.258-25.848l0,0c0-0.012,0-0.023,0-0.035s0-0.023,0-0.036l0,0 c0.015-14.28,4.829-25.846,19.259-25.846c14.429,0,19.241,11.566,19.259,25.846l0,0c0,0.013,0,0.024,0,0.036 S440.835,145.078,440.835,145.09z'+ />+ <path+ className={cn}+ d='M307.584,184.153V72.975c0,0,14.664-2.083,15.801-2.236c1.288-0.174,2.998,0.743,2.998,2.556 c0,1.985,0,41.214,0,41.214c3.043-2.893,6.394-5.225,10.046-7.002c3.655-1.775,7.941-2.664,12.865-2.664 c4.263,0,8.04,0.723,11.338,2.17c3.3,1.444,6.053,3.476,8.26,6.087c2.207,2.615,3.882,5.735,5.024,9.363 c1.141,3.628,1.712,7.624,1.712,11.988v49.701h-18.8v-49.701c0-4.769-1.104-8.461-3.311-11.076 c-2.208-2.612-5.519-3.919-9.935-3.919c-3.247,0-6.29,0.736-9.13,2.209c-2.843,1.472-5.532,3.474-8.069,6.013v56.475H307.584z'+ />+ <path+ className={cn}+ d='M558.565,185.224c-12.937,0-21.045-7.529-21.045-21.575v-41.628h-14.58c0,0,3.099-10.718,3.344-11.562 c0.246-0.843,0.887-1.749,2.174-1.928s9.044-1.261,9.044-1.261l3.583-22.794c0,0,10.527-1.484,12.196-1.733 c1.576-0.236,3.005,0.899,3.005,2.616c0,1.715,0,21.911,0,21.911h18.44v14.751h-18.44v41.067c0,5.607,3.414,7.75,6.686,7.75 c2,0,4.739-1.062,6.783-2.01c1.263-0.584,3.22-0.151,3.726,1.612c0.447,1.562,2.824,9.853,2.824,9.853 C574.254,181.617,567.771,185.224,558.565,185.224z'+ />+ <path+ className={cn}+ d='M512.609,122.267c-3.664-1.19-10.551-3.095-17.102-3.095c-6.675,0-11.927,2.306-11.927,7.856 c0,6.932,11.319,8.95,19.067,11.776c5.18,1.889,19.071,5.572,19.071,20.512c0,18.148-15.071,25.907-31.148,25.907 c-16.079,0-25.578-5.98-25.578-5.98s2.494-8.81,2.999-10.549c0.457-1.565,2.276-2.114,3.435-1.669 c4.138,1.595,11.61,3.812,20.056,3.812c8.551,0,12.688-2.611,12.688-8.177c0-7.408-11.547-9.672-19.184-12.081 c-5.261-1.658-19.186-5.525-19.186-21.956c0-16.186,14.213-23.78,29.403-23.78c12.858,0,19.165,2.689,23.876,5.089 c0,0-2.625,9.149-3.015,10.512C515.604,122.064,514.275,122.807,512.609,122.267z'+ />+ <path+ className={cn}+ d='M300.245,107.523c0-1.751-1.496-2.753-2.923-2.59c-6.309,0.723-10.81,3.692-13.722,6.456 c-5.718-4.48-13.655-6.619-22.563-6.619c-17.86,0-31.814,8.62-31.814,27.416c0,10.79,4.593,18.225,11.887,22.602 c-5.417,2.564-9.025,8.005-9.025,13.354c0,8.948,7.069,11.75,7.069,11.75s-12.36,5.999-12.36,18.001 c0,15.364,14.139,21.576,31.416,21.576c24.904,0,42.038-10.286,42.038-29.173c0-11.624-8.895-18.041-28.279-18.804 c-11.503-0.454-18.954-0.868-20.8-1.479c-2.439-0.81-3.638-2.763-3.638-4.919c0-2.38,1.955-4.646,5.037-6.202 c2.688,0.476,5.525,0.711,8.471,0.711c17.875,0,31.815-8.595,31.815-27.416c0-4.564-0.824-8.526-2.322-11.911 c2.626-1.401,5.857-2.387,9.715-2.387C300.245,117.889,300.245,109.12,300.245,107.523z M251.026,184.25 c0,0,9.379,0.355,18.751,0.789c10.529,0.487,13.81,2.756,13.81,8.208c0,6.661-9.15,13.14-21.937,13.14 c-12.138,0-18.201-4.223-18.201-11.254C243.449,191.099,245.579,186.586,251.026,184.25z M261.071,146.483 c-8.461,0-15.062-4.494-15.062-14.297c0-9.804,6.607-14.298,15.062-14.298c8.456,0,15.062,4.482,15.062,14.298 S269.535,146.483,261.071,146.483z'+ /></g></svg>)diff --git a/app/ui/icons/GithubDark.tsx b/app/ui/icons/GithubDark.tsxindex 0c2f52d49..b6fa82bee 100644--- a/app/ui/icons/GithubDark.tsx+++ b/app/ui/icons/GithubDark.tsx@@ -1,11 +1,14 @@import React from 'react'import PropTypes from 'prop-types'-const GithubDarkSVG = ({ className }: {- className?: string,-}): JSX.Element => (+const GithubDarkSVG = ({ className }: { className?: string }): JSX.Element => (<svg className={className} viewBox='0 0 100 100'>- <path fillRule='evenodd' clipRule='evenodd' d='M48.854 0C21.839 0 0 22 0 49.217c0 21.756 13.993 40.172 33.405 46.69 2.427.49 3.316-1.059 3.316-2.362 0-1.141-.08-5.052-.08-9.127-13.59 2.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.015.324-3.015.324-3.015 4.934.326 7.523 5.052 7.523 5.052 4.367 7.496 11.404 5.378 14.235 4.074.404-3.178 1.699-5.378 3.074-6.6-10.839-1.141-22.243-5.378-22.243-24.283 0-5.378 1.94-9.778 5.014-13.2-.485-1.222-2.184-6.275.486-13.038 0 0 4.125-1.304 13.426 5.052a46.97 46.97 0 0 1 12.214-1.63c4.125 0 8.33.571 12.213 1.63 9.302-6.356 13.427-5.052 13.427-5.052 2.67 6.763.97 11.816.485 13.038 3.155 3.422 5.015 7.822 5.015 13.2 0 18.905-11.404 23.06-22.324 24.283 1.78 1.548 3.316 4.481 3.316 9.126 0 6.6-.08 11.897-.08 13.526 0 1.304.89 2.853 3.316 2.364 19.412-6.52 33.405-24.935 33.405-46.691C97.707 22 75.788 0 48.854 0z' fill='#24292f' />+ <path+ fillRule='evenodd'+ clipRule='evenodd'+ d='M48.854 0C21.839 0 0 22 0 49.217c0 21.756 13.993 40.172 33.405 46.69 2.427.49 3.316-1.059 3.316-2.362 0-1.141-.08-5.052-.08-9.127-13.59 2.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.015.324-3.015.324-3.015 4.934.326 7.523 5.052 7.523 5.052 4.367 7.496 11.404 5.378 14.235 4.074.404-3.178 1.699-5.378 3.074-6.6-10.839-1.141-22.243-5.378-22.243-24.283 0-5.378 1.94-9.778 5.014-13.2-.485-1.222-2.184-6.275.486-13.038 0 0 4.125-1.304 13.426 5.052a46.97 46.97 0 0 1 12.214-1.63c4.125 0 8.33.571 12.213 1.63 9.302-6.356 13.427-5.052 13.427-5.052 2.67 6.763.97 11.816.485 13.038 3.155 3.422 5.015 7.822 5.015 13.2 0 18.905-11.404 23.06-22.324 24.283 1.78 1.548 3.316 4.481 3.316 9.126 0 6.6-.08 11.897-.08 13.526 0 1.304.89 2.853 3.316 2.364 19.412-6.52 33.405-24.935 33.405-46.691C97.707 22 75.788 0 48.854 0z'+ fill='#24292f'+ /></svg>)diff --git a/app/ui/icons/GithubLight.tsx b/app/ui/icons/GithubLight.tsxindex 1d319cf49..5d09885f7 100644--- a/app/ui/icons/GithubLight.tsx+++ b/app/ui/icons/GithubLight.tsx@@ -1,11 +1,14 @@import React from 'react'import PropTypes from 'prop-types'-const GithubLightSVG = ({ className }: {- className?: string,-}): JSX.Element => (+const GithubLightSVG = ({ className }: { className?: string }): JSX.Element => (<svg className={className} viewBox='0 0 100 100'>- <path fillRule='evenodd' clipRule='evenodd' d='M48.854 0C21.839 0 0 22 0 49.217c0 21.756 13.993 40.172 33.405 46.69 2.427.49 3.316-1.059 3.316-2.362 0-1.141-.08-5.052-.08-9.127-13.59 2.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.015.324-3.015.324-3.015 4.934.326 7.523 5.052 7.523 5.052 4.367 7.496 11.404 5.378 14.235 4.074.404-3.178 1.699-5.378 3.074-6.6-10.839-1.141-22.243-5.378-22.243-24.283 0-5.378 1.94-9.778 5.014-13.2-.485-1.222-2.184-6.275.486-13.038 0 0 4.125-1.304 13.426 5.052a46.97 46.97 0 0 1 12.214-1.63c4.125 0 8.33.571 12.213 1.63 9.302-6.356 13.427-5.052 13.427-5.052 2.67 6.763.97 11.816.485 13.038 3.155 3.422 5.015 7.822 5.015 13.2 0 18.905-11.404 23.06-22.324 24.283 1.78 1.548 3.316 4.481 3.316 9.126 0 6.6-.08 11.897-.08 13.526 0 1.304.89 2.853 3.316 2.364 19.412-6.52 33.405-24.935 33.405-46.691C97.707 22 75.788 0 48.854 0z' fill='#fff' />+ <path+ fillRule='evenodd'+ clipRule='evenodd'+ d='M48.854 0C21.839 0 0 22 0 49.217c0 21.756 13.993 40.172 33.405 46.69 2.427.49 3.316-1.059 3.316-2.362 0-1.141-.08-5.052-.08-9.127-13.59 2.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.015.324-3.015.324-3.015 4.934.326 7.523 5.052 7.523 5.052 4.367 7.496 11.404 5.378 14.235 4.074.404-3.178 1.699-5.378 3.074-6.6-10.839-1.141-22.243-5.378-22.243-24.283 0-5.378 1.94-9.778 5.014-13.2-.485-1.222-2.184-6.275.486-13.038 0 0 4.125-1.304 13.426 5.052a46.97 46.97 0 0 1 12.214-1.63c4.125 0 8.33.571 12.213 1.63 9.302-6.356 13.427-5.052 13.427-5.052 2.67 6.763.97 11.816.485 13.038 3.155 3.422 5.015 7.822 5.015 13.2 0 18.905-11.404 23.06-22.324 24.283 1.78 1.548 3.316 4.481 3.316 9.126 0 6.6-.08 11.897-.08 13.526 0 1.304.89 2.853 3.316 2.364 19.412-6.52 33.405-24.935 33.405-46.691C97.707 22 75.788 0 48.854 0z'+ fill='#fff'+ /></svg>)diff --git a/app/ui/icons/GoogleG.tsx b/app/ui/icons/GoogleG.tsxindex dff58364a..679979ec5 100644--- a/app/ui/icons/GoogleG.tsx+++ b/app/ui/icons/GoogleG.tsx@@ -1,15 +1,33 @@import React from 'react'import PropTypes from 'prop-types'-const GoogleGSVG = ({ className }: {- className?: string,-}): JSX.Element => (+const GoogleGSVG = ({ className }: { className?: string }): JSX.Element => (<svg className={className} viewBox='0 0 186.69 190.5'><g transform='translate(1184.583 765.171)'>- <path clipPath='none' mask='none' d='M-1089.333-687.239v36.888h51.262c-2.251 11.863-9.006 21.908-19.137 28.662l30.913 23.986c18.011-16.625 28.402-41.044 28.402-70.052 0-6.754-.606-13.249-1.732-19.483z' fill='#4285f4' />- <path clipPath='none' mask='none' d='M-1142.714-651.791l-6.972 5.337-24.679 19.223h0c15.673 31.086 47.796 52.561 85.03 52.561 25.717 0 47.278-8.486 63.038-23.033l-30.913-23.986c-8.486 5.715-19.31 9.179-32.125 9.179-24.765 0-45.806-16.712-53.34-39.226z' fill='#34a853' />- <path clipPath='none' mask='none' d='M-1174.365-712.61c-6.494 12.815-10.217 27.276-10.217 42.689s3.723 29.874 10.217 42.689c0 .086 31.693-24.592 31.693-24.592-1.905-5.715-3.031-11.776-3.031-18.098s1.126-12.383 3.031-18.098z' fill='#fbbc05' />- <path clipPath='none' mask='none' d='M-1089.333-727.244c14.028 0 26.497 4.849 36.455 14.201l27.276-27.276c-16.539-15.413-38.013-24.852-63.731-24.852-37.234 0-69.359 21.388-85.032 52.561l31.692 24.592c7.533-22.514 28.575-39.226 53.34-39.226z' fill='#ea4335' />+ <path+ clipPath='none'+ mask='none'+ d='M-1089.333-687.239v36.888h51.262c-2.251 11.863-9.006 21.908-19.137 28.662l30.913 23.986c18.011-16.625 28.402-41.044 28.402-70.052 0-6.754-.606-13.249-1.732-19.483z'+ fill='#4285f4'+ />+ <path+ clipPath='none'+ mask='none'+ d='M-1142.714-651.791l-6.972 5.337-24.679 19.223h0c15.673 31.086 47.796 52.561 85.03 52.561 25.717 0 47.278-8.486 63.038-23.033l-30.913-23.986c-8.486 5.715-19.31 9.179-32.125 9.179-24.765 0-45.806-16.712-53.34-39.226z'+ fill='#34a853'+ />+ <path+ clipPath='none'+ mask='none'+ d='M-1174.365-712.61c-6.494 12.815-10.217 27.276-10.217 42.689s3.723 29.874 10.217 42.689c0 .086 31.693-24.592 31.693-24.592-1.905-5.715-3.031-11.776-3.031-18.098s1.126-12.383 3.031-18.098z'+ fill='#fbbc05'+ />+ <path+ clipPath='none'+ mask='none'+ d='M-1089.333-727.244c14.028 0 26.497 4.849 36.455 14.201l27.276-27.276c-16.539-15.413-38.013-24.852-63.731-24.852-37.234 0-69.359 21.388-85.032 52.561l31.692 24.592c7.533-22.514 28.575-39.226 53.34-39.226z'+ fill='#ea4335'+ /></g></svg>)diff --git a/app/ui/icons/LineChart.tsx b/app/ui/icons/LineChart.tsxindex 497abe9fb..4aea104a7 100644--- a/app/ui/icons/LineChart.tsx+++ b/app/ui/icons/LineChart.tsx@@ -3,12 +3,11 @@ import cx from 'clsx'import PropTypes from 'prop-types'interface ILineChart {- className?: string,+ className?: string}const LineChart = ({ className }: ILineChart): JSX.Element => (- <svg- className={cx('fill-gray-700 dark:fill-gray-50', className)} viewBox='0 0 512 512'>+ <svg className={cx('fill-gray-700 dark:fill-gray-50', className)} viewBox='0 0 512 512'>{/* Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2023 Fonticons, Inc. */}<path d='M64 64c0-17.7-14.3-32-32-32S0 46.3 0 64V400c0 44.2 35.8 80 80 80H480c17.7 0 32-14.3 32-32s-14.3-32-32-32H80c-8.8 0-16-7.2-16-16V64zm406.6 86.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L320 210.7l-57.4-57.4c-12.5-12.5-32.8-12.5-45.3 0l-112 112c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L240 221.3l57.4 57.4c12.5 12.5 32.8 12.5 45.3 0l128-128z' /></svg>diff --git a/app/ui/icons/NextJS.tsx b/app/ui/icons/NextJS.tsxindex 81dfcb433..6dab01677 100644--- a/app/ui/icons/NextJS.tsx+++ b/app/ui/icons/NextJS.tsx@@ -2,10 +2,7 @@ import React from 'react'import cx from 'clsx'import PropTypes from 'prop-types'-const NextJS = ({ theme, className }: {- theme: 'dark' | 'light',- className?: string,-}): JSX.Element => (+const NextJS = ({ theme, className }: { theme: 'dark' | 'light'; className?: string }): JSX.Element => (<svgclassName={cx(className, {'fill-white': theme === 'dark',@@ -13,9 +10,7 @@ const NextJS = ({ theme, className }: {})}viewBox='0 0 148 90'>- <title>- NextJS framework- </title>+ <title>NextJS framework</title><pathd='M34.992 23.495h27.855v2.219H37.546v16.699h23.792v2.219H37.546v18.334h25.591v2.219H34.992v-41.69zm30.35 0h2.96l13.115 18.334 13.405-18.334L113.055.207 83.1 43.756l15.436 21.429H95.46L81.417 45.683 67.316 65.185h-3.018L79.85 43.756 65.343 23.495zm34.297 2.219v-2.219h31.742v2.219h-14.623v39.47h-2.554v-39.47H99.64zM.145 23.495h3.192l44.011 66.003L29.16 65.185 2.814 26.648l-.116 38.537H.145v-41.69zm130.98 38.801c-.523 0-.914-.405-.914-.928 0-.524.391-.929.913-.929.528 0 .913.405.913.929 0 .523-.385.928-.913.928zm2.508-2.443H135c.019.742.56 1.24 1.354 1.24.888 0 1.391-.535 1.391-1.539v-6.356h1.391v6.362c0 1.808-1.043 2.849-2.77 2.849-1.62 0-2.732-1.01-2.732-2.556zm7.322-.08h1.379c.118.853.95 1.395 2.149 1.395 1.117 0 1.937-.58 1.937-1.377 0-.685-.521-1.097-1.708-1.377l-1.155-.28c-1.62-.38-2.36-1.166-2.36-2.487 0-1.602 1.304-2.668 3.26-2.668 1.82 0 3.15 1.066 3.23 2.58h-1.354c-.13-.828-.85-1.346-1.894-1.346-1.1 0-1.832.53-1.832 1.34 0 .642.472 1.01 1.64 1.284l.987.243c1.838.43 2.596 1.178 2.596 2.53 0 1.72-1.33 2.799-3.453 2.799-1.987 0-3.323-1.029-3.422-2.637z'fillRule='nonzero'diff --git a/app/ui/icons/Notion.tsx b/app/ui/icons/Notion.tsxindex 7307e0b32..a2a62bd50 100644--- a/app/ui/icons/Notion.tsx+++ b/app/ui/icons/Notion.tsx@@ -2,10 +2,7 @@ import React from 'react'import cx from 'clsx'import PropTypes from 'prop-types'-const Notion = ({ theme, className }: {- theme: 'dark' | 'light',- className?: string,-}): JSX.Element => {+const Notion = ({ theme, className }: { theme: 'dark' | 'light'; className?: string }): JSX.Element => {const cn = cx(className, {'fill-white': theme === 'dark','fill-slate-800': theme === 'light',@@ -13,12 +10,21 @@ const Notion = ({ theme, className }: {return (<svg className={className} viewBox='0 0 87 30' fill='none'>- <title>- Notion- </title>- <path d='M1.805 1.294l16.6-1.226c2.039-.175 2.563-.057 3.845.875l5.299 3.733c.874.642 1.165.817 1.165 1.516v20.473c0 1.283-.466 2.042-2.097 2.158L7.34 29.99c-1.224.058-1.807-.117-2.448-.934L.99 23.982c-.7-.934-.99-1.633-.99-2.45V3.334c0-1.049.466-1.924 1.805-2.04z' fill='#fff' />- <path fillRule='evenodd' clipRule='evenodd' d='M18.405.068l-16.6 1.226C.466 1.41 0 2.285 0 3.334v18.198c0 .817.29 1.516.99 2.45l3.902 5.074c.641.817 1.224.992 2.448.934l19.277-1.167c1.63-.116 2.097-.875 2.097-2.158V6.192c0-.663-.262-.854-1.033-1.42a85.473 85.473 0 01-.133-.096L22.25.943c-1.282-.932-1.806-1.05-3.845-.875zM7.776 5.857c-1.574.106-1.931.13-2.825-.597L2.678 3.452c-.231-.234-.115-.526.467-.584l15.958-1.166c1.34-.117 2.038.35 2.562.758l2.737 1.983c.117.059.408.408.058.408l-16.48.992-.204.014zM5.941 26.49V9.11c0-.759.233-1.109.931-1.168L25.8 6.834c.642-.058.932.35.932 1.108v17.264c0 .759-.117 1.401-1.165 1.459l-18.113 1.05c-1.048.058-1.513-.291-1.513-1.225zm17.88-16.448c.116.525 0 1.05-.525 1.11l-.873.173v12.832c-.758.408-1.456.641-2.039.641-.932 0-1.165-.292-1.863-1.166l-5.709-8.982v8.69l1.806.409s0 1.05-1.457 1.05l-4.017.233c-.117-.234 0-.817.407-.933l1.049-.291v-11.49L9.144 12.2c-.117-.525.174-1.283.99-1.342l4.31-.29 5.94 9.098v-8.049l-1.514-.174c-.117-.643.349-1.11.931-1.167l4.02-.234z' fill='#000' />- <path d='M41.434 21.251v-7.91h.137l5.704 7.91h1.796V9.627h-1.997v7.902h-.137l-5.704-7.902H39.43V21.25h2.005zM54.715 21.429c2.635 0 4.238-1.724 4.238-4.584 0-2.852-1.611-4.584-4.238-4.584-2.618 0-4.237 1.74-4.237 4.584 0 2.86 1.595 4.584 4.237 4.584zm0-1.676c-1.393 0-2.19-1.063-2.19-2.908 0-1.837.797-2.908 2.19-2.908 1.386 0 2.183 1.071 2.183 2.908 0 1.845-.789 2.908-2.183 2.908zM60.778 10.28v2.215h-1.393v1.595h1.393v4.809c0 1.708.806 2.393 2.828 2.393.386 0 .757-.04 1.047-.097v-1.563c-.242.024-.395.04-.677.04-.837 0-1.208-.386-1.208-1.256V14.09h1.885v-1.595h-1.885v-2.216h-1.99zM65.85 21.251h1.99v-8.813h-1.99v8.813zm.991-10.27c.66 0 1.192-.533 1.192-1.201 0-.669-.531-1.209-1.192-1.209-.652 0-1.192.54-1.192 1.209 0 .668.54 1.2 1.192 1.2zM73.299 21.429c2.634 0 4.237-1.724 4.237-4.584 0-2.852-1.611-4.584-4.237-4.584-2.619 0-4.238 1.74-4.238 4.584 0 2.86 1.595 4.584 4.238 4.584zm0-1.676c-1.394 0-2.192-1.063-2.192-2.908 0-1.837.798-2.908 2.192-2.908 1.385 0 2.183 1.071 2.183 2.908 0 1.845-.79 2.908-2.183 2.908zM78.725 21.251h1.998V16.12c0-1.297.75-2.119 1.941-2.119 1.217 0 1.78.677 1.78 2.022v5.228h1.999v-5.703c0-2.103-1.072-3.287-3.037-3.287-1.314 0-2.2.604-2.619 1.587h-.137v-1.41h-1.925v8.813z' className={cn} />+ <title>Notion</title>+ <path+ d='M1.805 1.294l16.6-1.226c2.039-.175 2.563-.057 3.845.875l5.299 3.733c.874.642 1.165.817 1.165 1.516v20.473c0 1.283-.466 2.042-2.097 2.158L7.34 29.99c-1.224.058-1.807-.117-2.448-.934L.99 23.982c-.7-.934-.99-1.633-.99-2.45V3.334c0-1.049.466-1.924 1.805-2.04z'+ fill='#fff'+ />+ <path+ fillRule='evenodd'+ clipRule='evenodd'+ d='M18.405.068l-16.6 1.226C.466 1.41 0 2.285 0 3.334v18.198c0 .817.29 1.516.99 2.45l3.902 5.074c.641.817 1.224.992 2.448.934l19.277-1.167c1.63-.116 2.097-.875 2.097-2.158V6.192c0-.663-.262-.854-1.033-1.42a85.473 85.473 0 01-.133-.096L22.25.943c-1.282-.932-1.806-1.05-3.845-.875zM7.776 5.857c-1.574.106-1.931.13-2.825-.597L2.678 3.452c-.231-.234-.115-.526.467-.584l15.958-1.166c1.34-.117 2.038.35 2.562.758l2.737 1.983c.117.059.408.408.058.408l-16.48.992-.204.014zM5.941 26.49V9.11c0-.759.233-1.109.931-1.168L25.8 6.834c.642-.058.932.35.932 1.108v17.264c0 .759-.117 1.401-1.165 1.459l-18.113 1.05c-1.048.058-1.513-.291-1.513-1.225zm17.88-16.448c.116.525 0 1.05-.525 1.11l-.873.173v12.832c-.758.408-1.456.641-2.039.641-.932 0-1.165-.292-1.863-1.166l-5.709-8.982v8.69l1.806.409s0 1.05-1.457 1.05l-4.017.233c-.117-.234 0-.817.407-.933l1.049-.291v-11.49L9.144 12.2c-.117-.525.174-1.283.99-1.342l4.31-.29 5.94 9.098v-8.049l-1.514-.174c-.117-.643.349-1.11.931-1.167l4.02-.234z'+ fill='#000'+ />+ <path+ d='M41.434 21.251v-7.91h.137l5.704 7.91h1.796V9.627h-1.997v7.902h-.137l-5.704-7.902H39.43V21.25h2.005zM54.715 21.429c2.635 0 4.238-1.724 4.238-4.584 0-2.852-1.611-4.584-4.238-4.584-2.618 0-4.237 1.74-4.237 4.584 0 2.86 1.595 4.584 4.237 4.584zm0-1.676c-1.393 0-2.19-1.063-2.19-2.908 0-1.837.797-2.908 2.19-2.908 1.386 0 2.183 1.071 2.183 2.908 0 1.845-.789 2.908-2.183 2.908zM60.778 10.28v2.215h-1.393v1.595h1.393v4.809c0 1.708.806 2.393 2.828 2.393.386 0 .757-.04 1.047-.097v-1.563c-.242.024-.395.04-.677.04-.837 0-1.208-.386-1.208-1.256V14.09h1.885v-1.595h-1.885v-2.216h-1.99zM65.85 21.251h1.99v-8.813h-1.99v8.813zm.991-10.27c.66 0 1.192-.533 1.192-1.201 0-.669-.531-1.209-1.192-1.209-.652 0-1.192.54-1.192 1.209 0 .668.54 1.2 1.192 1.2zM73.299 21.429c2.634 0 4.237-1.724 4.237-4.584 0-2.852-1.611-4.584-4.237-4.584-2.619 0-4.238 1.74-4.238 4.584 0 2.86 1.595 4.584 4.238 4.584zm0-1.676c-1.394 0-2.192-1.063-2.192-2.908 0-1.837.798-2.908 2.192-2.908 1.385 0 2.183 1.071 2.183 2.908 0 1.845-.79 2.908-2.183 2.908zM78.725 21.251h1.998V16.12c0-1.297.75-2.119 1.941-2.119 1.217 0 1.78.677 1.78 2.022v5.228h1.999v-5.703c0-2.103-1.072-3.287-3.037-3.287-1.314 0-2.2.604-2.619 1.587h-.137v-1.41h-1.925v8.813z'+ className={cn}+ /></svg>)}diff --git a/app/ui/icons/NuxtJS.tsx b/app/ui/icons/NuxtJS.tsxindex 0029db17e..322dbd989 100644--- a/app/ui/icons/NuxtJS.tsx+++ b/app/ui/icons/NuxtJS.tsx@@ -2,10 +2,7 @@ import React from 'react'import cx from 'clsx'import PropTypes from 'prop-types'-const NuxtJS = ({ theme, className }: {- theme: 'dark' | 'light',- className?: string,-}): JSX.Element => {+const NuxtJS = ({ theme, className }: { theme: 'dark' | 'light'; className?: string }): JSX.Element => {const cn = cx({'fill-white': theme === 'dark','fill-slate-800': theme === 'light',@@ -13,17 +10,41 @@ const NuxtJS = ({ theme, className }: {return (<svg className={className} viewBox='0 0 221 65' fill='none'>- <title>- NuxtJS- </title>- <path d='M76.333 20.5005H82.8185L96.5631 42.4764V20.5005H102.55V51.6393H96.1087L82.3198 29.7091V51.6393H76.333V20.5005Z' className={cn} />- <path d='M129.311 51.6393H123.732V48.1611C122.462 50.6089 119.877 51.9871 116.612 51.9871C111.441 51.9871 108.083 48.3393 108.083 43.0894V29.2178H113.662V41.9416C113.662 45.0111 115.568 47.1459 118.425 47.1459C121.555 47.1459 123.732 44.7437 123.732 41.4524V29.2178H129.311V51.6393Z' className={cn} />- <path d='M148.724 51.2848L143.372 43.811L138.019 51.2848H132.076L140.333 39.5849L132.712 28.8633H138.79L143.372 35.3154L147.906 28.8633H154.031L146.364 39.5849L154.62 51.2848H148.724Z' className={cn} />- <path d='M165.96 22.4565V29.2173H172.311V33.7999H165.96V44.9302C165.96 45.304 166.111 45.6626 166.381 45.9271C166.65 46.1916 167.015 46.3405 167.397 46.3411H172.311V51.6302H168.636C163.646 51.6302 160.381 48.7824 160.381 43.8042V33.8043H155.891V29.2173H158.708C160.022 29.2173 160.787 28.45 160.787 27.1804V22.4565H165.96Z' className={cn} />- <path d='M186.374 44.5872V20.5005H192.359V42.7416C192.359 48.748 189.411 51.6393 184.422 51.6393H177.455V46.3502H184.577C185.053 46.3502 185.511 46.1645 185.848 45.8339C186.185 45.5032 186.374 45.0548 186.374 44.5872' className={cn} />- <path d='M195.945 41.1847H201.708C202.027 44.6629 204.386 46.8781 208.196 46.8781C211.598 46.8781 213.959 45.5455 213.959 42.7869C213.959 36.113 196.892 40.739 196.892 28.8174C196.896 23.7023 201.387 20.1479 207.839 20.1479C214.553 20.1479 219.088 23.9283 219.365 29.7565H213.633C213.363 27.0435 211.195 25.2196 207.828 25.2196C204.698 25.2196 202.748 26.6435 202.748 28.8218C202.748 35.7174 220.037 30.5609 220.037 42.7021C220.037 48.4846 215.182 51.9998 208.198 51.9998C200.986 51.9998 196.269 47.7281 195.952 41.189' className={cn} />- <path fillRule='evenodd' clipRule='evenodd' d='M29.7513 14.261C28.0767 11.3817 23.8903 11.3817 22.2157 14.261L3.96535 45.641C2.29077 48.5204 4.38399 52.1195 7.73316 52.1195H21.9804C20.5493 50.8688 20.0193 48.7051 21.1023 46.8487L34.9243 23.1556L29.7513 14.261Z' fill='#80EEC0' />- <path d='M41.3151 21.1443C42.701 18.7885 46.1656 18.7885 47.5515 21.1443L62.6552 46.8188C64.0411 49.1746 62.3088 52.1194 59.537 52.1194H29.3296C26.5579 52.1194 24.8255 49.1746 26.2114 46.8188L41.3151 21.1443Z' fill='#00DC82' />+ <title>NuxtJS</title>+ <path+ d='M76.333 20.5005H82.8185L96.5631 42.4764V20.5005H102.55V51.6393H96.1087L82.3198 29.7091V51.6393H76.333V20.5005Z'+ className={cn}+ />+ <path+ d='M129.311 51.6393H123.732V48.1611C122.462 50.6089 119.877 51.9871 116.612 51.9871C111.441 51.9871 108.083 48.3393 108.083 43.0894V29.2178H113.662V41.9416C113.662 45.0111 115.568 47.1459 118.425 47.1459C121.555 47.1459 123.732 44.7437 123.732 41.4524V29.2178H129.311V51.6393Z'+ className={cn}+ />+ <path+ d='M148.724 51.2848L143.372 43.811L138.019 51.2848H132.076L140.333 39.5849L132.712 28.8633H138.79L143.372 35.3154L147.906 28.8633H154.031L146.364 39.5849L154.62 51.2848H148.724Z'+ className={cn}+ />+ <path+ d='M165.96 22.4565V29.2173H172.311V33.7999H165.96V44.9302C165.96 45.304 166.111 45.6626 166.381 45.9271C166.65 46.1916 167.015 46.3405 167.397 46.3411H172.311V51.6302H168.636C163.646 51.6302 160.381 48.7824 160.381 43.8042V33.8043H155.891V29.2173H158.708C160.022 29.2173 160.787 28.45 160.787 27.1804V22.4565H165.96Z'+ className={cn}+ />+ <path+ d='M186.374 44.5872V20.5005H192.359V42.7416C192.359 48.748 189.411 51.6393 184.422 51.6393H177.455V46.3502H184.577C185.053 46.3502 185.511 46.1645 185.848 45.8339C186.185 45.5032 186.374 45.0548 186.374 44.5872'+ className={cn}+ />+ <path+ d='M195.945 41.1847H201.708C202.027 44.6629 204.386 46.8781 208.196 46.8781C211.598 46.8781 213.959 45.5455 213.959 42.7869C213.959 36.113 196.892 40.739 196.892 28.8174C196.896 23.7023 201.387 20.1479 207.839 20.1479C214.553 20.1479 219.088 23.9283 219.365 29.7565H213.633C213.363 27.0435 211.195 25.2196 207.828 25.2196C204.698 25.2196 202.748 26.6435 202.748 28.8218C202.748 35.7174 220.037 30.5609 220.037 42.7021C220.037 48.4846 215.182 51.9998 208.198 51.9998C200.986 51.9998 196.269 47.7281 195.952 41.189'+ className={cn}+ />+ <path+ fillRule='evenodd'+ clipRule='evenodd'+ d='M29.7513 14.261C28.0767 11.3817 23.8903 11.3817 22.2157 14.261L3.96535 45.641C2.29077 48.5204 4.38399 52.1195 7.73316 52.1195H21.9804C20.5493 50.8688 20.0193 48.7051 21.1023 46.8487L34.9243 23.1556L29.7513 14.261Z'+ fill='#80EEC0'+ />+ <path+ d='M41.3151 21.1443C42.701 18.7885 46.1656 18.7885 47.5515 21.1443L62.6552 46.8188C64.0411 49.1746 62.3088 52.1194 59.537 52.1194H29.3296C26.5579 52.1194 24.8255 49.1746 26.2114 46.8188L41.3151 21.1443Z'+ fill='#00DC82'+ /></svg>)}diff --git a/app/ui/icons/PulsatingCircle.tsx b/app/ui/icons/PulsatingCircle.tsxindex 85ada8fbb..f2c954561 100644--- a/app/ui/icons/PulsatingCircle.tsx+++ b/app/ui/icons/PulsatingCircle.tsx@@ -13,10 +13,7 @@ const types = {},}-const PulsatingCircle = ({ className, type }: {- className?: string,- type: 'small' | 'big',-}): JSX.Element => (+const PulsatingCircle = ({ className, type }: { className?: string; type: 'small' | 'big' }): JSX.Element => (<span className={cx('flex justify-center items-center', types[type]?.pulse, className)}><span className={cx('animate-ping-slow absolute inline-flex rounded-full bg-green-400', types[type]?.pulse)} /><span className={cx('relative inline-flex rounded-full bg-green-500', types[type]?.base)} />diff --git a/app/ui/icons/Quote.tsx b/app/ui/icons/Quote.tsxindex 8818ce119..bde094bf6 100644--- a/app/ui/icons/Quote.tsx+++ b/app/ui/icons/Quote.tsx@@ -2,10 +2,14 @@ import React from 'react'import cx from 'clsx'import PropTypes from 'prop-types'-const Quote = ({ theme, className, color }: {- theme: 'light' | 'dark',- className?: string,- color: 'black' | 'indigo',+const Quote = ({+ theme,+ className,+ color,+}: {+ theme: 'light' | 'dark'+ className?: string+ color: 'black' | 'indigo'}): JSX.Element => (<svgclassName={cx(className, {diff --git a/app/ui/icons/ReactSVG.tsx b/app/ui/icons/ReactSVG.tsxindex 872a3d381..d524fd83c 100644--- a/app/ui/icons/ReactSVG.tsx+++ b/app/ui/icons/ReactSVG.tsx@@ -1,13 +1,9 @@import React from 'react'import PropTypes from 'prop-types'-const ReactSVG = ({ className }: {- className?: string,-}): JSX.Element => (+const ReactSVG = ({ className }: { className?: string }): JSX.Element => (<svg className={className} viewBox='175.7 78 490.6 436.9'>- <title>- React.js- </title>+ <title>React.js</title><g className='fill-[#61dafb]'><path d='m666.3 296.5c0-32.5-40.7-63.3-103.1-82.4 14.4-63.6 8-114.2-20.2-130.4-6.5-3.8-14.1-5.6-22.4-5.6v22.3c4.6 0 8.3.9 11.4 2.6 13.6 7.8 19.5 37.5 14.9 75.7-1.1 9.4-2.9 19.3-5.1 29.4-19.6-4.8-41-8.5-63.5-10.9-13.5-18.5-27.5-35.3-41.6-50 32.6-30.3 63.2-46.9 84-46.9v-22.3c-27.5 0-63.5 19.6-99.9 53.6-36.4-33.8-72.4-53.2-99.9-53.2v22.3c20.7 0 51.4 16.5 84 46.6-14 14.7-28 31.4-41.3 49.9-22.6 2.4-44 6.1-63.6 11-2.3-10-4-19.7-5.2-29-4.7-38.2 1.1-67.9 14.6-75.8 3-1.8 6.9-2.6 11.5-2.6v-22.3c-8.4 0-16 1.8-22.6 5.6-28.1 16.2-34.4 66.7-19.9 130.1-62.2 19.2-102.7 49.9-102.7 82.3 0 32.5 40.7 63.3 103.1 82.4-14.4 63.6-8 114.2 20.2 130.4 6.5 3.8 14.1 5.6 22.5 5.6 27.5 0 63.5-19.6 99.9-53.6 36.4 33.8 72.4 53.2 99.9 53.2 8.4 0 16-1.8 22.6-5.6 28.1-16.2 34.4-66.7 19.9-130.1 62-19.1 102.5-49.9 102.5-82.3zm-130.2-66.7c-3.7 12.9-8.3 26.2-13.5 39.5-4.1-8-8.4-16-13.1-24-4.6-8-9.5-15.8-14.4-23.4 14.2 2.1 27.9 4.7 41 7.9zm-45.8 106.5c-7.8 13.5-15.8 26.3-24.1 38.2-14.9 1.3-30 2-45.2 2-15.1 0-30.2-.7-45-1.9-8.3-11.9-16.4-24.6-24.2-38-7.6-13.1-14.5-26.4-20.8-39.8 6.2-13.4 13.2-26.8 20.7-39.9 7.8-13.5 15.8-26.3 24.1-38.2 14.9-1.3 30-2 45.2-2 15.1 0 30.2.7 45 1.9 8.3 11.9 16.4 24.6 24.2 38 7.6 13.1 14.5 26.4 20.8 39.8-6.3 13.4-13.2 26.8-20.7 39.9zm32.3-13c5.4 13.4 10 26.8 13.8 39.8-13.1 3.2-26.9 5.9-41.2 8 4.9-7.7 9.8-15.6 14.4-23.7 4.6-8 8.9-16.1 13-24.1zm-101.4 106.7c-9.3-9.6-18.6-20.3-27.8-32 9 .4 18.2.7 27.5.7 9.4 0 18.7-.2 27.8-.7-9 11.7-18.3 22.4-27.5 32zm-74.4-58.9c-14.2-2.1-27.9-4.7-41-7.9 3.7-12.9 8.3-26.2 13.5-39.5 4.1 8 8.4 16 13.1 24s9.5 15.8 14.4 23.4zm73.9-208.1c9.3 9.6 18.6 20.3 27.8 32-9-.4-18.2-.7-27.5-.7-9.4 0-18.7.2-27.8.7 9-11.7 18.3-22.4 27.5-32zm-74 58.9c-4.9 7.7-9.8 15.6-14.4 23.7-4.6 8-8.9 16-13 24-5.4-13.4-10-26.8-13.8-39.8 13.1-3.1 26.9-5.8 41.2-7.9zm-90.5 125.2c-35.4-15.1-58.3-34.9-58.3-50.6s22.9-35.6 58.3-50.6c8.6-3.7 18-7 27.7-10.1 5.7 19.6 13.2 40 22.5 60.9-9.2 20.8-16.6 41.1-22.2 60.6-9.9-3.1-19.3-6.5-28-10.2zm53.8 142.9c-13.6-7.8-19.5-37.5-14.9-75.7 1.1-9.4 2.9-19.3 5.1-29.4 19.6 4.8 41 8.5 63.5 10.9 13.5 18.5 27.5 35.3 41.6 50-32.6 30.3-63.2 46.9-84 46.9-4.5-.1-8.3-1-11.3-2.7zm237.2-76.2c4.7 38.2-1.1 67.9-14.6 75.8-3 1.8-6.9 2.6-11.5 2.6-20.7 0-51.4-16.5-84-46.6 14-14.7 28-31.4 41.3-49.9 22.6-2.4 44-6.1 63.6-11 2.3 10.1 4.1 19.8 5.2 29.1zm38.5-66.7c-8.6 3.7-18 7-27.7 10.1-5.7-19.6-13.2-40-22.5-60.9 9.2-20.8 16.6-41.1 22.2-60.6 9.9 3.1 19.3 6.5 28.1 10.2 35.4 15.1 58.3 34.9 58.3 50.6-.1 15.7-23 35.6-58.4 50.6z' /><circle cx='420.9' cy='296.5' r='45.7' />diff --git a/app/ui/icons/Robot.tsx b/app/ui/icons/Robot.tsxindex a2e83f91c..c44e0bc6f 100644--- a/app/ui/icons/Robot.tsx+++ b/app/ui/icons/Robot.tsx@@ -3,21 +3,29 @@ import cx from 'clsx'import PropTypes from 'prop-types'interface IRobot {- className?: string,- containerClassName?: string,+ className?: string+ containerClassName?: stringtheme: 'dark' | 'light'}-const Robot: React.FC<IRobot> = ({- className, containerClassName, theme,-}): JSX.Element => {+const Robot: React.FC<IRobot> = ({ className, containerClassName, theme }): JSX.Element => {const cn = cx(className, {'fill-text-gray-700': theme === 'dark','fill-white': theme === 'light',})return (- <svg className={containerClassName} width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' strokeWidth='2' strokeLinecap='round' strokeLinejoin='round'>+ <svg+ className={containerClassName}+ width='24'+ height='24'+ viewBox='0 0 24 24'+ fill='none'+ stroke='currentColor'+ strokeWidth='2'+ strokeLinecap='round'+ strokeLinejoin='round'+ ><rect x='3' y='11' width='18' height='10' rx='2' className={cn} /><circle cx='12' cy='5' r='2' className={cn} /><path d='M12 7v4' className={cn} />diff --git a/app/ui/icons/Sort.tsx b/app/ui/icons/Sort.tsxindex e176c40a6..ba84d1f2b 100644--- a/app/ui/icons/Sort.tsx+++ b/app/ui/icons/Sort.tsx@@ -3,29 +3,21 @@ import { ChevronUpDownIcon, ChevronUpIcon, ChevronDownIcon } from '@heroicons/reimport cx from 'clsx'interface ISort {- sortByAscend?: boolean,- sortByDescend?: boolean,- className?: string,+ sortByAscend?: boolean+ sortByDescend?: boolean+ className?: string}-const Sort: React.FC<ISort> = ({- sortByAscend, sortByDescend, className,-}: ISort): JSX.Element => {+const Sort: React.FC<ISort> = ({ sortByAscend, sortByDescend, className }: ISort): JSX.Element => {if (sortByAscend) {- return (- <ChevronUpIcon className={cx(className, 'w-4 h-4')} />- )+ return <ChevronUpIcon className={cx(className, 'w-4 h-4')} />}if (sortByDescend) {- return (- <ChevronDownIcon className={cx(className, 'w-4 h-4')} />- )+ return <ChevronDownIcon className={cx(className, 'w-4 h-4')} />}- return (- <ChevronUpDownIcon className={cx(className, 'w-4 h-4')} />- )+ return <ChevronUpDownIcon className={cx(className, 'w-4 h-4')} />}Sort.defaultProps = {diff --git a/app/ui/icons/Spin.tsx b/app/ui/icons/Spin.tsxindex cab889949..0f2cfadcd 100644--- a/app/ui/icons/Spin.tsx+++ b/app/ui/icons/Spin.tsx@@ -3,22 +3,30 @@ import cx from 'clsx'import PropTypes from 'prop-types'interface ISpin {- className?: string,- alwaysLight?: boolean,+ className?: string+ alwaysLight?: boolean}const Spin = ({ className, alwaysLight }: ISpin): JSX.Element => (<svg- className={cx('animate-spin -ml-1 mr-2 h-4 w-4 text-slate-900 dark:text-white', {- 'text-slate-900 dark:text-white': !alwaysLight,- 'text-white': alwaysLight,- }, className)}+ className={cx(+ 'animate-spin -ml-1 mr-2 h-4 w-4 text-slate-900 dark:text-white',+ {+ 'text-slate-900 dark:text-white': !alwaysLight,+ 'text-white': alwaysLight,+ },+ className,+ )}xmlns='http://www.w3.org/2000/svg'fill='none'viewBox='0 0 24 24'><circle className='opacity-25' cx='12' cy='12' r='10' stroke='currentColor' strokeWidth='4' />- <path className='opacity-75' fill='currentColor' d='M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z' />+ <path+ className='opacity-75'+ fill='currentColor'+ d='M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z'+ /></svg>)diff --git a/app/ui/icons/Telegram.tsx b/app/ui/icons/Telegram.tsxindex dd47de2ec..d20f26c1c 100644--- a/app/ui/icons/Telegram.tsx+++ b/app/ui/icons/Telegram.tsx@@ -1,13 +1,9 @@import React from 'react'import PropTypes from 'prop-types'-const Telegram = ({ className }: {- className?: string,-}): JSX.Element => (+const Telegram = ({ className }: { className?: string }): JSX.Element => (<svg className={className} viewBox='0 0 1000 1000'>- <title>- Telegram- </title>+ <title>Telegram</title><defs><linearGradient x1='50%' y1='0%' x2='50%' y2='99.2583404%' id='linearGradient-1'><stop stopColor='#2AABEE' offset='0%' />@@ -16,7 +12,11 @@ const Telegram = ({ className }: {</defs><g id='Artboard' stroke='none' strokeWidth={1} fill='none' fillRule='evenodd'><circle id='Oval' fill='url(#linearGradient-1)' cx='500' cy='500' r='500' />- <path d='M226.328419,494.722069 C372.088573,431.216685 469.284839,389.350049 517.917216,369.122161 C656.772535,311.36743 685.625481,301.334815 704.431427,301.003532 C708.567621,300.93067 717.815839,301.955743 723.806446,306.816707 C728.864797,310.92121 730.256552,316.46581 730.922551,320.357329 C731.588551,324.248848 732.417879,333.113828 731.758626,340.040666 C724.234007,419.102486 691.675104,610.964674 675.110982,699.515267 C668.10208,736.984342 654.301336,749.547532 640.940618,750.777006 C611.904684,753.448938 589.856115,731.588035 561.733393,713.153237 C517.726886,684.306416 492.866009,666.349181 450.150074,638.200013 C400.78442,605.66878 432.786119,587.789048 460.919462,558.568563 C468.282091,550.921423 596.21508,434.556479 598.691227,424.000355 C599.00091,422.680135 599.288312,417.758981 596.36474,415.160431 C593.441168,412.561881 589.126229,413.450484 586.012448,414.157198 C581.598758,415.158943 511.297793,461.625274 375.109553,553.556189 C355.154858,567.258623 337.080515,573.934908 320.886524,573.585046 C303.033948,573.199351 268.692754,563.490928 243.163606,555.192408 C211.851067,545.013936 186.964484,539.632504 189.131547,522.346309 C190.260287,513.342589 202.659244,504.134509 226.328419,494.722069 Z' id='Path-3' fill='#FFFFFF' />+ <path+ d='M226.328419,494.722069 C372.088573,431.216685 469.284839,389.350049 517.917216,369.122161 C656.772535,311.36743 685.625481,301.334815 704.431427,301.003532 C708.567621,300.93067 717.815839,301.955743 723.806446,306.816707 C728.864797,310.92121 730.256552,316.46581 730.922551,320.357329 C731.588551,324.248848 732.417879,333.113828 731.758626,340.040666 C724.234007,419.102486 691.675104,610.964674 675.110982,699.515267 C668.10208,736.984342 654.301336,749.547532 640.940618,750.777006 C611.904684,753.448938 589.856115,731.588035 561.733393,713.153237 C517.726886,684.306416 492.866009,666.349181 450.150074,638.200013 C400.78442,605.66878 432.786119,587.789048 460.919462,558.568563 C468.282091,550.921423 596.21508,434.556479 598.691227,424.000355 C599.00091,422.680135 599.288312,417.758981 596.36474,415.160431 C593.441168,412.561881 589.126229,413.450484 586.012448,414.157198 C581.598758,415.158943 511.297793,461.625274 375.109553,553.556189 C355.154858,567.258623 337.080515,573.934908 320.886524,573.585046 C303.033948,573.199351 268.692754,563.490928 243.163606,555.192408 C211.851067,545.013936 186.964484,539.632504 189.131547,522.346309 C190.260287,513.342589 202.659244,504.134509 226.328419,494.722069 Z'+ id='Path-3'+ fill='#FFFFFF'+ /></g></svg>)diff --git a/app/ui/icons/Webflow.tsx b/app/ui/icons/Webflow.tsxindex 2c4c56cb6..120b291b5 100644--- a/app/ui/icons/Webflow.tsx+++ b/app/ui/icons/Webflow.tsx@@ -2,19 +2,9 @@ import React from 'react'import cx from 'clsx'import PropTypes from 'prop-types'-const Webflow = ({ theme, className }: {- theme: 'dark' | 'light',- className?: string,-}): JSX.Element => (- <svg- className={className}- x='0px'- y='0px'- viewBox='0 0 808.3 203.3'- >- <title>- Webflow- </title>+const Webflow = ({ theme, className }: { theme: 'dark' | 'light'; className?: string }): JSX.Element => (+ <svg className={className} x='0px' y='0px' viewBox='0 0 808.3 203.3'>+ <title>Webflow</title><pathclassName={cx({'fill-white': theme === 'dark',diff --git a/app/ui/icons/Wix.tsx b/app/ui/icons/Wix.tsxindex a11689a67..93e4c6cce 100644--- a/app/ui/icons/Wix.tsx+++ b/app/ui/icons/Wix.tsx@@ -2,10 +2,7 @@ import React from 'react'import cx from 'clsx'import PropTypes from 'prop-types'-const Wix = ({ theme, className }: {- theme: 'dark' | 'light',- className?: string,-}): JSX.Element => (+const Wix = ({ theme, className }: { theme: 'dark' | 'light'; className?: string }): JSX.Element => (<svgclassName={cx(className, {'fill-white': theme === 'dark',@@ -15,9 +12,7 @@ const Wix = ({ theme, className }: {y='0'viewBox='0 0 311 121'>- <title>- Wix- </title>+ <title>Wix</title><path d='M178 2.3c-6 3-8.6 8.6-8.6 23.8 0 0 3-3 7.8-4.8 3.5-1.3 6-3 7.8-4.3 5.2-3.9 6-8.6 6-16.8C190.9 0.2 182.7-0.3 178 2.3z' /><path d='M141.3 5.8c-5.2 4.3-6.5 11.7-6.5 11.7l-16.8 64.4 -13.8-52.7c-1.3-5.6-3.9-12.5-7.8-17.3C91.6 5.8 81.6 5.4 80.4 5.4c-0.9 0-10.8 0.4-16 6.5 -3.9 4.8-6.5 11.7-7.8 17.3l-13 52.7L26.8 17.5c0 0-1.3-6.9-6.5-11.7C12.1-1.6 0 0.2 0 0.2l32 120.5c0 0 10.4 0.9 15.6-1.7 6.9-3.5 10.4-6 14.3-22.5 3.9-14.7 14.3-57.5 15.1-60.5 0.4-1.3 1.3-5.2 3.9-5.2 2.6 0 3.5 3.5 3.9 5.2 0.9 3 11.2 45.8 15.1 60.5 4.3 16.4 7.3 19 14.3 22.5 5.2 2.6 15.6 1.7 15.6 1.7L161.6 0.2C161.6 0.2 149.5-1.5 141.3 5.8z' /><path d='M190.9 19.6c0 0-2.2 3-6.5 5.6 -3 1.7-5.6 2.6-8.6 4.3 -5.2 2.6-6.5 5.2-6.5 9.1v1.3 6.5l0 0v1.3 72.6c0 0 8.2 0.9 13.4-1.7 6.9-3.5 8.2-6.9 8.2-21.6V24.4l0 0L190.9 19.6 190.9 19.6z' />diff --git a/app/ui/icons/Wordpress.tsx b/app/ui/icons/Wordpress.tsxindex a237c7828..5062b2e0c 100644--- a/app/ui/icons/Wordpress.tsx+++ b/app/ui/icons/Wordpress.tsx@@ -2,10 +2,7 @@ import React from 'react'import cx from 'clsx'import PropTypes from 'prop-types'-const Wordpress = ({ theme, className }: {- theme: 'dark' | 'light',- className?: string,-}): JSX.Element => (+const Wordpress = ({ theme, className }: { theme: 'dark' | 'light'; className?: string }): JSX.Element => (<svgclassName={cx(className, {'fill-white': theme === 'dark',@@ -13,10 +10,12 @@ const Wordpress = ({ theme, className }: {})}viewBox='0 0 170 36'>- <title>- Wordpress- </title>- <path d='M47.57 10l-2.79 10.72L41.99 10h-2.81l.65 2.3-2.45 8.78L34.7 10H32l3.8 14h2.96l2.28-7.49L43.17 24h2.95l4-14h-2.55zm28.39 4.06a9 9 0 0 0-1.86-.23c-3.4 0-5.26 2.27-5.26 5.6 0 3.31 1.86 4.82 4.05 4.82a5.45 5.45 0 0 0 3.2-1.17V24h2.33V10h-2.46v4.06zm0 7.08c-.8.73-1.55 1.13-2.34 1.13-1.36 0-2.23-.9-2.23-3.01 0-2.28 1.08-3.47 2.96-3.47.55 0 1.1.11 1.6.31v5.04zM64.2 15.7h-.09v-1.64h-2.3V24h2.47v-5.92c.77-1.46 1.71-1.94 3.28-1.94h.25V14a6.67 6.67 0 0 0-.67-.04c-1.34 0-2.26.52-2.94 1.75zm83.14-1.89c-3.4 0-5.01 2.2-5.01 5.23 0 3.02 1.6 5.2 5.01 5.2s5.01-2.18 5.01-5.2c0-3.03-1.63-5.23-5.02-5.23h.01zm0 8.44c-1.6 0-2.46-1.04-2.46-3.21 0-2.18.85-3.22 2.46-3.22 1.6 0 2.44 1.04 2.44 3.22 0 2.17-.84 3.21-2.45 3.21h.01zm19.12-8.44c-1.06 0-2.28.58-3.38 1.32l-.3.19c-.51-1.11-1.56-1.5-2.71-1.5-1.06 0-2.27.54-3.38 1.27v-1.03h-2.34V24h2.48v-7.13a5.3 5.3 0 0 1 2.61-.98c.81 0 1.32.44 1.32 1.84V24h2.46v-7.1c.92-.6 1.9-1 2.6-1 .82 0 1.32.43 1.32 1.84V24h2.46v-6.86c0-1.92-1.14-3.32-3.15-3.32zm-111.64 0c-3.4 0-5 2.2-5 5.23 0 3.02 1.6 5.2 5 5.2s5.02-2.18 5.02-5.2c0-3.03-1.64-5.23-5.03-5.23h.01zm0 8.44c-1.6 0-2.46-1.04-2.46-3.21 0-2.18.86-3.22 2.47-3.22 1.6 0 2.44 1.04 2.44 3.22 0 2.17-.85 3.21-2.46 3.21h.01zm40.31-6.56h-.08v-1.63h-2.31V24h2.46v-5.92c.77-1.46 1.71-1.94 3.28-1.94h.25V14a6.67 6.67 0 0 0-.67-.04c-1.33 0-2.25.52-2.94 1.75h.01zM86.05 10h-4.58v14h2.64v-4.87h1.93c2.99 0 5.16-1.61 5.16-4.62 0-3-2.17-4.51-5.16-4.51zm.02 7.08h-1.96v-5.01h1.95c1.6 0 2.38.88 2.38 2.44 0 1.57-.73 2.57-2.38 2.57h.01zm36.02-.23c0-.75.82-1.04 1.7-1.04.93.01 1.86.16 2.75.43V14.2a10.14 10.14 0 0 0-2.95-.38c-2.38 0-4.05 1.13-4.05 2.97 0 3.57 4.92 2.65 4.92 4.39 0 .85-.77 1.08-1.9 1.08-.8 0-2.07-.3-2.99-.63v2.03a8.29 8.29 0 0 0 2.9.59c2.32 0 4.53-.69 4.53-3.17.03-3.45-4.9-2.56-4.9-4.23zm-17.5-3.03c-3.18 0-4.83 2.47-4.83 5.16 0 3.7 1.94 5.27 5.1 5.27a11.81 11.81 0 0 0 3.65-.57v-2.05c-1.03.38-1.97.61-2.97.61-1.84 0-3.07-.5-3.13-2.67h6.36c.06-.49.09-.98.08-1.46 0-2.1-1.11-4.29-4.27-4.29zm-2.16 4.12c.15-1.38.9-2.26 2.13-2.26 1.32 0 1.72 1.05 1.72 2.26h-3.85zm10.7-1.09c0-.75.81-1.04 1.69-1.04.93.01 1.86.16 2.75.43V14.2a10.14 10.14 0 0 0-2.94-.38c-2.38 0-4.06 1.13-4.06 2.97 0 3.57 4.93 2.65 4.93 4.39 0 .85-.78 1.08-1.9 1.08-.8 0-2.07-.3-3-.63v2.03a8.28 8.28 0 0 0 2.9.59c2.32 0 4.54-.69 4.54-3.17.02-3.45-4.91-2.56-4.91-4.23zm21.97 2.1c0-2.33 1.27-3.12 2.78-3.12.94.03 1.88.22 2.76.57v-2.1a8.11 8.11 0 0 0-2.8-.48c-3.28 0-5.31 2-5.31 5.25 0 3.07 1.46 5.18 5.16 5.18 1.17 0 2.08-.23 3.08-.57v-2.04c-1.13.43-2 .6-2.77.6-1.63 0-2.9-.75-2.9-3.3zM128.66 24h2.47v-2.55h-2.47V24zM1.72 16c0 4.47 2.6 8.32 6.36 10.15L2.7 11.41A11.24 11.24 0 0 0 1.72 16zM13 27.28c1.31 0 2.57-.23 3.75-.64l-.08-.15-3.47-9.5-3.38 9.83c1 .3 2.07.46 3.18.46zm1.55-16.57l4.08 12.13 1.13-3.76c.48-1.56.85-2.68.85-3.65 0-1.4-.5-2.36-.92-3.1-.58-.94-1.11-1.73-1.11-2.65 0-1.04.78-2 1.9-2h.14A11.24 11.24 0 0 0 13 4.72 11.27 11.27 0 0 0 3.58 9.8l.72.02c1.18 0 3-.15 3-.15.62-.03.69.86.08.93 0 0-.61.08-1.3.11l4.12 12.22 2.47-7.4-1.76-4.82a20.13 20.13 0 0 1-1.18-.1c-.61-.04-.54-.97.07-.94 0 0 1.86.15 2.97.15 1.18 0 3-.15 3-.15.61-.03.69.86.08.93 0 0-.61.07-1.3.11zm4.12 15.04A11.28 11.28 0 0 0 24.28 16c0-1.96-.5-3.8-1.38-5.41a10.65 10.65 0 0 1-.78 5.2l-3.45 9.96zM13 29a13 13 0 1 1 0-26 13 13 0 0 1 0 26z' fill='inherit' fillRule='nonzero' />+ <title>Wordpress</title>+ <path+ d='M47.57 10l-2.79 10.72L41.99 10h-2.81l.65 2.3-2.45 8.78L34.7 10H32l3.8 14h2.96l2.28-7.49L43.17 24h2.95l4-14h-2.55zm28.39 4.06a9 9 0 0 0-1.86-.23c-3.4 0-5.26 2.27-5.26 5.6 0 3.31 1.86 4.82 4.05 4.82a5.45 5.45 0 0 0 3.2-1.17V24h2.33V10h-2.46v4.06zm0 7.08c-.8.73-1.55 1.13-2.34 1.13-1.36 0-2.23-.9-2.23-3.01 0-2.28 1.08-3.47 2.96-3.47.55 0 1.1.11 1.6.31v5.04zM64.2 15.7h-.09v-1.64h-2.3V24h2.47v-5.92c.77-1.46 1.71-1.94 3.28-1.94h.25V14a6.67 6.67 0 0 0-.67-.04c-1.34 0-2.26.52-2.94 1.75zm83.14-1.89c-3.4 0-5.01 2.2-5.01 5.23 0 3.02 1.6 5.2 5.01 5.2s5.01-2.18 5.01-5.2c0-3.03-1.63-5.23-5.02-5.23h.01zm0 8.44c-1.6 0-2.46-1.04-2.46-3.21 0-2.18.85-3.22 2.46-3.22 1.6 0 2.44 1.04 2.44 3.22 0 2.17-.84 3.21-2.45 3.21h.01zm19.12-8.44c-1.06 0-2.28.58-3.38 1.32l-.3.19c-.51-1.11-1.56-1.5-2.71-1.5-1.06 0-2.27.54-3.38 1.27v-1.03h-2.34V24h2.48v-7.13a5.3 5.3 0 0 1 2.61-.98c.81 0 1.32.44 1.32 1.84V24h2.46v-7.1c.92-.6 1.9-1 2.6-1 .82 0 1.32.43 1.32 1.84V24h2.46v-6.86c0-1.92-1.14-3.32-3.15-3.32zm-111.64 0c-3.4 0-5 2.2-5 5.23 0 3.02 1.6 5.2 5 5.2s5.02-2.18 5.02-5.2c0-3.03-1.64-5.23-5.03-5.23h.01zm0 8.44c-1.6 0-2.46-1.04-2.46-3.21 0-2.18.86-3.22 2.47-3.22 1.6 0 2.44 1.04 2.44 3.22 0 2.17-.85 3.21-2.46 3.21h.01zm40.31-6.56h-.08v-1.63h-2.31V24h2.46v-5.92c.77-1.46 1.71-1.94 3.28-1.94h.25V14a6.67 6.67 0 0 0-.67-.04c-1.33 0-2.25.52-2.94 1.75h.01zM86.05 10h-4.58v14h2.64v-4.87h1.93c2.99 0 5.16-1.61 5.16-4.62 0-3-2.17-4.51-5.16-4.51zm.02 7.08h-1.96v-5.01h1.95c1.6 0 2.38.88 2.38 2.44 0 1.57-.73 2.57-2.38 2.57h.01zm36.02-.23c0-.75.82-1.04 1.7-1.04.93.01 1.86.16 2.75.43V14.2a10.14 10.14 0 0 0-2.95-.38c-2.38 0-4.05 1.13-4.05 2.97 0 3.57 4.92 2.65 4.92 4.39 0 .85-.77 1.08-1.9 1.08-.8 0-2.07-.3-2.99-.63v2.03a8.29 8.29 0 0 0 2.9.59c2.32 0 4.53-.69 4.53-3.17.03-3.45-4.9-2.56-4.9-4.23zm-17.5-3.03c-3.18 0-4.83 2.47-4.83 5.16 0 3.7 1.94 5.27 5.1 5.27a11.81 11.81 0 0 0 3.65-.57v-2.05c-1.03.38-1.97.61-2.97.61-1.84 0-3.07-.5-3.13-2.67h6.36c.06-.49.09-.98.08-1.46 0-2.1-1.11-4.29-4.27-4.29zm-2.16 4.12c.15-1.38.9-2.26 2.13-2.26 1.32 0 1.72 1.05 1.72 2.26h-3.85zm10.7-1.09c0-.75.81-1.04 1.69-1.04.93.01 1.86.16 2.75.43V14.2a10.14 10.14 0 0 0-2.94-.38c-2.38 0-4.06 1.13-4.06 2.97 0 3.57 4.93 2.65 4.93 4.39 0 .85-.78 1.08-1.9 1.08-.8 0-2.07-.3-3-.63v2.03a8.28 8.28 0 0 0 2.9.59c2.32 0 4.54-.69 4.54-3.17.02-3.45-4.91-2.56-4.91-4.23zm21.97 2.1c0-2.33 1.27-3.12 2.78-3.12.94.03 1.88.22 2.76.57v-2.1a8.11 8.11 0 0 0-2.8-.48c-3.28 0-5.31 2-5.31 5.25 0 3.07 1.46 5.18 5.16 5.18 1.17 0 2.08-.23 3.08-.57v-2.04c-1.13.43-2 .6-2.77.6-1.63 0-2.9-.75-2.9-3.3zM128.66 24h2.47v-2.55h-2.47V24zM1.72 16c0 4.47 2.6 8.32 6.36 10.15L2.7 11.41A11.24 11.24 0 0 0 1.72 16zM13 27.28c1.31 0 2.57-.23 3.75-.64l-.08-.15-3.47-9.5-3.38 9.83c1 .3 2.07.46 3.18.46zm1.55-16.57l4.08 12.13 1.13-3.76c.48-1.56.85-2.68.85-3.65 0-1.4-.5-2.36-.92-3.1-.58-.94-1.11-1.73-1.11-2.65 0-1.04.78-2 1.9-2h.14A11.24 11.24 0 0 0 13 4.72 11.27 11.27 0 0 0 3.58 9.8l.72.02c1.18 0 3-.15 3-.15.62-.03.69.86.08.93 0 0-.61.08-1.3.11l4.12 12.22 2.47-7.4-1.76-4.82a20.13 20.13 0 0 1-1.18-.1c-.61-.04-.54-.97.07-.94 0 0 1.86.15 2.97.15 1.18 0 3-.15 3-.15.61-.03.69.86.08.93 0 0-.61.07-1.3.11zm4.12 15.04A11.28 11.28 0 0 0 24.28 16c0-1.96-.5-3.8-1.38-5.41a10.65 10.65 0 0 1-.78 5.2l-3.45 9.96zM13 29a13 13 0 1 1 0-26 13 13 0 0 1 0 26z'+ fill='inherit'+ fillRule='nonzero'+ /></svg>)diff --git a/app/utils/analytics.ts b/app/utils/analytics.tsindex da2159f38..d83a8fa7b 100644--- a/app/utils/analytics.ts+++ b/app/utils/analytics.ts@@ -26,11 +26,10 @@ const trackViews = () => {const trackCustom = (ev: string, unique = false) => {if (!isSelfhosted) {Swetrix.track({- ev, unique,+ ev,+ unique,})}}-export {- trackViews, trackCustom, SWETRIX_PID,-}+export { trackViews, trackCustom, SWETRIX_PID }diff --git a/app/utils/compareConvertDate.ts b/app/utils/compareConvertDate.tsindex 090a5b30b..a1f9fb23b 100644--- a/app/utils/compareConvertDate.ts+++ b/app/utils/compareConvertDate.ts@@ -11,77 +11,87 @@ export const periodToCompareDate: {from: stringto: string}-}[] = [{- period: '1d',- formula: () => {- const to = dayjs.utc().subtract(1, 'day').format('YYYY-MM-DD')- const from = dayjs.utc().subtract(2, 'day').format('YYYY-MM-DD')+}[] = [+ {+ period: '1d',+ formula: () => {+ const to = dayjs.utc().subtract(1, 'day').format('YYYY-MM-DD')+ const from = dayjs.utc().subtract(2, 'day').format('YYYY-MM-DD')- return {- from,- to,- }+ return {+ from,+ to,+ }+ },},-}, {- period: '7d',- formula: () => {- const to = dayjs.utc().subtract(7, 'day').format('YYYY-MM-DD')- const from = dayjs.utc().subtract(14, 'day').format('YYYY-MM-DD')+ {+ period: '7d',+ formula: () => {+ const to = dayjs.utc().subtract(7, 'day').format('YYYY-MM-DD')+ const from = dayjs.utc().subtract(14, 'day').format('YYYY-MM-DD')- return {- from,- to,- }+ return {+ from,+ to,+ }+ },},-}, {- period: '4w',- formula: () => {- const to = dayjs.utc().subtract(28, 'day').format('YYYY-MM-DD')- const from = dayjs.utc().subtract(56, 'day').format('YYYY-MM-DD')+ {+ period: '4w',+ formula: () => {+ const to = dayjs.utc().subtract(28, 'day').format('YYYY-MM-DD')+ const from = dayjs.utc().subtract(56, 'day').format('YYYY-MM-DD')- return {- from,- to,- }+ return {+ from,+ to,+ }+ },},-}, {- period: '3M',- formula: () => {- const to = dayjs.utc().subtract(3, 'month').format('YYYY-MM-DD')- const from = dayjs.utc().subtract(6, 'month').format('YYYY-MM-DD')+ {+ period: '3M',+ formula: () => {+ const to = dayjs.utc().subtract(3, 'month').format('YYYY-MM-DD')+ const from = dayjs.utc().subtract(6, 'month').format('YYYY-MM-DD')- return {- from,- to,- }+ return {+ from,+ to,+ }+ },},-}, {- period: '12M',- formula: () => {- const to = dayjs.utc().subtract(12, 'month').format('YYYY-MM-DD')- const from = dayjs.utc().subtract(24, 'month').format('YYYY-MM-DD')+ {+ period: '12M',+ formula: () => {+ const to = dayjs.utc().subtract(12, 'month').format('YYYY-MM-DD')+ const from = dayjs.utc().subtract(24, 'month').format('YYYY-MM-DD')- return {- from,- to,- }- },-}, {- period: 'custom',- formula: (date) => {- if (!date) {return {- from: getFormatDate(new Date()),- to: getFormatDate(new Date()),+ from,+ to,+ }+ },+ },+ {+ period: 'custom',+ formula: (date) => {+ if (!date) {+ return {+ from: getFormatDate(new Date()),+ to: getFormatDate(new Date()),+ }}- }- const days = (date[1].getTime() - date[0].getTime()) / (1000 * 3600 * 24)- const to = dayjs.utc().subtract(days, 'day').format('YYYY-MM-DD')- const from = dayjs.utc().subtract(days * 2, 'day').format('YYYY-MM-DD')+ const days = (date[1].getTime() - date[0].getTime()) / (1000 * 3600 * 24)+ const to = dayjs.utc().subtract(days, 'day').format('YYYY-MM-DD')+ const from = dayjs+ .utc()+ .subtract(days * 2, 'day')+ .format('YYYY-MM-DD')- return {- from,- to,- }+ return {+ from,+ to,+ }+ },},-}]+]diff --git a/app/utils/cookie.ts b/app/utils/cookie.tsindex a509bab32..6ac9f4f55 100644--- a/app/utils/cookie.ts+++ b/app/utils/cookie.ts@@ -2,7 +2,7 @@ import { isDevelopment, isSelfhosted, isBrowser } from 'redux/constants'const COOKIE_DOMAIN = 'swetrix.com'-const COOKIE_SUFFIX = (isDevelopment || isSelfhosted) ? '' : `; domain=${COOKIE_DOMAIN}; secure`+const COOKIE_SUFFIX = isDevelopment || isSelfhosted ? '' : `; domain=${COOKIE_DOMAIN}; secure`export const getCookie = (key: string) => {if (!isBrowser) {@@ -18,7 +18,12 @@ export const getCookie = (key: string) => {return null}-export const generateCookieString = (key: string, value: string | number | boolean, maxAge = 3600, sameSite = 'strict') => {+export const generateCookieString = (+ key: string,+ value: string | number | boolean,+ maxAge = 3600,+ sameSite = 'strict',+) => {return `${key}=${value}; max-age=${maxAge}; path=/; SameSite=${sameSite}${COOKIE_SUFFIX}`}diff --git a/app/utils/generic.ts b/app/utils/generic.tsindex f82f69456..0cd0cac19 100644--- a/app/utils/generic.ts+++ b/app/utils/generic.ts@@ -40,7 +40,7 @@ export const secondsTillNextMonth = () => {date.setDate(1)date.setHours(0, 0, 0, 0)- return 0 | (date - now) / 1000+ return 0 | ((date - now) / 1000)}export const convertMsToSeconds = (ms: any) => {@@ -51,26 +51,30 @@ export const convertMsToSeconds = (ms: any) => {export const getTimeFromSeconds = (seconds: any) => {const negative = seconds < 0const _seconds = Math.abs(seconds)- const h = 0 | _seconds / 3600- const m = 0 | (_seconds % 3600) / 60+ const h = 0 | (_seconds / 3600)+ const m = 0 | ((_seconds % 3600) / 60)const s = 0 | _seconds % 60- const ms = 0 | (_seconds % 1) * 1000+ const ms = 0 | ((_seconds % 1) * 1000)return {- h, m, s, ms, negative,+ h,+ m,+ s,+ ms,+ negative,}}export const getStringFromTime = (time: any, showMS?: boolean) => {- const {- h, m, s, ms, negative,- } = time+ const { h, m, s, ms, negative } = timeif (h === 0 && m === 0 && s === 0 && (!showMS || ms === 0)) {return '0s'}- return `${negative ? '-' : ''}${h ? `${h}h ` : ''}${m ? `${m}m ` : ''}${s || (showMS && ms > 0) ? `${showMS ? _round(s + ms / 1000, 2) : s}s` : ''}`+ return `${negative ? '-' : ''}${h ? `${h}h ` : ''}${m ? `${m}m ` : ''}${+ s || (showMS && ms > 0) ? `${showMS ? _round(s + ms / 1000, 2) : s}s` : ''+ }`}export const sumArrays = (...arrays: any): number[] => {@@ -80,7 +84,11 @@ export const sumArrays = (...arrays: any): number[] => {}export const openBrowserWindow = (url: string, width: number, height: number) => {- return window.open(url, '', `width=${width},height=${height},top=${(window.innerHeight - height) / 2},left=${(window.innerWidth - width) / 2}`)+ return window.open(+ url,+ '',+ `width=${width},height=${height},top=${(window.innerHeight - height) / 2},left=${(window.innerWidth - width) / 2}`,+ )}export const loadScript = (url: string) => {@@ -96,23 +104,19 @@ export const loadScript = (url: string) => {/*** Returns the % change of one number relative to the other- *+ ** @param oldVal The initial value* @param newVal The value that changed* @param round Numbers after floating point*/-export const calculateRelativePercentage = (- oldVal: number,- newVal: number,- round = 2,-) => {- if (oldVal === newVal) return 0- if (oldVal === 0) return 100- if (newVal === 0) return -100-- if (newVal > oldVal) {- return _round((newVal / oldVal) * 100, round)- }-- return _round((1 - newVal / oldVal) * -100, round)-}\ No newline at end of file+export const calculateRelativePercentage = (oldVal: number, newVal: number, round = 2) => {+ if (oldVal === newVal) return 0+ if (oldVal === 0) return 100+ if (newVal === 0) return -100++ if (newVal > oldVal) {+ return _round((newVal / oldVal) * 100, round)+ }++ return _round((1 - newVal / oldVal) * -100, round)+}diff --git a/app/utils/getPosts.ts b/app/utils/getPosts.tsindex a11b9bc56..34039c421 100644--- a/app/utils/getPosts.ts+++ b/app/utils/getPosts.ts@@ -7,7 +7,7 @@ const renderer = new marked.Renderer()renderer.link = (href: string, title: string | null | undefined, text: string) => {const url = new URL(href)-+if (url.hostname !== 'swetrix.com') {url.searchParams.set('utm_source', 'swetrix.com')}diff --git a/app/utils/server.ts b/app/utils/server.tsindex a03d9aa28..c99b56cf5 100644--- a/app/utils/server.ts+++ b/app/utils/server.ts@@ -14,13 +14,13 @@ export const hasAuthCookies = (request: Request) => {/*** Function detects theme based on user's browser hints and cookies- *+ ** @param request* @returns [theme, storeToCookie]*/export function detectTheme(request: Request): [ThemeType, boolean] {// Stage 1: Check if theme is set via `theme` query param- const queryTheme = new URL(request.url).searchParams.get('theme') as (ThemeType | null)+ const queryTheme = new URL(request.url).searchParams.get('theme') as ThemeType | nullif (queryTheme && _includes(SUPPORTED_THEMES, queryTheme)) {return [queryTheme, false]@@ -48,7 +48,7 @@ export function detectTheme(request: Request): [ThemeType, boolean] {/*** Function detects theme based on the query- *+ ** @param request* @returns boolean*/@@ -58,7 +58,7 @@ export function isEmbedded(request: Request): boolean {/*** Function returns project tabs from query- *+ ** @param request* @returns string[]*/@@ -74,7 +74,7 @@ export function getProjectTabs(request: Request): string[] {/*** Function returns password from query- *+ ** @param request* @returns boolean*/@@ -102,11 +102,7 @@ interface IPageMeta {prefixLessTitle: string}-export const getPageMeta = (- t: (key: string) => string,- url?: string,- _pathname?: string,-): IPageMeta => {+export const getPageMeta = (t: (key: string) => string, url?: string, _pathname?: string): IPageMeta => {const DEFAULT_RESULT = {title: t('titles.main'),} as Partial<IPageMeta>diff --git a/crowdin.example.yml b/crowdin.example.ymlindex a9910c294..08c45afe0 100644--- a/crowdin.example.yml+++ b/crowdin.example.yml@@ -1,12 +1,7 @@-"project_id" : "489515"-"api_token" : ""-"base_path" : "."-"base_url" : "https://api.crowdin.com"-"preserve_hierarchy": true-files: [- {- "source" : "/public/locales/en.json",- "translation" : "/public/locales/%two_letters_code%.json",- "type" : "json",- }-]\ No newline at end of file+'project_id': '489515'+'api_token': ''+'base_path': '.'+'base_url': 'https://api.crowdin.com'+'preserve_hierarchy': true+files:+ [{ 'source': '/public/locales/en.json', 'translation': '/public/locales/%two_letters_code%.json', 'type': 'json' }]diff --git a/fly_import_env.js b/fly_import_env.jsindex 5c5798fc3..5b2e50c3d 100644--- a/fly_import_env.js+++ b/fly_import_env.js@@ -48,12 +48,7 @@ function flyImport(secrets) {console.log(`Set .env variable ${key}`)}- const command = [- 'flyctl',- 'secrets',- 'import',- ...buildSecrets,- ]+ const command = ['flyctl', 'secrets', 'import', ...buildSecrets]console.log(`Running command: ${command.join(' ')}`)// execSync(command.join(' '), { stdio: 'inherit' })diff --git a/jest.config.js b/jest.config.jsindex ff69e1ba7..77c0a0d57 100644--- a/jest.config.js+++ b/jest.config.js@@ -5,9 +5,7 @@ const config = {'^.+\\.tsx?$': 'ts-jest',},transformIgnorePatterns: ['node_modules/(?!axios)'],- testPathIgnorePatterns: [- '<rootDir>/app/api/*',- ],+ testPathIgnorePatterns: ['<rootDir>/app/api/*'],globals: {'ts-jest': {tsconfig: '<rootDir>/tsconfig.json',diff --git a/package.json b/package.jsonindex 8c158c513..57b8fa83d 100644--- a/package.json+++ b/package.json@@ -14,7 +14,9 @@"typecheck": "tsc","lint": "eslint app","lint:fix": "eslint app --fix",- "lint:tsc": "tsc --noEmit"+ "lint:tsc": "tsc --noEmit",+ "format": "prettier --check --ignore-unknown ./app ./public",+ "format:fix": "prettier --write --ignore-unknown ./app ./public"},"dependencies": {"@blaumaus/react-alert": "^7.0.5",@@ -51,6 +53,7 @@"jszip": "^3.10.1","lodash": "^4.17.21","marked": "^9.1.2",+ "prettier": "^3.1.1","prop-types": "^15.8.1","react": "^18.2.0","react-dom": "^18.2.0",diff --git a/public/env.js b/public/env.jsindex a4df14363..24e27de6c 100644--- a/public/env.js+++ b/public/env.js@@ -1,2 +1,2 @@-window.env = {};-window.env.API_URL = "http://example.com/api";\ No newline at end of file+window.env = {}+window.env.API_URL = 'http://example.com/api'diff --git a/public/locales/en.json b/public/locales/en.jsonindex eb1a40d30..9f6934163 100644--- a/public/locales/en.json+++ b/public/locales/en.json@@ -525,8 +525,8 @@"customEvent": "Custom event name","add": "Add Alert","delete": "Delete alert",- "noNameError": "Please enter a name for the alert.",- "queryValueError": "Please fill threshold and the query value has to be a number.",+ "noNameError": "Please enter a name for the alert.",+ "queryValueError": "Please fill threshold and the query value has to be a number.","noIntegration": "You have not configured an integration yet. Create one in your <url>account settings</url>.","noNotification": "No notification channels set","lastTriggered": "Last Triggered",@@ -938,7 +938,7 @@"donate": "Donate","changelog": "Changelog","captcha": "CAPTCHA",- "press":"Media & Press",+ "press": "Media & Press","open": "Open startup","about": "About us","features": "Features"diff --git a/public/manifest.json b/public/manifest.jsonindex 7bed5728e..8d5da1586 100644--- a/public/manifest.json+++ b/public/manifest.json@@ -18,7 +18,7 @@"sizes": "512x512"}],- "screenshots" : [+ "screenshots": [{"src": "assets/screenshot_dark.png","sizes": "2212x1566",diff --git a/remix.config.js b/remix.config.jsindex 5c065059f..f8b8344e4 100644--- a/remix.config.js+++ b/remix.config.js@@ -1,6 +1,4 @@-const {- createRoutesFromFolders,-} = require("@remix-run/v1-route-convention")+const { createRoutesFromFolders } = require('@remix-run/v1-route-convention')/** @type {import('@remix-run/dev').AppConfig} */module.exports = {@@ -37,5 +35,5 @@ module.exports = {routes(defineRoutes) {// uses the v1 convention, works in v1.15+ and v2return createRoutesFromFolders(defineRoutes)- }+ },}diff --git a/tailwind.config.ts b/tailwind.config.tsindex 305c576c6..18269dc4d 100644--- a/tailwind.config.ts+++ b/tailwind.config.ts@@ -50,16 +50,13 @@ export default {},minHeight: {72: '18rem',- page: 'calc(100vh - 74px)', // header height -> 74px- 'min-footer': 'calc(100vh - 148px)',+ page: 'calc(100vh - 74px)', // header height -> 74px+ 'min-footer': 'calc(100vh - 148px)',},},variants: {extend: {},scrollBehavior: ['motion-safe', 'motion-reduce', 'responsive'],},- plugins: [- require('@tailwindcss/forms'),- require('@tailwindcss/typography'),- ],+ plugins: [require('@tailwindcss/forms'), require('@tailwindcss/typography')],} satisfies Configdiff --git a/tsconfig.json b/tsconfig.jsonindex 247339d33..560636de8 100644--- a/tsconfig.json+++ b/tsconfig.json@@ -13,7 +13,7 @@"forceConsistentCasingInFileNames": true,"baseUrl": ".","paths": {- "*": ["./app/*"],+ "*": ["./app/*"]},// Remix takes care of building everything in `remix build`.