Skip to content

armgit / umami

Public Imported from GitHub
0

Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.

Convert buttons to links.

Mike Cao5e57b26e46e7
diff --git a/.github/stale.yml b/.github/stale.yml
new file mode 100644
index 000000000..2dc5b6750
--- /dev/null
+++ b/.github/stale.yml
@@ -0,0 +1,19 @@
+# Number of days of inactivity before an issue becomes stale
+daysUntilStale: 60
+# Number of days of inactivity before a stale issue is closed
+daysUntilClose: 7
+# Issues with these labels will never be considered stale
+exemptLabels:
+ - pinned
+ - security
+ - enhancement
+ - bug
+# Label to use when marking an issue as stale
+staleLabel: wontfix
+# Comment to post when marking an issue as stale. Set to `false` to disable
+markComment: >
+ This issue has been automatically marked as stale because it has not had
+ recent activity. It will be closed if no further activity occurs. Thank you
+ for your contributions.
+# Comment to post when closing a stale issue. Set to `false` to disable
+closeComment: false
diff --git a/components/common/Link.module.css b/components/common/Link.module.css
index 54cebc0c0..d6dc0536f 100644
--- a/components/common/Link.module.css
+++ b/components/common/Link.module.css
@@ -1,12 +1,12 @@
-.link,
-.link:active,
-.link:visited {
+a.link,
+a.link:active,
+a.link:visited {
position: relative;
color: #2c2c2c;
text-decoration: none;
}
-.link:before {
+a.link:before {
content: '';
position: absolute;
bottom: -2px;
@@ -17,7 +17,7 @@
transition: width 100ms;
}
-.link:hover:before {
+a.link:hover:before {
width: 100%;
transition: width 100ms;
}
diff --git a/components/layout/ButtonLayout.module.css b/components/layout/ButtonLayout.module.css
index 73841169b..f153ba547 100644
--- a/components/layout/ButtonLayout.module.css
+++ b/components/layout/ButtonLayout.module.css
@@ -1,7 +1,8 @@
.buttons {
display: flex;
+ align-items: center;
}
-.buttons button + button {
+.buttons button + * {
margin-left: 10px;
}
diff --git a/components/layout/Footer.js b/components/layout/Footer.js
index 241ac2758..eecc91212 100644
--- a/components/layout/Footer.js
+++ b/components/layout/Footer.js
@@ -1,21 +1,26 @@
import React from 'react';
import { FormattedMessage } from 'react-intl';
-import classNames from 'classnames';
-import Button from 'components/common/Button';
-import Logo from 'assets/logo.svg';
import styles from './Footer.module.css';
export default function Footer() {
const version = process.env.VERSION;
return (
<footer className="container">
- <div className={classNames(styles.footer, 'row justify-content-center')}>
- <FormattedMessage id="footer.powered-by" defaultMessage="Powered by" />
- <a href="https://umami.is">
- <Button className={styles.button} icon={<Logo />} size="small">
- <b>umami</b>
- </Button>
- </a>
+ <div className={styles.footer}>
+ <div />
+ <div>
+ <FormattedMessage
+ id="footer.powered-by"
+ defaultMessage="Powered by {name} {version}"
+ values={{
+ name: (
+ <a href="https://umami.is">
+ <b>umami</b>
+ </a>
+ ),
+ }}
+ />
+ </div>
<div>{`v${version}`}</div>
</div>
</footer>
diff --git a/components/layout/Footer.module.css b/components/layout/Footer.module.css
index 87008340d..7c671d7e9 100644
--- a/components/layout/Footer.module.css
+++ b/components/layout/Footer.module.css
@@ -5,11 +5,3 @@
font-size: var(--font-size-small);
min-height: 100px;
}
-
-.footer a {
- text-decoration: none;
-}
-
-.button {
- margin: 0 5px;
-}
diff --git a/components/metrics/WebsiteHeader.js b/components/metrics/WebsiteHeader.js
index 71d0fa8a4..7f34ca2be 100644
--- a/components/metrics/WebsiteHeader.js
+++ b/components/metrics/WebsiteHeader.js
@@ -1,17 +1,15 @@
import React from 'react';
import { FormattedMessage } from 'react-intl';
-import { useRouter } from 'next/router';
+import Link from 'components/common/Link';
import PageHeader from 'components/layout/PageHeader';
-import Button from 'components/common/Button';
import ActiveUsers from './ActiveUsers';
import Arrow from 'assets/arrow-right.svg';
import styles from './WebsiteHeader.module.css';
import RefreshButton from '../common/RefreshButton';
import ButtonLayout from '../layout/ButtonLayout';
+import Icon from '../common/Icon';
export default function WebsiteHeader({ websiteId, title, showLink = false }) {
- const router = useRouter();
-
return (
<PageHeader>
<div className={styles.title}>{title}</div>
@@ -19,19 +17,14 @@ export default function WebsiteHeader({ websiteId, title, showLink = false }) {
<ButtonLayout>
<RefreshButton websiteId={websiteId} />
{showLink && (
- <Button
- icon={<Arrow />}
- onClick={() =>
- router.push('/website/[...id]', `/website/${websiteId}/${title}`, {
- shallow: true,
- })
- }
- size="small"
+ <Link
+ href="/website/[...id]"
+ as={`/website/${websiteId}/${title}`}
+ className={styles.link}
>
- <div>
- <FormattedMessage id="button.view-details" defaultMessage="View details" />
- </div>
- </Button>
+ <FormattedMessage id="button.view-details" defaultMessage="View details" />
+ <Icon icon={<Arrow />} size="small" />
+ </Link>
)}
</ButtonLayout>
</PageHeader>
diff --git a/components/metrics/WebsiteHeader.module.css b/components/metrics/WebsiteHeader.module.css
index 99dbd8bce..a14131322 100644
--- a/components/metrics/WebsiteHeader.module.css
+++ b/components/metrics/WebsiteHeader.module.css
@@ -4,10 +4,14 @@
line-height: var(--font-size-large);
}
-.button {
+.link {
font-size: var(--font-size-small);
}
+.link svg {
+ margin-left: 10px;
+}
+
@media only screen and (max-width: 576px) {
.active {
display: none;
diff --git a/lang/de-DE.json b/lang/de-DE.json
index df6adaa14..5be461323 100644
--- a/lang/de-DE.json
+++ b/lang/de-DE.json
@@ -13,7 +13,7 @@
"button.save": "Speichern",
"button.view-details": "Details anzeigen",
"button.websites": "Webseiten",
- "footer.powered-by": "Powered by",
+ "footer.powered-by": "Powered by {name}",
"header.nav.dashboard": "Übersicht",
"header.nav.settings": "Einstellungen",
"label.administrator": "Administrator",
diff --git a/lang/en-US.json b/lang/en-US.json
index e24b93477..20d82dd04 100644
--- a/lang/en-US.json
+++ b/lang/en-US.json
@@ -13,7 +13,7 @@
"button.save": "Save",
"button.view-details": "View details",
"button.websites": "Websites",
- "footer.powered-by": "Powered by",
+ "footer.powered-by": "Powered by {name}",
"header.nav.dashboard": "Dashboard",
"header.nav.settings": "Settings",
"label.administrator": "Administrator",
diff --git a/lang/es-MX.json b/lang/es-MX.json
index e089ef7fc..75fee3b73 100644
--- a/lang/es-MX.json
+++ b/lang/es-MX.json
@@ -13,7 +13,7 @@
"button.save": "Guardar",
"button.view-details": "Ver detalles",
"button.websites": "Sitios",
- "footer.powered-by": "Desarrollado con",
+ "footer.powered-by": "Desarrollado con {name}",
"header.nav.dashboard": "Panel de control",
"header.nav.settings": "Configuraciones",
"label.administrator": "Administrador",
diff --git a/lang/ja-JP.json b/lang/ja-JP.json
index cdeec4c89..7b14ed068 100644
--- a/lang/ja-JP.json
+++ b/lang/ja-JP.json
@@ -13,7 +13,7 @@
"button.save": "保存",
"button.view-details": "詳細表示",
"button.websites": "Webサイト",
- "footer.powered-by": "Powered by",
+ "footer.powered-by": "Powered by {name}",
"header.nav.dashboard": "ダッシュボード",
"header.nav.settings": "設定",
"label.administrator": "管理者",
diff --git a/lang/nl-NL.json b/lang/nl-NL.json
index 8d97ca436..c535da488 100644
--- a/lang/nl-NL.json
+++ b/lang/nl-NL.json
@@ -13,7 +13,7 @@
"button.save": "Opslaan",
"button.view-details": "Meer details",
"button.websites": "Websites",
- "footer.powered-by": "mogelijk gemaakt door",
+ "footer.powered-by": "mogelijk gemaakt door {name}",
"header.nav.dashboard": "Dashboard",
"header.nav.settings": "Instellingen",
"label.administrator": "Administrator",
diff --git a/lang/ru-RU.json b/lang/ru-RU.json
index 5c6e9df7c..f254a58ac 100644
--- a/lang/ru-RU.json
+++ b/lang/ru-RU.json
@@ -13,7 +13,7 @@
"button.save": "Сохранить",
"button.view-details": "Посмотреть детали",
"button.websites": "Сайты",
- "footer.powered-by": "на движке",
+ "footer.powered-by": "на движке {name}",
"header.nav.dashboard": "Информационная панель",
"header.nav.settings": "Настройки",
"label.administrator": "Администратор",
diff --git a/lang/tr-TR.json b/lang/tr-TR.json
index 8e9f100ca..ff4de5b36 100644
--- a/lang/tr-TR.json
+++ b/lang/tr-TR.json
@@ -13,7 +13,7 @@
"button.save": "Kaydet",
"button.view-details": "Detayı incele",
"button.websites": "Web siteleri",
- "footer.powered-by": "Sağlayıcı:",
+ "footer.powered-by": "Sağlayıcı: {name}",
"header.nav.dashboard": "Kontrol Paneli",
"header.nav.settings": "Ayarlar",
"label.administrator": "Yönetici",
diff --git a/lang/zh-CN.json b/lang/zh-CN.json
index 1f21eb0f8..3fa4f1c6e 100644
--- a/lang/zh-CN.json
+++ b/lang/zh-CN.json
@@ -13,7 +13,7 @@
"button.save": "保存",
"button.view-details": "查看更多",
"button.websites": "网站",
- "footer.powered-by": "运行",
+ "footer.powered-by": "运行 {name}",
"header.nav.dashboard": "仪表板",
"header.nav.settings": "设置",
"label.administrator": "管理员",
diff --git a/styles/index.css b/styles/index.css
index 5435364f6..619feecf8 100644
--- a/styles/index.css
+++ b/styles/index.css
@@ -56,7 +56,25 @@ select {
a,
a:active,
a:visited {
- color: var(--primary400);
+ position: relative;
+ color: #2c2c2c;
+ text-decoration: none;
+}
+
+a:before {
+ content: '';
+ position: absolute;
+ bottom: -2px;
+ width: 0;
+ height: 2px;
+ background: #2680eb;
+ opacity: 0.5;
+ transition: width 100ms;
+}
+
+a:hover:before {
+ width: 100%;
+ transition: width 100ms;
}
input[type='text'],