Skip to content

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

Minor bug fixes & layout improvements

Blue Mouse2ce14f96396a
diff --git a/src/api/index.js b/src/api/index.js
index fa2d0b194..eb42a707b 100644
--- a/src/api/index.js
+++ b/src/api/index.js
@@ -2,6 +2,7 @@ import axios from 'axios'
import { store } from 'redux/store'
import Debug from 'debug'
import _map from 'lodash/map'
+import _isEmpty from 'lodash/isEmpty'
import { authActions } from 'redux/actions/auth'
import { getAccessToken, removeAccessToken } from 'utils/accessToken'
@@ -42,7 +43,7 @@ export const authMe = () =>
.then(response => response.data)
.catch(error => {
debug('%s', error)
- throw error.response.data
+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message
})
export const login = (credentials) =>
@@ -51,7 +52,7 @@ export const login = (credentials) =>
.then(response => response.data)
.catch(error => {
debug('%s', error)
- throw error.response.data
+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message
})
export const signup = (data) =>
@@ -92,7 +93,7 @@ export const forgotPassword = (email) =>
.then(response => response.data)
.catch(error => {
debug('%s', error)
- throw error.response.data
+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message
})
export const confirmEmail = () =>
@@ -101,7 +102,7 @@ export const confirmEmail = () =>
.then(response => response.data)
.catch(error => {
debug('%s', error)
- throw error.response.data
+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message
})
export const exportUserData = () =>
@@ -110,7 +111,7 @@ export const exportUserData = () =>
.then(response => response.data)
.catch(error => {
debug('%s', error)
- throw error.response.data
+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message
})
export const createNewPassword = (id, password) =>
@@ -131,7 +132,7 @@ export const verifyEmail = ({ path, id }) =>
.then(response => response.data)
.catch(error => {
debug('%s', error)
- throw error.response.data
+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message
})
export const getProjects = () =>
@@ -140,7 +141,7 @@ export const getProjects = () =>
.then(response => response.data)
.catch(error => {
debug('%s', error)
- throw error.response.data
+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message
})
export const createProject = (data) =>
@@ -149,7 +150,7 @@ export const createProject = (data) =>
.then(response => response.data)
.catch(error => {
debug('%s', error)
- throw error.response.data
+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message
})
export const updateProject = (id, data) =>
@@ -158,7 +159,7 @@ export const updateProject = (id, data) =>
.then(response => response.data)
.catch(error => {
debug('%s', error)
- throw error.response.data
+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message
})
export const deleteProject = (id) =>
@@ -167,7 +168,7 @@ export const deleteProject = (id) =>
.then(response => response.data)
.catch(error => {
debug('%s', error)
- throw error.response.data
+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message
})
export const getProjectData = (pid, tb = 'hour', period = '3d', from = '', to = '') =>
@@ -176,7 +177,7 @@ export const getProjectData = (pid, tb = 'hour', period = '3d', from = '', to =
.then(response => response.data)
.catch(error => {
debug('%s', error)
- throw error.response.data
+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message
})
export const getOverallStats = (pids) =>
@@ -185,5 +186,5 @@ export const getOverallStats = (pids) =>
.then(response => response.data)
.catch(error => {
debug('%s', error)
- throw error.response.data
+ throw _isEmpty(error.response.data?.message) ? error.response.data : error.response.data.message
})
diff --git a/src/components/Footer/index.jsx b/src/components/Footer/index.jsx
index dd79e805d..e914ee0e6 100644
--- a/src/components/Footer/index.jsx
+++ b/src/components/Footer/index.jsx
@@ -42,7 +42,7 @@ const Footer = () => {
<div className='w-11/12 mx-auto py-12 px-4 sm:px-6 lg:px-8'>
<div className='xl:grid xl:grid-cols-3 xl:gap-8'>
<div className='space-y-8 xl:col-span-1'>
- <img className='h-10' src='https://tailwindui.com/img/logos/workflow-mark-gray-300.svg' alt='Swetrix Analytics' />
+ <img className='h-10' src='assets/logo_white.png' alt='Swetrix Analytics' />
<p className='text-gray-300 text-base'>
The best apps need the best services.<br />
Swetrix is a powerful analytics platform that respects user privacy.
diff --git a/src/components/Header/index.jsx b/src/components/Header/index.jsx
index ce6d7fd7b..05dca0bee 100644
--- a/src/components/Header/index.jsx
+++ b/src/components/Header/index.jsx
@@ -19,8 +19,8 @@ const Header = ({ authenticated }) => {
<div className='w-full py-4 flex items-center justify-between border-b border-indigo-500 lg:border-none'>
<div className='flex items-center'>
<Link to={routes.main}>
- <span className='sr-only'>Analytics</span>
- <img className='h-10 w-auto' src='https://tailwindui.com/img/logos/workflow-mark.svg?color=white' alt='' />
+ <span className='sr-only'>Swetrix</span>
+ <img className='h-10 w-auto' src='assets/logo_white.png' alt='' />
</Link>
<div className='hidden ml-10 space-x-1 lg:block'>
<NavLink to={routes.features} className='text-base select-none font-medium text-white hover:text-indigo-50 py-2 px-3 hover:bg-indigo-500 rounded-md' activeClassName='bg-indigo-700 hover:bg-indigo-700' key='Features'>Features</NavLink>
diff --git a/src/pages/Dashboard/Dashboard.jsx b/src/pages/Dashboard/Dashboard.jsx
index 4cdafe064..31c51044d 100644
--- a/src/pages/Dashboard/Dashboard.jsx
+++ b/src/pages/Dashboard/Dashboard.jsx
@@ -152,7 +152,9 @@ const Dashboard = ({ projects, isLoading, error }) => {
return (
<Title title='Dashboard'>
- <Loader />
+ <div className='min-h-page'>
+ <Loader />
+ </div>
</Title>
)
}
diff --git a/src/pages/Features/index.jsx b/src/pages/Features/index.jsx
index 80ddc6edd..d4dd0c8eb 100644
--- a/src/pages/Features/index.jsx
+++ b/src/pages/Features/index.jsx
@@ -1,5 +1,6 @@
import React from 'react'
import { Link } from 'react-router-dom'
+import { HashLink } from 'react-router-hash-link'
import Title from 'components/Title'
import routes from 'routes'
@@ -14,7 +15,7 @@ const Features = () => {
<h3 className='text-2xl font-normal text-gray-900 tracking-tight mt-4'>Transparency</h3>
<p className='text-lg text-gray-900 tracking-tight'>
At Swetrix, we believe that everyone has a right to privacy and transparency, especially when it comes to analytics.<br />
- We do not collect more information than we <Link className='text-indigo-600 hover:text-indigo-500' to={`${routes.docs}#docs-tv`}>claim</Link>, all data is stored on servers physically located in the European Union and our analytics script is publicly available and accessible to all on our <a className='text-indigo-600 hover:text-indigo-500' href='https://github.com/Swetrix' target='_blank' rel='noopener noreferrer'>Github</a>.<br />
+ We do not collect more information than we <HashLink className='text-indigo-600 hover:text-indigo-500' to={`${routes.docs}#docs-tv`}>claim</HashLink>, all data is stored on servers physically located in the European Union and our analytics script is publicly available and accessible to all on our <a className='text-indigo-600 hover:text-indigo-500' href='https://github.com/Swetrix' target='_blank' rel='noopener noreferrer'>Github</a>.<br />
</p>
<h3 className='text-2xl font-normal text-gray-900 tracking-tight mt-4'>Simplicity</h3>