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!

improved footer

Blue Mouseafc6cfa1e64b
diff --git a/public/assets/mc.png b/public/assets/mc.png
deleted file mode 100644
index 986cbaee2..000000000
Binary files a/public/assets/mc.png and /dev/null differ
diff --git a/public/assets/pci.png b/public/assets/pci.png
deleted file mode 100644
index cf71d53de..000000000
Binary files a/public/assets/pci.png and /dev/null differ
diff --git a/public/assets/visa.png b/public/assets/visa.png
deleted file mode 100644
index 8c5f2efaf..000000000
Binary files a/public/assets/visa.png and /dev/null differ
diff --git a/public/locales/en.json b/public/locales/en.json
index b2d0333e9..a4074a749 100644
--- a/public/locales/en.json
+++ b/public/locales/en.json
@@ -840,7 +840,7 @@
"eu": "European Union",
"support": "Support",
"company": "Company",
- "legal": "Legal",
+ "legal": "Support & Legal",
"copy": "Swetrix Analytics. All rights reserved.",
"contact": "Contact",
"pp": "Privacy Policy",
@@ -861,6 +861,6 @@
"press":"Media & Press",
"open": "Open startup",
"about": "About us",
- "comparisons": "Comparisons"
+ "features": "Features"
}
}
diff --git a/src/components/Footer/index.tsx b/src/components/Footer/index.tsx
index 02994a462..94459e763 100644
--- a/src/components/Footer/index.tsx
+++ b/src/components/Footer/index.tsx
@@ -14,7 +14,16 @@ import {
import routes from 'routes'
const navigation = {
- support: [
+ company: [
+ { key: 'about', href: routes.about, internal: true },
+ { key: 'changelog', href: routes.changelog, internal: true },
+ { key: 'open', href: routes.open, internal: true },
+ { key: 'press', href: routes.press, internal: true },
+ { key: 'status', href: STATUSPAGE_URL },
+ { key: 'donate', href: DONATE_URL },
+ { key: 'blog', href: BLOG_URL },
+ ],
+ legal: [
(authenticated: boolean | undefined): {
key: string
href: string
@@ -30,27 +39,28 @@ const navigation = {
href: string
internal: boolean
} => ({ key: 'contact', href: routes.contact, internal: true }),
+ (): {
+ key: string
+ href: string
+ internal: boolean
+ } => ({ key: 'privacy', href: routes.privacy, internal: true }),
+ (): {
+ key: string
+ href: string
+ internal: boolean
+ } => ({ key: 'terms', href: routes.terms, internal: true }),
+ (): {
+ key: string
+ href: string
+ internal: boolean
+ } => ({ key: 'cookie', href: routes.cookiePolicy, internal: true }),
],
- company: [
- { key: 'about', href: routes.about, internal: true },
- { key: 'changelog', href: routes.changelog, internal: true },
- { key: 'open', href: routes.open, internal: true },
- { key: 'press', href: routes.press, internal: true },
- { key: 'status', href: STATUSPAGE_URL },
- { key: 'donate', href: DONATE_URL },
- { key: 'blog', href: BLOG_URL },
- { key: 'captcha', href: CAPTCHA_URL },
- { key: 'utm', href: UTM_GENERATOR_URL },
- ],
- legal: [
- { key: 'privacy', href: routes.privacy },
- { key: 'terms', href: routes.terms },
- { key: 'cookie', href: routes.cookiePolicy },
- ],
- comparisons: [
- { value: 'Google Analytics', href: SWETRIX_VS_GOOGLE },
- { value: 'Cloudflare Analytics', href: SWETRIX_VS_CLOUDFLARE },
- { value: 'Simple Analytics', href: SWETRIX_VS_SIMPLE_ANALYTICS },
+ features: [
+ { value: 'vs Google Analytics', href: SWETRIX_VS_GOOGLE },
+ { value: 'vs Cloudflare Analytics', href: SWETRIX_VS_CLOUDFLARE },
+ { value: 'vs Simple Analytics', href: SWETRIX_VS_SIMPLE_ANALYTICS },
+ { key: 'captcha', href: CAPTCHA_URL, internal: false },
+ { key: 'utm', href: UTM_GENERATOR_URL, internal: false },
],
social: [
{
@@ -197,9 +207,9 @@ const Footer = ({ minimal, authenticated }: {
<h2 id='footer-heading' className='sr-only'>
Footer
</h2>
- <div className='w-11/12 mx-auto pt-8 pb-5 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'>
+ <div className='w-11/12 pt-8 pb-5 px-4 sm:px-6 lg:px-8'>
+ <div className='xl:grid xl:grid-cols-2 xl:gap-8'>
+ <div className='space-y-5 xl:col-span-1'>
<div className='flex gap-5 flex-wrap'>
<img className='h-7' height='28px' src='/assets/logo_white.png' loading='lazy' alt='Swetrix Analytics' />
</div>
@@ -234,44 +244,43 @@ const Footer = ({ minimal, authenticated }: {
</a>
))}
</div>
+ <p className='text-base pt-10 text-gray-300'>
+ &copy;
+ {' '}
+ {year}
+ {' '}
+ {t('footer.copy')}
+ </p>
</div>
- <div className='mt-12 grid grid-cols-2 gap-8 xl:mt-0 xl:col-span-2'>
- <div className='md:grid md:grid-cols-2 md:gap-8'>
+ <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.comparisons')}
+ {t('footer.features')}
</h3>
<ul className='mt-4 space-y-4'>
- {_map(navigation.comparisons, (data) => {
- const { value, href } = data
+ {_map(navigation.features, (data) => {
+ const {
+ value, key, href, internal,
+ } = data
- return (
- <li key={value}>
- <a href={href} className='text-base text-gray-300 hover:text-white' target='_blank' rel='noopener noreferrer' aria-label={`${value} (opens in a new tab)`}>
- {value}
- </a>
- </li>
- )
- })}
- </ul>
- </div>
- <div className='mt-12 md:mt-0'>
- <h3 className='text-sm font-semibold text-white tracking-wider uppercase'>
- {t('footer.support')}
- </h3>
- <ul className='mt-4 space-y-4'>
- {_map(navigation.support, (func) => {
- const { key, href, internal } = func(authenticated)
+ const displayValue = value || t(`footer.${key}`)
return (
- <li key={key}>
+ <li key={displayValue}>
{internal ? (
- <HashLink to={href} className='text-base text-gray-300 hover:text-white'>
- {t(`footer.${key}`)}
- </HashLink>
+ <Link to={href} className='text-base text-gray-300 hover:text-white'>
+ {displayValue}
+ </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)`}>
- {t(`footer.${key}`)}
+ <a
+ href={href}
+ className='text-base text-gray-300 hover:text-white'
+ target='_blank'
+ rel='noopener noreferrer'
+ aria-label={`${displayValue} (opens in a new tab)`}
+ >
+ {displayValue}
</a>
)}
</li>
@@ -279,8 +288,6 @@ const Footer = ({ minimal, authenticated }: {
})}
</ul>
</div>
- </div>
- <div className='md:grid md:grid-cols-2 md:gap-8'>
<div>
<h3 className='text-sm font-semibold text-white tracking-wider uppercase'>
{t('footer.company')}
@@ -306,32 +313,28 @@ const Footer = ({ minimal, authenticated }: {
{t('footer.legal')}
</h3>
<ul className='mt-4 space-y-4'>
- {_map(navigation.legal, ({ key, href }) => (
- <li key={key}>
- <Link to={href} className='text-base text-gray-300 hover:text-white'>
- {t(`footer.${key}`)}
- </Link>
- </li>
- ))}
+ {_map(navigation.legal, (func) => {
+ const { key, href, internal } = func(authenticated)
+
+ return (
+ <li key={key}>
+ {internal ? (
+ <HashLink to={href} className='text-base text-gray-300 hover:text-white'>
+ {t(`footer.${key}`)}
+ </HashLink>
+ ) : (
+ <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>
+ )}
+ </li>
+ )
+ })}
</ul>
</div>
</div>
- <div className='flex gap-5 flex-wrap col-span-2 items-center justify-end'>
- <img className='h-10 w-auto' src='/assets/pci.png' height='40' width='auto' loading='lazy' alt='PCI DSS' />
- <img className='h-10 w-auto' src='/assets/visa.png' height='40' width='auto' loading='lazy' alt='Visa' />
- <img className='h-10 w-auto' src='/assets/mc.png' height='40' width='auto' loading='lazy' alt='Mastercard' />
- </div>
</div>
</div>
- <div className='mt-6 border-t border-[#727987] pt-5'>
- <p className='text-base text-gray-300 xl:text-center'>
- &copy;
- {' '}
- {year}
- {' '}
- {t('footer.copy')}
- </p>
- </div>
</div>
</footer>
)
diff --git a/src/index.tsx b/src/index.tsx
index e71bc2bcc..8b0153a6a 100644
--- a/src/index.tsx
+++ b/src/index.tsx
@@ -1,3 +1,4 @@
+/* eslint-disable import/no-unresolved */
import React from 'react'
import { createRoot } from 'react-dom/client'
import { BrowserRouter } from 'react-router-dom'