mirror of
https://github.com/kremalicious/umami.git
synced 2024-12-24 18:26:20 +01:00
Merge branch 'dev' into dev
This commit is contained in:
commit
115a2560a7
@ -4,3 +4,4 @@ Dockerfile
|
|||||||
.gitignore
|
.gitignore
|
||||||
.DS_Store
|
.DS_Store
|
||||||
node_modules
|
node_modules
|
||||||
|
.idea
|
@ -46,6 +46,7 @@
|
|||||||
"react/react-in-jsx-scope": "off",
|
"react/react-in-jsx-scope": "off",
|
||||||
"react/prop-types": "off",
|
"react/prop-types": "off",
|
||||||
"import/no-anonymous-default-export": "off",
|
"import/no-anonymous-default-export": "off",
|
||||||
|
"import/no-named-as-default": "off",
|
||||||
"@next/next/no-img-element": "off",
|
"@next/next/no-img-element": "off",
|
||||||
"@typescript-eslint/no-empty-function": "off",
|
"@typescript-eslint/no-empty-function": "off",
|
||||||
"@typescript-eslint/no-explicit-any": "off",
|
"@typescript-eslint/no-explicit-any": "off",
|
||||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -17,6 +17,7 @@ node_modules
|
|||||||
/build
|
/build
|
||||||
/public/script.js
|
/public/script.js
|
||||||
/geo
|
/geo
|
||||||
|
/dist
|
||||||
|
|
||||||
# misc
|
# misc
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
@ -1 +1 @@
|
|||||||
/public/
|
/public/script.js
|
@ -1,7 +1,7 @@
|
|||||||
import { Icon, Text, Flexbox } from 'react-basics';
|
import { Icon, Text, Flexbox } from 'react-basics';
|
||||||
import Logo from 'assets/logo.svg';
|
import Logo from 'assets/logo.svg';
|
||||||
|
|
||||||
function EmptyPlaceholder({ message, children }) {
|
export function EmptyPlaceholder({ message, children }) {
|
||||||
return (
|
return (
|
||||||
<Flexbox direction="column" alignItems="center" justifyContent="center" gap={60} height={600}>
|
<Flexbox direction="column" alignItems="center" justifyContent="center" gap={60} height={600}>
|
||||||
<Icon size="xl">
|
<Icon size="xl">
|
||||||
|
@ -2,7 +2,7 @@ import { Icon, Icons, Text } from 'react-basics';
|
|||||||
import styles from './ErrorMessage.module.css';
|
import styles from './ErrorMessage.module.css';
|
||||||
import useMessages from 'hooks/useMessages';
|
import useMessages from 'hooks/useMessages';
|
||||||
|
|
||||||
export default function ErrorMessage() {
|
export function ErrorMessage() {
|
||||||
const { formatMessage, messages } = useMessages();
|
const { formatMessage, messages } = useMessages();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -14,3 +14,5 @@ export default function ErrorMessage() {
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default ErrorMessage;
|
||||||
|
@ -5,7 +5,7 @@ function getHostName(url) {
|
|||||||
return match && match.length > 1 ? match[1] : null;
|
return match && match.length > 1 ? match[1] : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
function Favicon({ domain, ...props }) {
|
export function Favicon({ domain, ...props }) {
|
||||||
const hostName = domain ? getHostName(domain) : null;
|
const hostName = domain ? getHostName(domain) : null;
|
||||||
|
|
||||||
return hostName ? (
|
return hostName ? (
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { ButtonGroup, Button, Flexbox } from 'react-basics';
|
import { ButtonGroup, Button, Flexbox } from 'react-basics';
|
||||||
|
|
||||||
export default function FilterButtons({ items, selectedKey, onSelect }) {
|
export function FilterButtons({ items, selectedKey, onSelect }) {
|
||||||
return (
|
return (
|
||||||
<Flexbox justifyContent="center">
|
<Flexbox justifyContent="center">
|
||||||
<ButtonGroup items={items} selectedKey={selectedKey} onSelect={onSelect}>
|
<ButtonGroup items={items} selectedKey={selectedKey} onSelect={onSelect}>
|
||||||
@ -9,3 +9,5 @@ export default function FilterButtons({ items, selectedKey, onSelect }) {
|
|||||||
</Flexbox>
|
</Flexbox>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default FilterButtons;
|
||||||
|
@ -6,7 +6,7 @@ import usePageQuery from 'hooks/usePageQuery';
|
|||||||
import useMessages from 'hooks/useMessages';
|
import useMessages from 'hooks/useMessages';
|
||||||
import styles from './FilterLink.module.css';
|
import styles from './FilterLink.module.css';
|
||||||
|
|
||||||
export default function FilterLink({ id, value, label, externalUrl }) {
|
export function FilterLink({ id, value, label, externalUrl }) {
|
||||||
const { formatMessage, labels } = useMessages();
|
const { formatMessage, labels } = useMessages();
|
||||||
const { resolveUrl, query } = usePageQuery();
|
const { resolveUrl, query } = usePageQuery();
|
||||||
const active = query[id] !== undefined;
|
const active = query[id] !== undefined;
|
||||||
@ -37,3 +37,5 @@ export default function FilterLink({ id, value, label, externalUrl }) {
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default FilterLink;
|
||||||
|
@ -5,7 +5,7 @@ import Icons from 'components/icons';
|
|||||||
import useMessages from 'hooks/useMessages';
|
import useMessages from 'hooks/useMessages';
|
||||||
import useConfig from 'hooks/useConfig';
|
import useConfig from 'hooks/useConfig';
|
||||||
|
|
||||||
export default function HamburgerButton() {
|
export function HamburgerButton() {
|
||||||
const { formatMessage, labels } = useMessages();
|
const { formatMessage, labels } = useMessages();
|
||||||
const [active, setActive] = useState(false);
|
const [active, setActive] = useState(false);
|
||||||
const { cloudMode } = useConfig();
|
const { cloudMode } = useConfig();
|
||||||
@ -57,3 +57,5 @@ export default function HamburgerButton() {
|
|||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default HamburgerButton;
|
||||||
|
@ -2,7 +2,7 @@ import { useEffect, useState } from 'react';
|
|||||||
import { Tooltip } from 'react-basics';
|
import { Tooltip } from 'react-basics';
|
||||||
import styles from './HoverTooltip.module.css';
|
import styles from './HoverTooltip.module.css';
|
||||||
|
|
||||||
export default function HoverTooltip({ tooltip }) {
|
export function HoverTooltip({ tooltip }) {
|
||||||
const [position, setPosition] = useState({ x: -1000, y: -1000 });
|
const [position, setPosition] = useState({ x: -1000, y: -1000 });
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@ -23,3 +23,5 @@ export default function HoverTooltip({ tooltip }) {
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default HoverTooltip;
|
||||||
|
@ -3,7 +3,7 @@ import { useRouter } from 'next/router';
|
|||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
import styles from './MobileMenu.module.css';
|
import styles from './MobileMenu.module.css';
|
||||||
|
|
||||||
export default function MobileMenu({ items = [], onClose }) {
|
export function MobileMenu({ items = [], onClose }) {
|
||||||
const { pathname } = useRouter();
|
const { pathname } = useRouter();
|
||||||
|
|
||||||
const Items = ({ items, className }) => (
|
const Items = ({ items, className }) => (
|
||||||
@ -34,3 +34,5 @@ export default function MobileMenu({ items = [], onClose }) {
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default MobileMenu;
|
||||||
|
@ -2,7 +2,7 @@ import classNames from 'classnames';
|
|||||||
import styles from './NoData.module.css';
|
import styles from './NoData.module.css';
|
||||||
import useMessages from 'hooks/useMessages';
|
import useMessages from 'hooks/useMessages';
|
||||||
|
|
||||||
function NoData({ className }) {
|
export function NoData({ className }) {
|
||||||
const { formatMessage, messages } = useMessages();
|
const { formatMessage, messages } = useMessages();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { Table, TableHeader, TableBody, TableRow, TableCell, TableColumn } from 'react-basics';
|
import { Table, TableHeader, TableBody, TableRow, TableCell, TableColumn } from 'react-basics';
|
||||||
import styles from './SettingsTable.module.css';
|
import styles from './SettingsTable.module.css';
|
||||||
|
|
||||||
export default function SettingsTable({ columns = [], data = [], children, cellRender }) {
|
export function SettingsTable({ columns = [], data = [], children, cellRender }) {
|
||||||
return (
|
return (
|
||||||
<Table columns={columns} rows={data}>
|
<Table columns={columns} rows={data}>
|
||||||
<TableHeader className={styles.header}>
|
<TableHeader className={styles.header}>
|
||||||
@ -34,3 +34,5 @@ export default function SettingsTable({ columns = [], data = [], children, cellR
|
|||||||
</Table>
|
</Table>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default SettingsTable;
|
||||||
|
@ -6,7 +6,7 @@ import { REPO_URL, VERSION_CHECK } from 'lib/constants';
|
|||||||
import styles from './UpdateNotice.module.css';
|
import styles from './UpdateNotice.module.css';
|
||||||
import useMessages from 'hooks/useMessages';
|
import useMessages from 'hooks/useMessages';
|
||||||
|
|
||||||
export default function UpdateNotice() {
|
export function UpdateNotice() {
|
||||||
const { formatMessage, labels, messages } = useMessages();
|
const { formatMessage, labels, messages } = useMessages();
|
||||||
const { latest, checked, hasUpdate, releaseUrl } = useStore();
|
const { latest, checked, hasUpdate, releaseUrl } = useStore();
|
||||||
const [dismissed, setDismissed] = useState(false);
|
const [dismissed, setDismissed] = useState(false);
|
||||||
@ -50,3 +50,5 @@ export default function UpdateNotice() {
|
|||||||
</Row>
|
</Row>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default UpdateNotice;
|
||||||
|
@ -3,16 +3,16 @@ import { useRouter } from 'next/router';
|
|||||||
import { ComposableMap, Geographies, Geography, ZoomableGroup } from 'react-simple-maps';
|
import { ComposableMap, Geographies, Geography, ZoomableGroup } from 'react-simple-maps';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { colord } from 'colord';
|
import { colord } from 'colord';
|
||||||
import useTheme from 'hooks/useTheme';
|
import HoverTooltip from 'components/common/HoverTooltip';
|
||||||
import { ISO_COUNTRIES, THEME_COLORS, MAP_FILE } from 'lib/constants';
|
import { ISO_COUNTRIES, THEME_COLORS, MAP_FILE } from 'lib/constants';
|
||||||
import styles from './WorldMap.module.css';
|
import useTheme from 'hooks/useTheme';
|
||||||
import useCountryNames from 'hooks/useCountryNames';
|
import useCountryNames from 'hooks/useCountryNames';
|
||||||
import useLocale from 'hooks/useLocale';
|
import useLocale from 'hooks/useLocale';
|
||||||
import HoverTooltip from './HoverTooltip';
|
|
||||||
import { formatLongNumber } from 'lib/format';
|
import { formatLongNumber } from 'lib/format';
|
||||||
import { percentFilter } from 'lib/filters';
|
import { percentFilter } from 'lib/filters';
|
||||||
|
import styles from './WorldMap.module.css';
|
||||||
|
|
||||||
function WorldMap({ data, className }) {
|
export function WorldMap({ data, className }) {
|
||||||
const { basePath } = useRouter();
|
const { basePath } = useRouter();
|
||||||
const [tooltip, setTooltip] = useState();
|
const [tooltip, setTooltip] = useState();
|
||||||
const [theme] = useTheme();
|
const [theme] = useTheme();
|
||||||
|
@ -9,7 +9,7 @@ import useApi from 'hooks/useApi';
|
|||||||
import useDateRange from 'hooks/useDateRange';
|
import useDateRange from 'hooks/useDateRange';
|
||||||
import useMessages from 'hooks/useMessages';
|
import useMessages from 'hooks/useMessages';
|
||||||
|
|
||||||
function DateFilter({ websiteId, value, className }) {
|
export function DateFilter({ websiteId, value, className }) {
|
||||||
const { formatMessage, labels } = useMessages();
|
const { formatMessage, labels } = useMessages();
|
||||||
const { get } = useApi();
|
const { get } = useApi();
|
||||||
const [dateRange, setDateRange] = useDateRange(websiteId);
|
const [dateRange, setDateRange] = useDateRange(websiteId);
|
||||||
|
@ -5,7 +5,7 @@ import useLocale from 'hooks/useLocale';
|
|||||||
import Icons from 'components/icons';
|
import Icons from 'components/icons';
|
||||||
import styles from './LanguageButton.module.css';
|
import styles from './LanguageButton.module.css';
|
||||||
|
|
||||||
export default function LanguageButton() {
|
export function LanguageButton() {
|
||||||
const { locale, saveLocale, dir } = useLocale();
|
const { locale, saveLocale, dir } = useLocale();
|
||||||
const items = Object.keys(languages).map(key => ({ ...languages[key], value: key }));
|
const items = Object.keys(languages).map(key => ({ ...languages[key], value: key }));
|
||||||
|
|
||||||
@ -43,3 +43,5 @@ export default function LanguageButton() {
|
|||||||
</PopupTrigger>
|
</PopupTrigger>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default LanguageButton;
|
||||||
|
@ -2,7 +2,7 @@ import { Button, Icon, Icons, Tooltip } from 'react-basics';
|
|||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
import useMessages from 'hooks/useMessages';
|
import useMessages from 'hooks/useMessages';
|
||||||
|
|
||||||
export default function LogoutButton({ tooltipPosition = 'top' }) {
|
export function LogoutButton({ tooltipPosition = 'top' }) {
|
||||||
const { formatMessage, labels } = useMessages();
|
const { formatMessage, labels } = useMessages();
|
||||||
return (
|
return (
|
||||||
<Link href="/logout">
|
<Link href="/logout">
|
||||||
@ -16,3 +16,5 @@ export default function LogoutButton({ tooltipPosition = 'top' }) {
|
|||||||
</Link>
|
</Link>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default LogoutButton;
|
||||||
|
@ -7,7 +7,7 @@ import useConfig from 'hooks/useConfig';
|
|||||||
import styles from './ProfileButton.module.css';
|
import styles from './ProfileButton.module.css';
|
||||||
import useLocale from 'hooks/useLocale';
|
import useLocale from 'hooks/useLocale';
|
||||||
|
|
||||||
export default function ProfileButton() {
|
export function ProfileButton() {
|
||||||
const { formatMessage, labels } = useMessages();
|
const { formatMessage, labels } = useMessages();
|
||||||
const { user } = useUser();
|
const { user } = useUser();
|
||||||
const { cloudMode } = useConfig();
|
const { cloudMode } = useConfig();
|
||||||
@ -57,3 +57,5 @@ export default function ProfileButton() {
|
|||||||
</PopupTrigger>
|
</PopupTrigger>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default ProfileButton;
|
||||||
|
@ -4,7 +4,7 @@ import useDateRange from 'hooks/useDateRange';
|
|||||||
import Icons from 'components/icons';
|
import Icons from 'components/icons';
|
||||||
import useMessages from 'hooks/useMessages';
|
import useMessages from 'hooks/useMessages';
|
||||||
|
|
||||||
function RefreshButton({ websiteId, isLoading }) {
|
export function RefreshButton({ websiteId, isLoading }) {
|
||||||
const { formatMessage, labels } = useMessages();
|
const { formatMessage, labels } = useMessages();
|
||||||
const [dateRange] = useDateRange(websiteId);
|
const [dateRange] = useDateRange(websiteId);
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ import Icons from 'components/icons';
|
|||||||
import useMessages from 'hooks/useMessages';
|
import useMessages from 'hooks/useMessages';
|
||||||
import styles from './SettingsButton.module.css';
|
import styles from './SettingsButton.module.css';
|
||||||
|
|
||||||
export default function SettingsButton() {
|
export function SettingsButton() {
|
||||||
const { formatMessage, labels } = useMessages();
|
const { formatMessage, labels } = useMessages();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -33,3 +33,5 @@ export default function SettingsButton() {
|
|||||||
</PopupTrigger>
|
</PopupTrigger>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default SettingsButton;
|
||||||
|
@ -4,7 +4,7 @@ import useTheme from 'hooks/useTheme';
|
|||||||
import Icons from 'components/icons';
|
import Icons from 'components/icons';
|
||||||
import styles from './ThemeButton.module.css';
|
import styles from './ThemeButton.module.css';
|
||||||
|
|
||||||
export default function ThemeButton() {
|
export function ThemeButton() {
|
||||||
const [theme, setTheme] = useTheme();
|
const [theme, setTheme] = useTheme();
|
||||||
|
|
||||||
const transitions = useTransition(theme, {
|
const transitions = useTransition(theme, {
|
||||||
@ -34,3 +34,5 @@ export default function ThemeButton() {
|
|||||||
</Button>
|
</Button>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default ThemeButton;
|
||||||
|
@ -2,7 +2,7 @@ import { Dropdown, Item } from 'react-basics';
|
|||||||
import useApi from 'hooks/useApi';
|
import useApi from 'hooks/useApi';
|
||||||
import useMessages from 'hooks/useMessages';
|
import useMessages from 'hooks/useMessages';
|
||||||
|
|
||||||
export default function WebsiteSelect({ websiteId, onSelect }) {
|
export function WebsiteSelect({ websiteId, onSelect }) {
|
||||||
const { formatMessage, labels } = useMessages();
|
const { formatMessage, labels } = useMessages();
|
||||||
const { get, useQuery } = useApi();
|
const { get, useQuery } = useApi();
|
||||||
const { data } = useQuery(['websites:me'], () => get('/me/websites'));
|
const { data } = useQuery(['websites:me'], () => get('/me/websites'));
|
||||||
@ -25,3 +25,5 @@ export default function WebsiteSelect({ websiteId, onSelect }) {
|
|||||||
</Dropdown>
|
</Dropdown>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default WebsiteSelect;
|
||||||
|
@ -8,7 +8,7 @@ import useConfig from 'hooks/useConfig';
|
|||||||
import { CURRENT_VERSION } from 'lib/constants';
|
import { CURRENT_VERSION } from 'lib/constants';
|
||||||
import styles from './AppLayout.module.css';
|
import styles from './AppLayout.module.css';
|
||||||
|
|
||||||
export default function AppLayout({ title, children }) {
|
export function AppLayout({ title, children }) {
|
||||||
const { user } = useRequireLogin();
|
const { user } = useRequireLogin();
|
||||||
const config = useConfig();
|
const config = useConfig();
|
||||||
const { pathname } = useRouter();
|
const { pathname } = useRouter();
|
||||||
@ -34,3 +34,5 @@ export default function AppLayout({ title, children }) {
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default AppLayout;
|
||||||
|
@ -4,7 +4,7 @@ import { CURRENT_VERSION, HOMEPAGE_URL, REPO_URL } from 'lib/constants';
|
|||||||
import { labels } from 'components/messages';
|
import { labels } from 'components/messages';
|
||||||
import styles from './Footer.module.css';
|
import styles from './Footer.module.css';
|
||||||
|
|
||||||
export default function Footer() {
|
export function Footer() {
|
||||||
return (
|
return (
|
||||||
<footer className={styles.footer}>
|
<footer className={styles.footer}>
|
||||||
<Row>
|
<Row>
|
||||||
@ -29,3 +29,5 @@ export default function Footer() {
|
|||||||
</footer>
|
</footer>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default Footer;
|
||||||
|
@ -6,7 +6,7 @@ import SettingsButton from 'components/input/SettingsButton';
|
|||||||
import Icons from 'components/icons';
|
import Icons from 'components/icons';
|
||||||
import styles from './Header.module.css';
|
import styles from './Header.module.css';
|
||||||
|
|
||||||
export default function Header() {
|
export function Header() {
|
||||||
return (
|
return (
|
||||||
<header className={styles.header}>
|
<header className={styles.header}>
|
||||||
<Row>
|
<Row>
|
||||||
@ -27,3 +27,5 @@ export default function Header() {
|
|||||||
</header>
|
</header>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default Header;
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
import { useState } from 'react';
|
|
||||||
import { Icon, Text, Row, Column } from 'react-basics';
|
import { Icon, Text, Row, Column } from 'react-basics';
|
||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
@ -12,7 +11,7 @@ import useMessages from 'hooks/useMessages';
|
|||||||
import { useRouter } from 'next/router';
|
import { useRouter } from 'next/router';
|
||||||
import HamburgerButton from '../common/HamburgerButton';
|
import HamburgerButton from '../common/HamburgerButton';
|
||||||
|
|
||||||
export default function NavBar() {
|
export function NavBar() {
|
||||||
const { pathname } = useRouter();
|
const { pathname } = useRouter();
|
||||||
const { cloudMode } = useConfig();
|
const { cloudMode } = useConfig();
|
||||||
const { formatMessage, labels } = useMessages();
|
const { formatMessage, labels } = useMessages();
|
||||||
@ -61,3 +60,5 @@ export default function NavBar() {
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default NavBar;
|
||||||
|
@ -6,7 +6,7 @@ import Link from 'next/link';
|
|||||||
import Icons from 'components/icons';
|
import Icons from 'components/icons';
|
||||||
import styles from './NavGroup.module.css';
|
import styles from './NavGroup.module.css';
|
||||||
|
|
||||||
export default function NavGroup({
|
export function NavGroup({
|
||||||
title,
|
title,
|
||||||
items,
|
items,
|
||||||
defaultExpanded = true,
|
defaultExpanded = true,
|
||||||
@ -54,3 +54,5 @@ export default function NavGroup({
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default NavGroup;
|
||||||
|
@ -3,7 +3,7 @@ import { Banner, Loading } from 'react-basics';
|
|||||||
import useMessages from 'hooks/useMessages';
|
import useMessages from 'hooks/useMessages';
|
||||||
import styles from './Page.module.css';
|
import styles from './Page.module.css';
|
||||||
|
|
||||||
export default function Page({ className, error, loading, children }) {
|
export function Page({ className, error, loading, children }) {
|
||||||
const { formatMessage, messages } = useMessages();
|
const { formatMessage, messages } = useMessages();
|
||||||
|
|
||||||
if (error) {
|
if (error) {
|
||||||
@ -16,3 +16,5 @@ export default function Page({ className, error, loading, children }) {
|
|||||||
|
|
||||||
return <div className={classNames(styles.page, className)}>{children}</div>;
|
return <div className={classNames(styles.page, className)}>{children}</div>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default Page;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import styles from './PageHeader.module.css';
|
import styles from './PageHeader.module.css';
|
||||||
|
|
||||||
export default function PageHeader({ title, children }) {
|
export function PageHeader({ title, children }) {
|
||||||
return (
|
return (
|
||||||
<div className={styles.header}>
|
<div className={styles.header}>
|
||||||
<div className={styles.title}>{title}</div>
|
<div className={styles.title}>{title}</div>
|
||||||
@ -9,3 +9,5 @@ export default function PageHeader({ title, children }) {
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default PageHeader;
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { Row, Column } from 'react-basics';
|
import { Row, Column } from 'react-basics';
|
||||||
import classNames from 'classnames';
|
|
||||||
import { useRouter } from 'next/router';
|
import { useRouter } from 'next/router';
|
||||||
import SideNav from './SideNav';
|
import SideNav from './SideNav';
|
||||||
import useUser from 'hooks/useUser';
|
import useUser from 'hooks/useUser';
|
||||||
@ -7,7 +6,7 @@ import useMessages from 'hooks/useMessages';
|
|||||||
import useConfig from 'hooks/useConfig';
|
import useConfig from 'hooks/useConfig';
|
||||||
import styles from './SettingsLayout.module.css';
|
import styles from './SettingsLayout.module.css';
|
||||||
|
|
||||||
export default function SettingsLayout({ children }) {
|
export function SettingsLayout({ children }) {
|
||||||
const { user } = useUser();
|
const { user } = useUser();
|
||||||
const { pathname } = useRouter();
|
const { pathname } = useRouter();
|
||||||
const { formatMessage, labels } = useMessages();
|
const { formatMessage, labels } = useMessages();
|
||||||
@ -35,3 +34,5 @@ export default function SettingsLayout({ children }) {
|
|||||||
</Row>
|
</Row>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default SettingsLayout;
|
||||||
|
@ -2,7 +2,7 @@ import { Container } from 'react-basics';
|
|||||||
import Header from './Header';
|
import Header from './Header';
|
||||||
import Footer from './Footer';
|
import Footer from './Footer';
|
||||||
|
|
||||||
export default function ShareLayout({ children }) {
|
export function ShareLayout({ children }) {
|
||||||
return (
|
return (
|
||||||
<Container>
|
<Container>
|
||||||
<Header />
|
<Header />
|
||||||
@ -11,3 +11,5 @@ export default function ShareLayout({ children }) {
|
|||||||
</Container>
|
</Container>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default ShareLayout;
|
||||||
|
@ -4,7 +4,7 @@ import { useRouter } from 'next/router';
|
|||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
import styles from './SideNav.module.css';
|
import styles from './SideNav.module.css';
|
||||||
|
|
||||||
export default function SideNav({ selectedKey, items, shallow, onSelect = () => {} }) {
|
export function SideNav({ selectedKey, items, shallow, onSelect = () => {} }) {
|
||||||
const { asPath } = useRouter();
|
const { asPath } = useRouter();
|
||||||
return (
|
return (
|
||||||
<Menu items={items} selectedKey={selectedKey} className={styles.menu} onSelect={onSelect}>
|
<Menu items={items} selectedKey={selectedKey} className={styles.menu} onSelect={onSelect}>
|
||||||
@ -21,3 +21,5 @@ export default function SideNav({ selectedKey, items, shallow, onSelect = () =>
|
|||||||
</Menu>
|
</Menu>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default SideNav;
|
||||||
|
@ -4,7 +4,7 @@ import useApi from 'hooks/useApi';
|
|||||||
import useMessages from 'hooks/useMessages';
|
import useMessages from 'hooks/useMessages';
|
||||||
import styles from './ActiveUsers.module.css';
|
import styles from './ActiveUsers.module.css';
|
||||||
|
|
||||||
export default function ActiveUsers({ websiteId, value, refetchInterval = 60000 }) {
|
export function ActiveUsers({ websiteId, value, refetchInterval = 60000 }) {
|
||||||
const { formatMessage, messages } = useMessages();
|
const { formatMessage, messages } = useMessages();
|
||||||
const { get, useQuery } = useApi();
|
const { get, useQuery } = useApi();
|
||||||
const { data } = useQuery(
|
const { data } = useQuery(
|
||||||
@ -34,3 +34,5 @@ export default function ActiveUsers({ websiteId, value, refetchInterval = 60000
|
|||||||
</StatusLight>
|
</StatusLight>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default ActiveUsers;
|
||||||
|
@ -11,7 +11,7 @@ import useTheme from 'hooks/useTheme';
|
|||||||
import { DEFAULT_ANIMATION_DURATION, THEME_COLORS } from 'lib/constants';
|
import { DEFAULT_ANIMATION_DURATION, THEME_COLORS } from 'lib/constants';
|
||||||
import styles from './BarChart.module.css';
|
import styles from './BarChart.module.css';
|
||||||
|
|
||||||
export default function BarChart({
|
export function BarChart({
|
||||||
datasets,
|
datasets,
|
||||||
unit,
|
unit,
|
||||||
animationDuration = DEFAULT_ANIMATION_DURATION,
|
animationDuration = DEFAULT_ANIMATION_DURATION,
|
||||||
@ -210,3 +210,5 @@ export default function BarChart({
|
|||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default BarChart;
|
||||||
|
@ -3,7 +3,7 @@ import MetricsTable from 'components/metrics/MetricsTable';
|
|||||||
import { BROWSERS } from 'lib/constants';
|
import { BROWSERS } from 'lib/constants';
|
||||||
import useMessages from 'hooks/useMessages';
|
import useMessages from 'hooks/useMessages';
|
||||||
|
|
||||||
export default function BrowsersTable({ websiteId, ...props }) {
|
export function BrowsersTable({ websiteId, ...props }) {
|
||||||
const { formatMessage, labels } = useMessages();
|
const { formatMessage, labels } = useMessages();
|
||||||
|
|
||||||
function renderLink({ x: browser }) {
|
function renderLink({ x: browser }) {
|
||||||
@ -21,3 +21,5 @@ export default function BrowsersTable({ websiteId, ...props }) {
|
|||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default BrowsersTable;
|
||||||
|
@ -4,7 +4,7 @@ import FilterLink from 'components/common/FilterLink';
|
|||||||
import useLocale from 'hooks/useLocale';
|
import useLocale from 'hooks/useLocale';
|
||||||
import useMessages from 'hooks/useMessages';
|
import useMessages from 'hooks/useMessages';
|
||||||
|
|
||||||
export default function CitiesTable({ websiteId, ...props }) {
|
export function CitiesTable({ websiteId, ...props }) {
|
||||||
const { locale } = useLocale();
|
const { locale } = useLocale();
|
||||||
const { formatMessage, labels } = useMessages();
|
const { formatMessage, labels } = useMessages();
|
||||||
|
|
||||||
@ -28,3 +28,5 @@ export default function CitiesTable({ websiteId, ...props }) {
|
|||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default CitiesTable;
|
||||||
|
@ -4,7 +4,7 @@ import useCountryNames from 'hooks/useCountryNames';
|
|||||||
import useLocale from 'hooks/useLocale';
|
import useLocale from 'hooks/useLocale';
|
||||||
import useMessages from 'hooks/useMessages';
|
import useMessages from 'hooks/useMessages';
|
||||||
|
|
||||||
export default function CountriesTable({ websiteId, ...props }) {
|
export function CountriesTable({ websiteId, ...props }) {
|
||||||
const { locale } = useLocale();
|
const { locale } = useLocale();
|
||||||
const countryNames = useCountryNames(locale);
|
const countryNames = useCountryNames(locale);
|
||||||
const { formatMessage, labels } = useMessages();
|
const { formatMessage, labels } = useMessages();
|
||||||
@ -28,3 +28,5 @@ export default function CountriesTable({ websiteId, ...props }) {
|
|||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default CountriesTable;
|
||||||
|
@ -3,13 +3,12 @@ import useMeasure from 'react-use-measure';
|
|||||||
import { FixedSizeList } from 'react-window';
|
import { FixedSizeList } from 'react-window';
|
||||||
import { useSpring, animated, config } from 'react-spring';
|
import { useSpring, animated, config } from 'react-spring';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { FormattedMessage } from 'react-intl';
|
|
||||||
import NoData from 'components/common/NoData';
|
import NoData from 'components/common/NoData';
|
||||||
import { formatNumber, formatLongNumber } from 'lib/format';
|
import { formatNumber, formatLongNumber } from 'lib/format';
|
||||||
import styles from './DataTable.module.css';
|
import styles from './DataTable.module.css';
|
||||||
import useMessages from '../../hooks/useMessages';
|
import useMessages from '../../hooks/useMessages';
|
||||||
|
|
||||||
export default function DataTable({
|
export function DataTable({
|
||||||
data = [],
|
data = [],
|
||||||
title,
|
title,
|
||||||
metric,
|
metric,
|
||||||
@ -102,3 +101,5 @@ const AnimatedRow = ({
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default DataTable;
|
||||||
|
@ -8,7 +8,7 @@ import { FILTER_DAY, FILTER_RANGE } from 'lib/constants';
|
|||||||
import useMessages from 'hooks/useMessages';
|
import useMessages from 'hooks/useMessages';
|
||||||
import styles from './DatePickerForm.module.css';
|
import styles from './DatePickerForm.module.css';
|
||||||
|
|
||||||
export default function DatePickerForm({
|
export function DatePickerForm({
|
||||||
startDate: defaultStartDate,
|
startDate: defaultStartDate,
|
||||||
endDate: defaultEndDate,
|
endDate: defaultEndDate,
|
||||||
minDate,
|
minDate,
|
||||||
@ -78,3 +78,5 @@ export default function DatePickerForm({
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default DatePickerForm;
|
||||||
|
@ -2,7 +2,7 @@ import MetricsTable from './MetricsTable';
|
|||||||
import FilterLink from 'components/common/FilterLink';
|
import FilterLink from 'components/common/FilterLink';
|
||||||
import useMessages from 'hooks/useMessages';
|
import useMessages from 'hooks/useMessages';
|
||||||
|
|
||||||
export default function DevicesTable({ websiteId, ...props }) {
|
export function DevicesTable({ websiteId, ...props }) {
|
||||||
const { formatMessage, labels } = useMessages();
|
const { formatMessage, labels } = useMessages();
|
||||||
|
|
||||||
function renderLink({ x: device }) {
|
function renderLink({ x: device }) {
|
||||||
@ -26,3 +26,5 @@ export default function DevicesTable({ websiteId, ...props }) {
|
|||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default DevicesTable;
|
||||||
|
@ -9,7 +9,7 @@ import useTimezone from 'hooks/useTimezone';
|
|||||||
import usePageQuery from 'hooks/usePageQuery';
|
import usePageQuery from 'hooks/usePageQuery';
|
||||||
import { EVENT_COLORS } from 'lib/constants';
|
import { EVENT_COLORS } from 'lib/constants';
|
||||||
|
|
||||||
export default function EventsChart({ websiteId, className, token }) {
|
export function EventsChart({ websiteId, className, token }) {
|
||||||
const { get, useQuery } = useApi();
|
const { get, useQuery } = useApi();
|
||||||
const [{ startDate, endDate, unit, modified }] = useDateRange(websiteId);
|
const [{ startDate, endDate, unit, modified }] = useDateRange(websiteId);
|
||||||
const [timezone] = useTimezone();
|
const [timezone] = useTimezone();
|
||||||
@ -76,3 +76,5 @@ export default function EventsChart({ websiteId, className, token }) {
|
|||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default EventsChart;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import MetricsTable from './MetricsTable';
|
import MetricsTable from './MetricsTable';
|
||||||
import useMessages from 'hooks/useMessages';
|
import useMessages from 'hooks/useMessages';
|
||||||
|
|
||||||
export default function EventsTable({ websiteId, ...props }) {
|
export function EventsTable({ websiteId, ...props }) {
|
||||||
const { formatMessage, labels } = useMessages();
|
const { formatMessage, labels } = useMessages();
|
||||||
|
|
||||||
function handleDataLoad(data) {
|
function handleDataLoad(data) {
|
||||||
@ -19,3 +19,5 @@ export default function EventsTable({ websiteId, ...props }) {
|
|||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default EventsTable;
|
||||||
|
@ -4,7 +4,7 @@ import usePageQuery from 'hooks/usePageQuery';
|
|||||||
import styles from './FilterTags.module.css';
|
import styles from './FilterTags.module.css';
|
||||||
import useMessages from 'hooks/useMessages';
|
import useMessages from 'hooks/useMessages';
|
||||||
|
|
||||||
export default function FilterTags({ params }) {
|
export function FilterTags({ params }) {
|
||||||
const { formatMessage, labels } = useMessages();
|
const { formatMessage, labels } = useMessages();
|
||||||
const {
|
const {
|
||||||
router,
|
router,
|
||||||
@ -50,3 +50,5 @@ export default function FilterTags({ params }) {
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default FilterTags;
|
||||||
|
@ -4,7 +4,7 @@ import useLanguageNames from 'hooks/useLanguageNames';
|
|||||||
import useLocale from 'hooks/useLocale';
|
import useLocale from 'hooks/useLocale';
|
||||||
import useMessages from 'hooks/useMessages';
|
import useMessages from 'hooks/useMessages';
|
||||||
|
|
||||||
export default function LanguagesTable({ websiteId, onDataLoad, ...props }) {
|
export function LanguagesTable({ websiteId, onDataLoad, ...props }) {
|
||||||
const { formatMessage, labels } = useMessages();
|
const { formatMessage, labels } = useMessages();
|
||||||
const { locale } = useLocale();
|
const { locale } = useLocale();
|
||||||
const languageNames = useLanguageNames(locale);
|
const languageNames = useLanguageNames(locale);
|
||||||
@ -25,3 +25,5 @@ export default function LanguagesTable({ websiteId, onDataLoad, ...props }) {
|
|||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default LanguagesTable;
|
||||||
|
@ -6,7 +6,7 @@ import useLocale from 'hooks/useLocale';
|
|||||||
import useForceUpdate from 'hooks/useForceUpdate';
|
import useForceUpdate from 'hooks/useForceUpdate';
|
||||||
import styles from './Legend.module.css';
|
import styles from './Legend.module.css';
|
||||||
|
|
||||||
export default function Legend({ chart }) {
|
export function Legend({ chart }) {
|
||||||
const { locale } = useLocale();
|
const { locale } = useLocale();
|
||||||
const forceUpdate = useForceUpdate();
|
const forceUpdate = useForceUpdate();
|
||||||
|
|
||||||
@ -48,3 +48,5 @@ export default function Legend({ chart }) {
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default Legend;
|
||||||
|
@ -3,7 +3,7 @@ import { useSpring, animated } from 'react-spring';
|
|||||||
import { formatNumber } from 'lib/format';
|
import { formatNumber } from 'lib/format';
|
||||||
import styles from './MetricCard.module.css';
|
import styles from './MetricCard.module.css';
|
||||||
|
|
||||||
const MetricCard = ({
|
export const MetricCard = ({
|
||||||
value = 0,
|
value = 0,
|
||||||
change = 0,
|
change = 0,
|
||||||
label,
|
label,
|
||||||
|
@ -9,7 +9,7 @@ import MetricCard from './MetricCard';
|
|||||||
import useMessages from 'hooks/useMessages';
|
import useMessages from 'hooks/useMessages';
|
||||||
import styles from './MetricsBar.module.css';
|
import styles from './MetricsBar.module.css';
|
||||||
|
|
||||||
export default function MetricsBar({ websiteId }) {
|
export function MetricsBar({ websiteId }) {
|
||||||
const { formatMessage, labels } = useMessages();
|
const { formatMessage, labels } = useMessages();
|
||||||
const { get, useQuery } = useApi();
|
const { get, useQuery } = useApi();
|
||||||
const [dateRange] = useDateRange(websiteId);
|
const [dateRange] = useDateRange(websiteId);
|
||||||
@ -111,3 +111,5 @@ export default function MetricsBar({ websiteId }) {
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default MetricsBar;
|
||||||
|
@ -15,7 +15,7 @@ import useMessages from 'hooks/useMessages';
|
|||||||
import styles from './MetricsTable.module.css';
|
import styles from './MetricsTable.module.css';
|
||||||
import useLocale from 'hooks/useLocale';
|
import useLocale from 'hooks/useLocale';
|
||||||
|
|
||||||
export default function MetricsTable({
|
export function MetricsTable({
|
||||||
websiteId,
|
websiteId,
|
||||||
type,
|
type,
|
||||||
className,
|
className,
|
||||||
@ -92,3 +92,5 @@ export default function MetricsTable({
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default MetricsTable;
|
||||||
|
@ -2,7 +2,7 @@ import MetricsTable from './MetricsTable';
|
|||||||
import FilterLink from 'components/common/FilterLink';
|
import FilterLink from 'components/common/FilterLink';
|
||||||
import useMessages from 'hooks/useMessages';
|
import useMessages from 'hooks/useMessages';
|
||||||
|
|
||||||
export default function OSTable({ websiteId, ...props }) {
|
export function OSTable({ websiteId, ...props }) {
|
||||||
const { formatMessage, labels } = useMessages();
|
const { formatMessage, labels } = useMessages();
|
||||||
|
|
||||||
function renderLink({ x: os }) {
|
function renderLink({ x: os }) {
|
||||||
@ -20,3 +20,5 @@ export default function OSTable({ websiteId, ...props }) {
|
|||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default OSTable;
|
||||||
|
@ -5,7 +5,7 @@ import useMessages from 'hooks/useMessages';
|
|||||||
import usePageQuery from 'hooks/usePageQuery';
|
import usePageQuery from 'hooks/usePageQuery';
|
||||||
import { emptyFilter } from 'lib/filters';
|
import { emptyFilter } from 'lib/filters';
|
||||||
|
|
||||||
export default function PagesTable({ websiteId, showFilters, ...props }) {
|
export function PagesTable({ websiteId, showFilters, ...props }) {
|
||||||
const {
|
const {
|
||||||
router,
|
router,
|
||||||
resolveUrl,
|
resolveUrl,
|
||||||
@ -47,3 +47,5 @@ export default function PagesTable({ websiteId, showFilters, ...props }) {
|
|||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default PagesTable;
|
||||||
|
@ -6,15 +6,7 @@ import useTheme from 'hooks/useTheme';
|
|||||||
import useMessages from 'hooks/useMessages';
|
import useMessages from 'hooks/useMessages';
|
||||||
import useLocale from 'hooks/useLocale';
|
import useLocale from 'hooks/useLocale';
|
||||||
|
|
||||||
export default function PageviewsChart({
|
export function PageviewsChart({ websiteId, data, unit, records, className, loading, ...props }) {
|
||||||
websiteId,
|
|
||||||
data,
|
|
||||||
unit,
|
|
||||||
records,
|
|
||||||
className,
|
|
||||||
loading,
|
|
||||||
...props
|
|
||||||
}) {
|
|
||||||
const { formatMessage, labels } = useMessages();
|
const { formatMessage, labels } = useMessages();
|
||||||
const [theme] = useTheme();
|
const [theme] = useTheme();
|
||||||
const { locale } = useLocale();
|
const { locale } = useLocale();
|
||||||
@ -68,3 +60,5 @@ export default function PageviewsChart({
|
|||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default PageviewsChart;
|
||||||
|
@ -12,7 +12,7 @@ const filters = {
|
|||||||
[FILTER_COMBINED]: paramFilter,
|
[FILTER_COMBINED]: paramFilter,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function QueryParametersTable({ websiteId, showFilters, ...props }) {
|
export function QueryParametersTable({ websiteId, showFilters, ...props }) {
|
||||||
const [filter, setFilter] = useState(FILTER_COMBINED);
|
const [filter, setFilter] = useState(FILTER_COMBINED);
|
||||||
const { formatMessage, labels } = useMessages();
|
const { formatMessage, labels } = useMessages();
|
||||||
|
|
||||||
@ -49,3 +49,5 @@ export default function QueryParametersTable({ websiteId, showFilters, ...props
|
|||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default QueryParametersTable;
|
||||||
|
@ -23,7 +23,7 @@ function mapData(data) {
|
|||||||
return arr;
|
return arr;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function RealtimeChart({ data, unit, ...props }) {
|
export function RealtimeChart({ data, unit, ...props }) {
|
||||||
const endDate = startOfMinute(new Date());
|
const endDate = startOfMinute(new Date());
|
||||||
const startDate = subMinutes(endDate, REALTIME_RANGE);
|
const startDate = subMinutes(endDate, REALTIME_RANGE);
|
||||||
const prevEndDate = useRef(endDate);
|
const prevEndDate = useRef(endDate);
|
||||||
@ -58,3 +58,5 @@ export default function RealtimeChart({ data, unit, ...props }) {
|
|||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default RealtimeChart;
|
||||||
|
@ -2,7 +2,7 @@ import MetricsTable from './MetricsTable';
|
|||||||
import FilterLink from 'components/common/FilterLink';
|
import FilterLink from 'components/common/FilterLink';
|
||||||
import useMessages from 'hooks/useMessages';
|
import useMessages from 'hooks/useMessages';
|
||||||
|
|
||||||
export default function ReferrersTable({ websiteId, ...props }) {
|
export function ReferrersTable({ websiteId, ...props }) {
|
||||||
const { formatMessage, labels } = useMessages();
|
const { formatMessage, labels } = useMessages();
|
||||||
|
|
||||||
const renderLink = ({ x: referrer }) => {
|
const renderLink = ({ x: referrer }) => {
|
||||||
@ -29,3 +29,5 @@ export default function ReferrersTable({ websiteId, ...props }) {
|
|||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default ReferrersTable;
|
||||||
|
@ -3,19 +3,25 @@ import { emptyFilter } from 'lib/filters';
|
|||||||
import FilterLink from 'components/common/FilterLink';
|
import FilterLink from 'components/common/FilterLink';
|
||||||
import useLocale from 'hooks/useLocale';
|
import useLocale from 'hooks/useLocale';
|
||||||
import useMessages from 'hooks/useMessages';
|
import useMessages from 'hooks/useMessages';
|
||||||
|
import useCountryNames from 'hooks/useCountryNames';
|
||||||
import regions from 'public/iso-3166-2.json';
|
import regions from 'public/iso-3166-2.json';
|
||||||
|
|
||||||
export default function RegionsTable({ websiteId, ...props }) {
|
export function RegionsTable({ websiteId, ...props }) {
|
||||||
const { locale } = useLocale();
|
const { locale } = useLocale();
|
||||||
const { formatMessage, labels } = useMessages();
|
const { formatMessage, labels } = useMessages();
|
||||||
|
const countryNames = useCountryNames(locale);
|
||||||
|
|
||||||
function renderLink({ x }) {
|
const renderLabel = x => {
|
||||||
|
return regions[x] ? `${regions[x]}, ${countryNames[x.split('-')[0]]}` : x;
|
||||||
|
};
|
||||||
|
|
||||||
|
const renderLink = ({ x }) => {
|
||||||
return (
|
return (
|
||||||
<div className={locale}>
|
<div className={locale}>
|
||||||
<FilterLink id="region" value={x} label={regions[x] || x} />
|
<FilterLink id="region" value={x} label={renderLabel(x)} />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<MetricsTable
|
<MetricsTable
|
||||||
@ -29,3 +35,5 @@ export default function RegionsTable({ websiteId, ...props }) {
|
|||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default RegionsTable;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import MetricsTable from './MetricsTable';
|
import MetricsTable from './MetricsTable';
|
||||||
import useMessages from 'hooks/useMessages';
|
import useMessages from 'hooks/useMessages';
|
||||||
|
|
||||||
export default function ScreenTable({ websiteId, ...props }) {
|
export function ScreenTable({ websiteId, ...props }) {
|
||||||
const { formatMessage, labels } = useMessages();
|
const { formatMessage, labels } = useMessages();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -14,3 +14,5 @@ export default function ScreenTable({ websiteId, ...props }) {
|
|||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default ScreenTable;
|
||||||
|
@ -20,7 +20,7 @@ import useMessages from 'hooks/useMessages';
|
|||||||
import styles from './WebsiteChart.module.css';
|
import styles from './WebsiteChart.module.css';
|
||||||
import useLocale from 'hooks/useLocale';
|
import useLocale from 'hooks/useLocale';
|
||||||
|
|
||||||
export default function WebsiteChart({
|
export function WebsiteChart({
|
||||||
websiteId,
|
websiteId,
|
||||||
name,
|
name,
|
||||||
domain,
|
domain,
|
||||||
@ -128,3 +128,5 @@ export default function WebsiteChart({
|
|||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default WebsiteChart;
|
||||||
|
@ -3,7 +3,7 @@ import Favicon from 'components/common/Favicon';
|
|||||||
import ActiveUsers from './ActiveUsers';
|
import ActiveUsers from './ActiveUsers';
|
||||||
import styles from './WebsiteHeader.module.css';
|
import styles from './WebsiteHeader.module.css';
|
||||||
|
|
||||||
export default function WebsiteHeader({ websiteId, name, domain, children }) {
|
export function WebsiteHeader({ websiteId, name, domain, children }) {
|
||||||
return (
|
return (
|
||||||
<Row className={styles.header} justifyContent="center">
|
<Row className={styles.header} justifyContent="center">
|
||||||
<Column className={styles.title} variant="two">
|
<Column className={styles.title} variant="two">
|
||||||
@ -17,3 +17,5 @@ export default function WebsiteHeader({ websiteId, name, domain, children }) {
|
|||||||
</Row>
|
</Row>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default WebsiteHeader;
|
||||||
|
@ -11,7 +11,7 @@ import Script from 'next/script';
|
|||||||
import { Button, Column, Row } from 'react-basics';
|
import { Button, Column, Row } from 'react-basics';
|
||||||
import styles from './TestConsole.module.css';
|
import styles from './TestConsole.module.css';
|
||||||
|
|
||||||
export default function TestConsole() {
|
export function TestConsole() {
|
||||||
const { get, useQuery } = useApi();
|
const { get, useQuery } = useApi();
|
||||||
const { data, isLoading, error } = useQuery(['websites:me'], () => get('/me/websites'));
|
const { data, isLoading, error } = useQuery(['websites:me'], () => get('/me/websites'));
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
@ -132,3 +132,5 @@ export default function TestConsole() {
|
|||||||
</Page>
|
</Page>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default TestConsole;
|
||||||
|
@ -12,7 +12,7 @@ import useDashboard from 'store/dashboard';
|
|||||||
import useMessages from 'hooks/useMessages';
|
import useMessages from 'hooks/useMessages';
|
||||||
import useLocale from 'hooks/useLocale';
|
import useLocale from 'hooks/useLocale';
|
||||||
|
|
||||||
export default function Dashboard({ userId }) {
|
export function Dashboard({ userId }) {
|
||||||
const { formatMessage, labels, messages } = useMessages();
|
const { formatMessage, labels, messages } = useMessages();
|
||||||
const dashboard = useDashboard();
|
const dashboard = useDashboard();
|
||||||
const { showCharts, limit, editing } = dashboard;
|
const { showCharts, limit, editing } = dashboard;
|
||||||
@ -62,3 +62,5 @@ export default function Dashboard({ userId }) {
|
|||||||
</Page>
|
</Page>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default Dashboard;
|
||||||
|
@ -9,7 +9,7 @@ import styles from './DashboardEdit.module.css';
|
|||||||
|
|
||||||
const dragId = 'dashboard-website-ordering';
|
const dragId = 'dashboard-website-ordering';
|
||||||
|
|
||||||
export default function DashboardEdit({ websites }) {
|
export function DashboardEdit({ websites }) {
|
||||||
const settings = useDashboard();
|
const settings = useDashboard();
|
||||||
const { websiteOrder } = settings;
|
const { websiteOrder } = settings;
|
||||||
const { formatMessage, labels } = useMessages();
|
const { formatMessage, labels } = useMessages();
|
||||||
@ -98,3 +98,5 @@ export default function DashboardEdit({ websites }) {
|
|||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default DashboardEdit;
|
||||||
|
@ -3,7 +3,7 @@ import Icons from 'components/icons';
|
|||||||
import { saveDashboard } from 'store/dashboard';
|
import { saveDashboard } from 'store/dashboard';
|
||||||
import useMessages from 'hooks/useMessages';
|
import useMessages from 'hooks/useMessages';
|
||||||
|
|
||||||
export default function DashboardSettingsButton() {
|
export function DashboardSettingsButton() {
|
||||||
const { formatMessage, labels } = useMessages();
|
const { formatMessage, labels } = useMessages();
|
||||||
|
|
||||||
const menuOptions = [
|
const menuOptions = [
|
||||||
@ -42,3 +42,5 @@ export default function DashboardSettingsButton() {
|
|||||||
</PopupTrigger>
|
</PopupTrigger>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default DashboardSettingsButton;
|
||||||
|
@ -17,7 +17,7 @@ import useMessages from 'hooks/useMessages';
|
|||||||
import Logo from 'assets/logo.svg';
|
import Logo from 'assets/logo.svg';
|
||||||
import styles from './LoginForm.module.css';
|
import styles from './LoginForm.module.css';
|
||||||
|
|
||||||
export default function LoginForm() {
|
export function LoginForm() {
|
||||||
const { formatMessage, labels, getMessage } = useMessages();
|
const { formatMessage, labels, getMessage } = useMessages();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { post } = useApi();
|
const { post } = useApi();
|
||||||
@ -60,3 +60,5 @@ export default function LoginForm() {
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default LoginForm;
|
||||||
|
@ -2,7 +2,7 @@ import Head from 'next/head';
|
|||||||
import useLocale from 'hooks/useLocale';
|
import useLocale from 'hooks/useLocale';
|
||||||
import styles from './LoginLayout.module.css';
|
import styles from './LoginLayout.module.css';
|
||||||
|
|
||||||
export default function LoginLayout({ children }) {
|
export function LoginLayout({ children }) {
|
||||||
const { dir } = useLocale();
|
const { dir } = useLocale();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -14,3 +14,5 @@ export default function LoginLayout({ children }) {
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default LoginLayout;
|
||||||
|
@ -4,7 +4,7 @@ import useLocale from 'hooks/useLocale';
|
|||||||
import useCountryNames from 'hooks/useCountryNames';
|
import useCountryNames from 'hooks/useCountryNames';
|
||||||
import useMessages from 'hooks/useMessages';
|
import useMessages from 'hooks/useMessages';
|
||||||
|
|
||||||
export default function RealtimeCountries({ data }) {
|
export function RealtimeCountries({ data }) {
|
||||||
const { formatMessage, labels } = useMessages();
|
const { formatMessage, labels } = useMessages();
|
||||||
const { locale } = useLocale();
|
const { locale } = useLocale();
|
||||||
const countryNames = useCountryNames(locale);
|
const countryNames = useCountryNames(locale);
|
||||||
@ -23,3 +23,5 @@ export default function RealtimeCountries({ data }) {
|
|||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default RealtimeCountries;
|
||||||
|
@ -25,7 +25,7 @@ function mergeData(state = [], data = [], time) {
|
|||||||
.filter(({ timestamp }) => timestamp >= time);
|
.filter(({ timestamp }) => timestamp >= time);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function RealtimeDashboard({ websiteId }) {
|
export function RealtimeDashboard({ websiteId }) {
|
||||||
const { formatMessage, labels } = useMessages();
|
const { formatMessage, labels } = useMessages();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const [currentData, setCurrentData] = useState();
|
const [currentData, setCurrentData] = useState();
|
||||||
@ -125,3 +125,5 @@ export default function RealtimeDashboard({ websiteId }) {
|
|||||||
</Page>
|
</Page>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default RealtimeDashboard;
|
||||||
|
@ -2,7 +2,7 @@ import MetricCard from 'components/metrics/MetricCard';
|
|||||||
import useMessages from 'hooks/useMessages';
|
import useMessages from 'hooks/useMessages';
|
||||||
import styles from './RealtimeHeader.module.css';
|
import styles from './RealtimeHeader.module.css';
|
||||||
|
|
||||||
export default function RealtimeHeader({ data = {} }) {
|
export function RealtimeHeader({ data = {} }) {
|
||||||
const { formatMessage, labels } = useMessages();
|
const { formatMessage, labels } = useMessages();
|
||||||
const { pageviews, visitors, events, countries } = data;
|
const { pageviews, visitors, events, countries } = data;
|
||||||
|
|
||||||
@ -37,3 +37,5 @@ export default function RealtimeHeader({ data = {} }) {
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default RealtimeHeader;
|
||||||
|
@ -6,7 +6,7 @@ import useApi from 'hooks/useApi';
|
|||||||
import EmptyPlaceholder from 'components/common/EmptyPlaceholder';
|
import EmptyPlaceholder from 'components/common/EmptyPlaceholder';
|
||||||
import useMessages from 'hooks/useMessages';
|
import useMessages from 'hooks/useMessages';
|
||||||
|
|
||||||
export default function RealtimeHome() {
|
export function RealtimeHome() {
|
||||||
const { formatMessage, labels, messages } = useMessages();
|
const { formatMessage, labels, messages } = useMessages();
|
||||||
const { get, useQuery } = useApi();
|
const { get, useQuery } = useApi();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
@ -27,3 +27,5 @@ export default function RealtimeHome() {
|
|||||||
</Page>
|
</Page>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default RealtimeHome;
|
||||||
|
@ -25,7 +25,7 @@ const icons = {
|
|||||||
[TYPE_EVENT]: <Icons.Bolt />,
|
[TYPE_EVENT]: <Icons.Bolt />,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function RealtimeLog({ data, websiteDomain }) {
|
export function RealtimeLog({ data, websiteDomain }) {
|
||||||
const { formatMessage, labels, messages, FormattedMessage } = useMessages();
|
const { formatMessage, labels, messages, FormattedMessage } = useMessages();
|
||||||
const { locale } = useLocale();
|
const { locale } = useLocale();
|
||||||
const countryNames = useCountryNames(locale);
|
const countryNames = useCountryNames(locale);
|
||||||
@ -154,3 +154,5 @@ export default function RealtimeLog({ data, websiteDomain }) {
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default RealtimeLog;
|
||||||
|
@ -6,7 +6,7 @@ import DataTable from 'components/metrics/DataTable';
|
|||||||
import { FILTER_PAGES, FILTER_REFERRERS } from 'lib/constants';
|
import { FILTER_PAGES, FILTER_REFERRERS } from 'lib/constants';
|
||||||
import useMessages from 'hooks/useMessages';
|
import useMessages from 'hooks/useMessages';
|
||||||
|
|
||||||
export default function RealtimeUrls({ websiteDomain, data = {} }) {
|
export function RealtimeUrls({ websiteDomain, data = {} }) {
|
||||||
const { formatMessage, labels } = useMessages();
|
const { formatMessage, labels } = useMessages();
|
||||||
const { pageviews } = data;
|
const { pageviews } = data;
|
||||||
const [filter, setFilter] = useState(FILTER_REFERRERS);
|
const [filter, setFilter] = useState(FILTER_REFERRERS);
|
||||||
@ -97,3 +97,5 @@ export default function RealtimeUrls({ websiteDomain, data = {} }) {
|
|||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default RealtimeUrls;
|
||||||
|
@ -4,7 +4,7 @@ import useDateRange from 'hooks/useDateRange';
|
|||||||
import { DEFAULT_DATE_RANGE } from 'lib/constants';
|
import { DEFAULT_DATE_RANGE } from 'lib/constants';
|
||||||
import useMessages from 'hooks/useMessages';
|
import useMessages from 'hooks/useMessages';
|
||||||
|
|
||||||
export default function DateRangeSetting() {
|
export function DateRangeSetting() {
|
||||||
const { formatMessage, labels } = useMessages();
|
const { formatMessage, labels } = useMessages();
|
||||||
const [dateRange, setDateRange] = useDateRange();
|
const [dateRange, setDateRange] = useDateRange();
|
||||||
const { startDate, endDate, value } = dateRange;
|
const { startDate, endDate, value } = dateRange;
|
||||||
@ -18,3 +18,5 @@ export default function DateRangeSetting() {
|
|||||||
</Flexbox>
|
</Flexbox>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default DateRangeSetting;
|
||||||
|
@ -4,7 +4,7 @@ import { DEFAULT_LOCALE } from 'lib/constants';
|
|||||||
import { languages } from 'lib/lang';
|
import { languages } from 'lib/lang';
|
||||||
import useMessages from 'hooks/useMessages';
|
import useMessages from 'hooks/useMessages';
|
||||||
|
|
||||||
export default function LanguageSetting() {
|
export function LanguageSetting() {
|
||||||
const { formatMessage, labels } = useMessages();
|
const { formatMessage, labels } = useMessages();
|
||||||
const { locale, saveLocale } = useLocale();
|
const { locale, saveLocale } = useLocale();
|
||||||
const options = Object.keys(languages);
|
const options = Object.keys(languages);
|
||||||
@ -28,3 +28,5 @@ export default function LanguageSetting() {
|
|||||||
</Flexbox>
|
</Flexbox>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default LanguageSetting;
|
||||||
|
@ -3,7 +3,7 @@ import PasswordEditForm from 'components/pages/settings/profile/PasswordEditForm
|
|||||||
import Icons from 'components/icons';
|
import Icons from 'components/icons';
|
||||||
import useMessages from 'hooks/useMessages';
|
import useMessages from 'hooks/useMessages';
|
||||||
|
|
||||||
export default function PasswordChangeButton() {
|
export function PasswordChangeButton() {
|
||||||
const { formatMessage, labels, messages } = useMessages();
|
const { formatMessage, labels, messages } = useMessages();
|
||||||
const { toast, showToast } = useToast();
|
const { toast, showToast } = useToast();
|
||||||
|
|
||||||
@ -28,3 +28,5 @@ export default function PasswordChangeButton() {
|
|||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default PasswordChangeButton;
|
||||||
|
@ -3,7 +3,7 @@ import { Form, FormRow, FormInput, FormButtons, PasswordField, Button } from 're
|
|||||||
import useApi from 'hooks/useApi';
|
import useApi from 'hooks/useApi';
|
||||||
import useMessages from 'hooks/useMessages';
|
import useMessages from 'hooks/useMessages';
|
||||||
|
|
||||||
export default function PasswordEditForm({ onSave, onClose }) {
|
export function PasswordEditForm({ onSave, onClose }) {
|
||||||
const { formatMessage, labels, messages } = useMessages();
|
const { formatMessage, labels, messages } = useMessages();
|
||||||
const { post, useMutation } = useApi();
|
const { post, useMutation } = useApi();
|
||||||
const { mutate, error, isLoading } = useMutation(data => post('/me/password', data));
|
const { mutate, error, isLoading } = useMutation(data => post('/me/password', data));
|
||||||
@ -64,3 +64,5 @@ export default function PasswordEditForm({ onSave, onClose }) {
|
|||||||
</Form>
|
</Form>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default PasswordEditForm;
|
||||||
|
@ -8,7 +8,7 @@ import useUser from 'hooks/useUser';
|
|||||||
import useMessages from 'hooks/useMessages';
|
import useMessages from 'hooks/useMessages';
|
||||||
import useConfig from 'hooks/useConfig';
|
import useConfig from 'hooks/useConfig';
|
||||||
|
|
||||||
export default function ProfileDetails() {
|
export function ProfileDetails() {
|
||||||
const { user } = useUser();
|
const { user } = useUser();
|
||||||
const { formatMessage, labels } = useMessages();
|
const { formatMessage, labels } = useMessages();
|
||||||
const { cloudMode } = useConfig();
|
const { cloudMode } = useConfig();
|
||||||
@ -45,3 +45,5 @@ export default function ProfileDetails() {
|
|||||||
</Form>
|
</Form>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default ProfileDetails;
|
||||||
|
@ -3,7 +3,7 @@ import PageHeader from 'components/layout/PageHeader';
|
|||||||
import ProfileDetails from './ProfileDetails';
|
import ProfileDetails from './ProfileDetails';
|
||||||
import useMessages from 'hooks/useMessages';
|
import useMessages from 'hooks/useMessages';
|
||||||
|
|
||||||
export default function ProfileSettings() {
|
export function ProfileSettings() {
|
||||||
const { formatMessage, labels } = useMessages();
|
const { formatMessage, labels } = useMessages();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -13,3 +13,5 @@ export default function ProfileSettings() {
|
|||||||
</Page>
|
</Page>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default ProfileSettings;
|
||||||
|
@ -5,7 +5,7 @@ import Sun from 'assets/sun.svg';
|
|||||||
import Moon from 'assets/moon.svg';
|
import Moon from 'assets/moon.svg';
|
||||||
import styles from './ThemeSetting.module.css';
|
import styles from './ThemeSetting.module.css';
|
||||||
|
|
||||||
export default function ThemeSetting() {
|
export function ThemeSetting() {
|
||||||
const [theme, setTheme] = useTheme();
|
const [theme, setTheme] = useTheme();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -29,3 +29,5 @@ export default function ThemeSetting() {
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default ThemeSetting;
|
||||||
|
@ -4,7 +4,7 @@ import useTimezone from 'hooks/useTimezone';
|
|||||||
import useMessages from 'hooks/useMessages';
|
import useMessages from 'hooks/useMessages';
|
||||||
import { getTimezone } from 'lib/date';
|
import { getTimezone } from 'lib/date';
|
||||||
|
|
||||||
export default function TimezoneSetting() {
|
export function TimezoneSetting() {
|
||||||
const { formatMessage, labels } = useMessages();
|
const { formatMessage, labels } = useMessages();
|
||||||
const [timezone, saveTimezone] = useTimezone();
|
const [timezone, saveTimezone] = useTimezone();
|
||||||
const options = listTimeZones();
|
const options = listTimeZones();
|
||||||
@ -26,3 +26,5 @@ export default function TimezoneSetting() {
|
|||||||
</Flexbox>
|
</Flexbox>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default TimezoneSetting;
|
||||||
|
@ -11,7 +11,7 @@ import {
|
|||||||
import useApi from 'hooks/useApi';
|
import useApi from 'hooks/useApi';
|
||||||
import useMessages from 'hooks/useMessages';
|
import useMessages from 'hooks/useMessages';
|
||||||
|
|
||||||
export default function TeamAddForm({ onSave, onClose }) {
|
export function TeamAddForm({ onSave, onClose }) {
|
||||||
const { formatMessage, labels } = useMessages();
|
const { formatMessage, labels } = useMessages();
|
||||||
const { post, useMutation } = useApi();
|
const { post, useMutation } = useApi();
|
||||||
const { mutate, error, isLoading } = useMutation(data => post('/teams', data));
|
const { mutate, error, isLoading } = useMutation(data => post('/teams', data));
|
||||||
@ -44,3 +44,5 @@ export default function TeamAddForm({ onSave, onClose }) {
|
|||||||
</Form>
|
</Form>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default TeamAddForm;
|
||||||
|
@ -4,7 +4,7 @@ import { Button, Dropdown, Form, FormButtons, FormRow, Item, SubmitButton } from
|
|||||||
import WebsiteTags from './WebsiteTags';
|
import WebsiteTags from './WebsiteTags';
|
||||||
import useMessages from 'hooks/useMessages';
|
import useMessages from 'hooks/useMessages';
|
||||||
|
|
||||||
export default function TeamAddWebsiteForm({ teamId, onSave, onClose }) {
|
export function TeamAddWebsiteForm({ teamId, onSave, onClose }) {
|
||||||
const { formatMessage, labels } = useMessages();
|
const { formatMessage, labels } = useMessages();
|
||||||
const { get, post, useQuery, useMutation } = useApi();
|
const { get, post, useQuery, useMutation } = useApi();
|
||||||
const { mutate, error } = useMutation(data => post(`/teams/${teamId}/websites`, data));
|
const { mutate, error } = useMutation(data => post(`/teams/${teamId}/websites`, data));
|
||||||
@ -59,3 +59,5 @@ export default function TeamAddWebsiteForm({ teamId, onSave, onClose }) {
|
|||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default TeamAddWebsiteForm;
|
||||||
|
@ -2,7 +2,7 @@ import { Button, Form, FormButtons, SubmitButton } from 'react-basics';
|
|||||||
import useApi from 'hooks/useApi';
|
import useApi from 'hooks/useApi';
|
||||||
import useMessages from 'hooks/useMessages';
|
import useMessages from 'hooks/useMessages';
|
||||||
|
|
||||||
export default function TeamDeleteForm({ teamId, teamName, onSave, onClose }) {
|
export function TeamDeleteForm({ teamId, teamName, onSave, onClose }) {
|
||||||
const { formatMessage, labels, messages, FormattedMessage } = useMessages();
|
const { formatMessage, labels, messages, FormattedMessage } = useMessages();
|
||||||
const { del, useMutation } = useApi();
|
const { del, useMutation } = useApi();
|
||||||
const { mutate, error, isLoading } = useMutation(data => del(`/teams/${teamId}`, data));
|
const { mutate, error, isLoading } = useMutation(data => del(`/teams/${teamId}`, data));
|
||||||
@ -30,3 +30,5 @@ export default function TeamDeleteForm({ teamId, teamName, onSave, onClose }) {
|
|||||||
</Form>
|
</Form>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default TeamDeleteForm;
|
||||||
|
@ -15,7 +15,7 @@ import useMessages from 'hooks/useMessages';
|
|||||||
|
|
||||||
const generateId = () => getRandomChars(16);
|
const generateId = () => getRandomChars(16);
|
||||||
|
|
||||||
export default function TeamEditForm({ teamId, data, onSave, readOnly }) {
|
export function TeamEditForm({ teamId, data, onSave, readOnly }) {
|
||||||
const { formatMessage, labels } = useMessages();
|
const { formatMessage, labels } = useMessages();
|
||||||
const { post, useMutation } = useApi();
|
const { post, useMutation } = useApi();
|
||||||
const { mutate, error } = useMutation(data => post(`/teams/${teamId}`, data));
|
const { mutate, error } = useMutation(data => post(`/teams/${teamId}`, data));
|
||||||
@ -69,3 +69,5 @@ export default function TeamEditForm({ teamId, data, onSave, readOnly }) {
|
|||||||
</Form>
|
</Form>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default TeamEditForm;
|
||||||
|
@ -11,7 +11,7 @@ import {
|
|||||||
import useApi from 'hooks/useApi';
|
import useApi from 'hooks/useApi';
|
||||||
import useMessages from 'hooks/useMessages';
|
import useMessages from 'hooks/useMessages';
|
||||||
|
|
||||||
export default function TeamJoinForm({ onSave, onClose }) {
|
export function TeamJoinForm({ onSave, onClose }) {
|
||||||
const { formatMessage, labels, getMessage } = useMessages();
|
const { formatMessage, labels, getMessage } = useMessages();
|
||||||
const { post, useMutation } = useApi();
|
const { post, useMutation } = useApi();
|
||||||
const { mutate, error } = useMutation(data => post('/teams/join', data));
|
const { mutate, error } = useMutation(data => post('/teams/join', data));
|
||||||
@ -40,3 +40,5 @@ export default function TeamJoinForm({ onSave, onClose }) {
|
|||||||
</Form>
|
</Form>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default TeamJoinForm;
|
@ -2,7 +2,7 @@ import { Button, Form, FormButtons, SubmitButton } from 'react-basics';
|
|||||||
import useApi from 'hooks/useApi';
|
import useApi from 'hooks/useApi';
|
||||||
import useMessages from 'hooks/useMessages';
|
import useMessages from 'hooks/useMessages';
|
||||||
|
|
||||||
export default function TeamLeaveForm({ teamId, userId, teamName, onSave, onClose }) {
|
export function TeamLeaveForm({ teamId, userId, teamName, onSave, onClose }) {
|
||||||
const { formatMessage, labels, messages, FormattedMessage } = useMessages();
|
const { formatMessage, labels, messages, FormattedMessage } = useMessages();
|
||||||
const { del, useMutation } = useApi();
|
const { del, useMutation } = useApi();
|
||||||
const { mutate, error, isLoading } = useMutation(() => del(`/team/${teamId}/users/${userId}`));
|
const { mutate, error, isLoading } = useMutation(() => del(`/team/${teamId}/users/${userId}`));
|
||||||
@ -33,3 +33,5 @@ export default function TeamLeaveForm({ teamId, userId, teamName, onSave, onClos
|
|||||||
</Form>
|
</Form>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default TeamLeaveForm;
|
||||||
|
@ -2,7 +2,7 @@ import useApi from 'hooks/useApi';
|
|||||||
import useMessages from 'hooks/useMessages';
|
import useMessages from 'hooks/useMessages';
|
||||||
import { Icon, Icons, LoadingButton, Text } from 'react-basics';
|
import { Icon, Icons, LoadingButton, Text } from 'react-basics';
|
||||||
|
|
||||||
export default function TeamMemberRemoveButton({ teamId, userId, disabled, onSave }) {
|
export function TeamMemberRemoveButton({ teamId, userId, disabled, onSave }) {
|
||||||
const { formatMessage, labels } = useMessages();
|
const { formatMessage, labels } = useMessages();
|
||||||
const { del, useMutation } = useApi();
|
const { del, useMutation } = useApi();
|
||||||
const { mutate, isLoading } = useMutation(() => del(`/team/${teamId}/users/${userId}`));
|
const { mutate, isLoading } = useMutation(() => del(`/team/${teamId}/users/${userId}`));
|
||||||
@ -27,3 +27,5 @@ export default function TeamMemberRemoveButton({ teamId, userId, disabled, onSav
|
|||||||
</LoadingButton>
|
</LoadingButton>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default TeamMemberRemoveButton;
|
||||||
|
@ -3,7 +3,7 @@ import TeamMembersTable from 'components/pages/settings/teams/TeamMembersTable';
|
|||||||
import useApi from 'hooks/useApi';
|
import useApi from 'hooks/useApi';
|
||||||
import useMessages from 'hooks/useMessages';
|
import useMessages from 'hooks/useMessages';
|
||||||
|
|
||||||
export default function TeamMembers({ teamId, readOnly }) {
|
export function TeamMembers({ teamId, readOnly }) {
|
||||||
const { toast, showToast } = useToast();
|
const { toast, showToast } = useToast();
|
||||||
const { get, useQuery } = useApi();
|
const { get, useQuery } = useApi();
|
||||||
const { formatMessage, messages } = useMessages();
|
const { formatMessage, messages } = useMessages();
|
||||||
@ -27,3 +27,5 @@ export default function TeamMembers({ teamId, readOnly }) {
|
|||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default TeamMembers;
|
||||||
|
@ -4,7 +4,7 @@ import { ROLES } from 'lib/constants';
|
|||||||
import TeamMemberRemoveButton from './TeamMemberRemoveButton';
|
import TeamMemberRemoveButton from './TeamMemberRemoveButton';
|
||||||
import SettingsTable from 'components/common/SettingsTable';
|
import SettingsTable from 'components/common/SettingsTable';
|
||||||
|
|
||||||
export default function TeamMembersTable({ data = [], onSave, readOnly }) {
|
export function TeamMembersTable({ data = [], onSave, readOnly }) {
|
||||||
const { formatMessage, labels } = useMessages();
|
const { formatMessage, labels } = useMessages();
|
||||||
const { user } = useUser();
|
const { user } = useUser();
|
||||||
|
|
||||||
@ -43,3 +43,5 @@ export default function TeamMembersTable({ data = [], onSave, readOnly }) {
|
|||||||
</SettingsTable>
|
</SettingsTable>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default TeamMembersTable;
|
||||||
|
@ -11,7 +11,7 @@ import TeamEditForm from './TeamEditForm';
|
|||||||
import TeamMembers from './TeamMembers';
|
import TeamMembers from './TeamMembers';
|
||||||
import TeamWebsites from './TeamWebsites';
|
import TeamWebsites from './TeamWebsites';
|
||||||
|
|
||||||
export default function TeamSettings({ teamId }) {
|
export function TeamSettings({ teamId }) {
|
||||||
const { formatMessage, labels, messages } = useMessages();
|
const { formatMessage, labels, messages } = useMessages();
|
||||||
const { user } = useUser();
|
const { user } = useUser();
|
||||||
const [values, setValues] = useState(null);
|
const [values, setValues] = useState(null);
|
||||||
@ -68,3 +68,5 @@ export default function TeamSettings({ teamId }) {
|
|||||||
</Page>
|
</Page>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default TeamSettings;
|
||||||
|
@ -2,7 +2,7 @@ import useApi from 'hooks/useApi';
|
|||||||
import useMessages from 'hooks/useMessages';
|
import useMessages from 'hooks/useMessages';
|
||||||
import { Icon, Icons, LoadingButton, Text } from 'react-basics';
|
import { Icon, Icons, LoadingButton, Text } from 'react-basics';
|
||||||
|
|
||||||
export default function TeamWebsiteRemoveButton({ teamId, websiteId, onSave }) {
|
export function TeamWebsiteRemoveButton({ teamId, websiteId, onSave }) {
|
||||||
const { formatMessage, labels } = useMessages();
|
const { formatMessage, labels } = useMessages();
|
||||||
const { del, useMutation } = useApi();
|
const { del, useMutation } = useApi();
|
||||||
const { mutate, isLoading } = useMutation(() => del(`/teams/${teamId}/websites/${websiteId}`));
|
const { mutate, isLoading } = useMutation(() => del(`/teams/${teamId}/websites/${websiteId}`));
|
||||||
@ -27,3 +27,5 @@ export default function TeamWebsiteRemoveButton({ teamId, websiteId, onSave }) {
|
|||||||
</LoadingButton>
|
</LoadingButton>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default TeamWebsiteRemoveButton;
|
||||||
|
@ -14,7 +14,7 @@ import TeamAddWebsiteForm from 'components/pages/settings/teams/TeamAddWebsiteFo
|
|||||||
import useApi from 'hooks/useApi';
|
import useApi from 'hooks/useApi';
|
||||||
import useMessages from 'hooks/useMessages';
|
import useMessages from 'hooks/useMessages';
|
||||||
|
|
||||||
export default function TeamWebsites({ teamId }) {
|
export function TeamWebsites({ teamId }) {
|
||||||
const { toast, showToast } = useToast();
|
const { toast, showToast } = useToast();
|
||||||
const { formatMessage, labels, messages } = useMessages();
|
const { formatMessage, labels, messages } = useMessages();
|
||||||
const { get, useQuery } = useApi();
|
const { get, useQuery } = useApi();
|
||||||
@ -54,3 +54,5 @@ export default function TeamWebsites({ teamId }) {
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default TeamWebsites;
|
||||||
|
@ -6,7 +6,7 @@ import TeamWebsiteRemoveButton from './TeamWebsiteRemoveButton';
|
|||||||
import SettingsTable from 'components/common/SettingsTable';
|
import SettingsTable from 'components/common/SettingsTable';
|
||||||
import useConfig from 'hooks/useConfig';
|
import useConfig from 'hooks/useConfig';
|
||||||
|
|
||||||
export default function TeamWebsitesTable({ data = [], onSave }) {
|
export function TeamWebsitesTable({ data = [], onSave }) {
|
||||||
const { formatMessage, labels } = useMessages();
|
const { formatMessage, labels } = useMessages();
|
||||||
const { openExternal } = useConfig();
|
const { openExternal } = useConfig();
|
||||||
const { user } = useUser();
|
const { user } = useUser();
|
||||||
@ -51,3 +51,5 @@ export default function TeamWebsitesTable({ data = [], onSave }) {
|
|||||||
</SettingsTable>
|
</SettingsTable>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default TeamWebsitesTable;
|
||||||
|
@ -6,7 +6,7 @@ import PageHeader from 'components/layout/PageHeader';
|
|||||||
import TeamsTable from 'components/pages/settings/teams/TeamsTable';
|
import TeamsTable from 'components/pages/settings/teams/TeamsTable';
|
||||||
import Page from 'components/layout/Page';
|
import Page from 'components/layout/Page';
|
||||||
import Icons from 'components/icons';
|
import Icons from 'components/icons';
|
||||||
import TeamJoinForm from './JoinTeamForm';
|
import TeamJoinForm from './TeamJoinForm';
|
||||||
import useApi from 'hooks/useApi';
|
import useApi from 'hooks/useApi';
|
||||||
import useMessages from 'hooks/useMessages';
|
import useMessages from 'hooks/useMessages';
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ import { ROLES } from 'lib/constants';
|
|||||||
import SettingsTable from 'components/common/SettingsTable';
|
import SettingsTable from 'components/common/SettingsTable';
|
||||||
import useLocale from 'hooks/useLocale';
|
import useLocale from 'hooks/useLocale';
|
||||||
|
|
||||||
export default function TeamsTable({ data = [], onDelete }) {
|
export function TeamsTable({ data = [], onDelete }) {
|
||||||
const { formatMessage, labels } = useMessages();
|
const { formatMessage, labels } = useMessages();
|
||||||
const { user } = useUser();
|
const { user } = useUser();
|
||||||
const { dir } = useLocale();
|
const { dir } = useLocale();
|
||||||
@ -90,3 +90,5 @@ export default function TeamsTable({ data = [], onDelete }) {
|
|||||||
</SettingsTable>
|
</SettingsTable>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default TeamsTable;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { Button, Icon, Icons, Text } from 'react-basics';
|
import { Button, Icon, Icons, Text } from 'react-basics';
|
||||||
import styles from './WebsiteTags.module.css';
|
import styles from './WebsiteTags.module.css';
|
||||||
|
|
||||||
export default function WebsiteTags({ items = [], websites = [], onClick }) {
|
export function WebsiteTags({ items = [], websites = [], onClick }) {
|
||||||
if (websites.length === 0) {
|
if (websites.length === 0) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -27,3 +27,5 @@ export default function WebsiteTags({ items = [], websites = [], onClick }) {
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default WebsiteTags;
|
||||||
|
@ -2,7 +2,7 @@ import { Button, Icon, Text, Modal, Icons, ModalTrigger } from 'react-basics';
|
|||||||
import UserAddForm from './UserAddForm';
|
import UserAddForm from './UserAddForm';
|
||||||
import useMessages from 'hooks/useMessages';
|
import useMessages from 'hooks/useMessages';
|
||||||
|
|
||||||
export default function UserAddButton({ onSave }) {
|
export function UserAddButton({ onSave }) {
|
||||||
const { formatMessage, labels } = useMessages();
|
const { formatMessage, labels } = useMessages();
|
||||||
|
|
||||||
const handleSave = () => {
|
const handleSave = () => {
|
||||||
@ -23,3 +23,5 @@ export default function UserAddButton({ onSave }) {
|
|||||||
</ModalTrigger>
|
</ModalTrigger>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default UserAddButton;
|
||||||
|
@ -14,7 +14,7 @@ import useApi from 'hooks/useApi';
|
|||||||
import { ROLES } from 'lib/constants';
|
import { ROLES } from 'lib/constants';
|
||||||
import useMessages from 'hooks/useMessages';
|
import useMessages from 'hooks/useMessages';
|
||||||
|
|
||||||
export default function UserAddForm({ onSave, onClose }) {
|
export function UserAddForm({ onSave, onClose }) {
|
||||||
const { post, useMutation } = useApi();
|
const { post, useMutation } = useApi();
|
||||||
const { mutate, error, isLoading } = useMutation(data => post(`/users`, data));
|
const { mutate, error, isLoading } = useMutation(data => post(`/users`, data));
|
||||||
const { formatMessage, labels } = useMessages();
|
const { formatMessage, labels } = useMessages();
|
||||||
@ -68,3 +68,5 @@ export default function UserAddForm({ onSave, onClose }) {
|
|||||||
</Form>
|
</Form>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default UserAddForm;
|
||||||
|
@ -3,7 +3,7 @@ import { Button, Form, FormButtons, SubmitButton } from 'react-basics';
|
|||||||
import useApi from 'hooks/useApi';
|
import useApi from 'hooks/useApi';
|
||||||
import useMessages from 'hooks/useMessages';
|
import useMessages from 'hooks/useMessages';
|
||||||
|
|
||||||
export default function UserDeleteForm({ userId, username, onSave, onClose }) {
|
export function UserDeleteForm({ userId, username, onSave, onClose }) {
|
||||||
const { formatMessage, FormattedMessage, labels, messages } = useMessages();
|
const { formatMessage, FormattedMessage, labels, messages } = useMessages();
|
||||||
const { del } = useApi();
|
const { del } = useApi();
|
||||||
const { mutate, error, isLoading } = useMutation(() => del(`/users/${userId}`));
|
const { mutate, error, isLoading } = useMutation(() => del(`/users/${userId}`));
|
||||||
@ -33,3 +33,5 @@ export default function UserDeleteForm({ userId, username, onSave, onClose }) {
|
|||||||
</Form>
|
</Form>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default UserDeleteForm;
|
||||||
|
@ -13,7 +13,7 @@ import useApi from 'hooks/useApi';
|
|||||||
import { ROLES } from 'lib/constants';
|
import { ROLES } from 'lib/constants';
|
||||||
import useMessages from 'hooks/useMessages';
|
import useMessages from 'hooks/useMessages';
|
||||||
|
|
||||||
export default function UserEditForm({ userId, data, onSave }) {
|
export function UserEditForm({ userId, data, onSave }) {
|
||||||
const { formatMessage, labels, messages } = useMessages();
|
const { formatMessage, labels, messages } = useMessages();
|
||||||
const { post, useMutation } = useApi();
|
const { post, useMutation } = useApi();
|
||||||
const { mutate, error } = useMutation(({ username, password, role }) =>
|
const { mutate, error } = useMutation(({ username, password, role }) =>
|
||||||
@ -68,3 +68,5 @@ export default function UserEditForm({ userId, data, onSave }) {
|
|||||||
</Form>
|
</Form>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default UserEditForm;
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user