Added version to footer. CSS and locale fixes.

This commit is contained in:
Mike Cao 2020-09-09 16:12:29 -07:00
parent cea8e29c8a
commit 6bbe7800c2
16 changed files with 276 additions and 268 deletions

View File

@ -32,6 +32,7 @@ export default function LanguageButton({ menuPosition = 'bottom', menuAlign = 'l
</Button> </Button>
{showMenu && ( {showMenu && (
<Menu <Menu
className={styles.menu}
options={menuOptions} options={menuOptions}
onSelect={handleSelect} onSelect={handleSelect}
float={menuPosition} float={menuPosition}

View File

@ -3,3 +3,7 @@
position: relative; position: relative;
cursor: pointer; cursor: pointer;
} }
.menu {
z-index: 100;
}

View File

@ -46,7 +46,7 @@ export default function UserButton() {
return ( return (
<div ref={ref} className={styles.container}> <div ref={ref} className={styles.container}>
<div onClick={() => setShowMenu(state => !state)}> <div className={styles.button} onClick={() => setShowMenu(state => !state)}>
<Icon icon={<User />} size="large" /> <Icon icon={<User />} size="large" />
<Icon icon={<Chevron />} size="small" /> <Icon icon={<Chevron />} size="small" />
</div> </div>

View File

@ -4,6 +4,11 @@
cursor: pointer; cursor: pointer;
} }
.button {
display: flex;
flex-wrap: nowrap;
}
.username { .username {
border-bottom: 1px solid var(--gray500); border-bottom: 1px solid var(--gray500);
} }

View File

@ -1,23 +1,22 @@
import React from 'react'; import React from 'react';
import { FormattedMessage } from 'react-intl'; import { FormattedMessage } from 'react-intl';
import Link from 'next/link';
import classNames from 'classnames'; import classNames from 'classnames';
import Button from 'components/common/Button'; import Button from 'components/common/Button';
import Logo from 'assets/logo.svg'; import Logo from 'assets/logo.svg';
import styles from './Footer.module.css'; import styles from './Footer.module.css';
export default function Footer() { export default function Footer() {
const version = process.env.VERSION;
return ( return (
<footer className="container"> <footer className="container">
<div className={classNames(styles.footer, 'row justify-content-center')}> <div className={classNames(styles.footer, 'row justify-content-center')}>
<FormattedMessage id="footer.powered-by" defaultMessage="powered by" /> <FormattedMessage id="footer.powered-by" defaultMessage="Powered by" />
<Link href="https://umami.is"> <a href="https://umami.is">
<a>
<Button className={styles.button} icon={<Logo />} size="small"> <Button className={styles.button} icon={<Logo />} size="small">
<b>umami</b> <b>umami</b>
</Button> </Button>
</a> </a>
</Link> <div>{`v${version}`}</div>
</div> </div>
</footer> </footer>
); );

View File

@ -11,5 +11,5 @@
} }
.button { .button {
margin-left: 10px; margin: 0 5px;
} }

View File

@ -15,16 +15,15 @@ export default function Header() {
return ( return (
<header className="container"> <header className="container">
<div className={classNames(styles.header, 'row align-items-center')}> <div className={classNames(styles.header, 'row align-items-center')}>
<div className="col-12 col-md-6"> <div className="col-12 col-md-3">
<div className={styles.title}> <div className={styles.title}>
<Icon icon={<Logo />} size="large" className={styles.logo} /> <Icon icon={<Logo />} size="large" className={styles.logo} />
<Link href={user ? '/' : 'https://umami.is'}>umami</Link> <Link href={user ? '/' : 'https://umami.is'}>umami</Link>
</div> </div>
</div> </div>
<div className="col-12 col-md-6"> <div className="col-12 col-md-9">
<div className={styles.nav}>
{user ? ( {user ? (
<> <div className={styles.nav}>
<Link href="/dashboard"> <Link href="/dashboard">
<FormattedMessage id="header.nav.dashboard" defaultMessage="Dashboard" /> <FormattedMessage id="header.nav.dashboard" defaultMessage="Dashboard" />
</Link> </Link>
@ -33,13 +32,12 @@ export default function Header() {
</Link> </Link>
<LanguageButton menuAlign="right" /> <LanguageButton menuAlign="right" />
<UserButton /> <UserButton />
</> </div>
) : ( ) : (
<LanguageButton menuAlign="right" /> <LanguageButton menuAlign="right" />
)} )}
</div> </div>
</div> </div>
</div>
</header> </header>
); );
} }

View File

@ -12,15 +12,14 @@
} }
.nav { .nav {
list-style: none;
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
align-items: center; align-items: center;
font-size: var(--font-size-normal);
font-weight: 600;
} }
.nav > * { .nav > * {
font-size: var(--font-size-normal);
font-weight: 600;
margin-left: 40px; margin-left: 40px;
} }
@ -28,9 +27,4 @@
.title { .title {
text-align: center; text-align: center;
} }
.nav {
display: flex;
justify-content: space-evenly;
}
} }

View File

@ -67,16 +67,16 @@ export default function WebsiteSettings() {
{ {
key: 'name', key: 'name',
label: <FormattedMessage id="label.name" defaultMessage="Name" />, label: <FormattedMessage id="label.name" defaultMessage="Name" />,
className: 'col-6 col-md-4', className: 'col-6 col-xl-4',
}, },
{ {
key: 'domain', key: 'domain',
label: <FormattedMessage id="label.domain" defaultMessage="Domain" />, label: <FormattedMessage id="label.domain" defaultMessage="Domain" />,
className: 'col-6 col-md-4', className: 'col-6 col-xl-4',
}, },
{ {
key: 'action', key: 'action',
className: classNames(styles.buttons, 'col-12 col-md-4 pt-2 pt-md-0'), className: classNames(styles.buttons, 'col-12 col-xl-4 pt-2 pt-xl-0'),
render: Buttons, render: Buttons,
}, },
]; ];

View File

@ -39,7 +39,7 @@
"defaultMessage": "Details anzeigen" "defaultMessage": "Details anzeigen"
}, },
"footer.powered-by": { "footer.powered-by": {
"defaultMessage": "powered by" "defaultMessage": "Powered by"
}, },
"header.nav.dashboard": { "header.nav.dashboard": {
"defaultMessage": "Übersicht" "defaultMessage": "Übersicht"
@ -236,4 +236,4 @@
"tooltip.get-tracking-code": { "tooltip.get-tracking-code": {
"defaultMessage": "Erstelle Tracking Kennung" "defaultMessage": "Erstelle Tracking Kennung"
} }
} }

View File

@ -39,7 +39,7 @@
"defaultMessage": "View details" "defaultMessage": "View details"
}, },
"footer.powered-by": { "footer.powered-by": {
"defaultMessage": "powered by" "defaultMessage": "Powered by"
}, },
"header.nav.dashboard": { "header.nav.dashboard": {
"defaultMessage": "Dashboard" "defaultMessage": "Dashboard"

View File

@ -1,11 +1,11 @@
import { format } from 'date-fns';
import { enUS, nl, zhCN, tr, ru, de } from 'date-fns/locale';
import enMessages from 'lang-compiled/en.json'; import enMessages from 'lang-compiled/en.json';
import nlMessages from 'lang-compiled/nl-NL.json'; import nlMessages from 'lang-compiled/nl-NL.json';
import zhCNMessages from 'lang-compiled/zh-CN.json'; import zhCNMessages from 'lang-compiled/zh-CN.json';
import trTRMessages from 'lang-compiled/tr-TR.json'; import trTRMessages from 'lang-compiled/tr-TR.json';
import ruRUMessages from 'lang-compiled/ru-RU.json'; import ruRUMessages from 'lang-compiled/ru-RU.json';
import deDEMessages from 'lang-compiled/de-DE.json'; import deDEMessages from 'lang-compiled/de-DE.json';
import { format } from 'date-fns';
import { enUS, nl, zhCN , tr, ru, de} from 'date-fns/locale';
export const messages = { export const messages = {
en: enMessages, en: enMessages,
@ -27,10 +27,10 @@ export const dateLocales = {
export const menuOptions = [ export const menuOptions = [
{ label: 'English', value: 'en', display: 'EN' }, { label: 'English', value: 'en', display: 'EN' },
{ label: 'Nederlands', value: 'nl-NL', display: 'NL' },
{ label: '中文 (Chinese Simplified)', value: 'zh-CN', display: '中文' }, { label: '中文 (Chinese Simplified)', value: 'zh-CN', display: '中文' },
{ label: 'Deutsch' , value:"de-DE", display: 'DE'}, { label: 'Deutsch (German)', value: 'de-DE', display: 'DE' },
{ label: 'Русский', value: 'ru-RU', display: 'РУ' }, { label: 'Nederlands (Dutch)', value: 'nl-NL', display: 'NL' },
{ label: 'Русский (Russian)', value: 'ru-RU', display: 'РУ' },
{ label: 'Turkish', value: 'tr-TR', display: 'TR' }, { label: 'Turkish', value: 'tr-TR', display: 'TR' },
]; ];

View File

@ -1,6 +1,10 @@
require('dotenv').config(); require('dotenv').config();
const pkg = require('./package.json');
module.exports = { module.exports = {
env: {
VERSION: pkg.version,
},
webpack(config) { webpack(config) {
config.module.rules.push({ config.module.rules.push({
test: /\.svg$/, test: /\.svg$/,

View File

@ -33,6 +33,9 @@
"**/*.css": [ "**/*.css": [
"stylelint --fix", "stylelint --fix",
"prettier --write" "prettier --write"
],
"**/*.json": [
"prettier --write"
] ]
}, },
"husky": { "husky": {