feat: Add view count to shared links in settings
This commit is contained in:
@@ -151,7 +151,7 @@ const useAuthorizedSettingsConfig = () => {
|
||||
icon: GroupIcon,
|
||||
},
|
||||
Shares: {
|
||||
name: t("Share Links"),
|
||||
name: t("Shared Links"),
|
||||
path: "/settings/shares",
|
||||
component: Shares,
|
||||
enabled: true,
|
||||
|
||||
@@ -67,8 +67,8 @@ function Shares() {
|
||||
}, [shares.orderedData, shareIds]);
|
||||
|
||||
return (
|
||||
<Scene title={t("Share Links")} icon={<LinkIcon color="currentColor" />}>
|
||||
<Heading>{t("Share Links")}</Heading>
|
||||
<Scene title={t("Shared Links")} icon={<LinkIcon color="currentColor" />}>
|
||||
<Heading>{t("Shared Links")}</Heading>
|
||||
|
||||
{can.manage && !canShareDocuments && (
|
||||
<>
|
||||
|
||||
@@ -4,6 +4,7 @@ import * as React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useTheme } from "styled-components";
|
||||
import Share from "~/models/Share";
|
||||
import Avatar from "~/components/Avatar";
|
||||
import Flex from "~/components/Flex";
|
||||
import TableFromParams from "~/components/TableFromParams";
|
||||
import Time from "~/components/Time";
|
||||
@@ -35,12 +36,15 @@ function SharesTable({ canManage, ...rest }: Props) {
|
||||
Cell: observer(
|
||||
({ value, row }: { value: string; row: { original: Share } }) =>
|
||||
value ? (
|
||||
<>
|
||||
<Time dateTime={value} addSuffix />{" "}
|
||||
{t("by {{ name }}", {
|
||||
name: row.original.createdBy.name,
|
||||
})}
|
||||
</>
|
||||
<Flex align="center" gap={4}>
|
||||
{row.original.createdBy && (
|
||||
<Avatar
|
||||
src={row.original.createdBy.avatarUrl}
|
||||
alt={row.original.createdBy.name}
|
||||
/>
|
||||
)}
|
||||
<Time dateTime={value} addSuffix />
|
||||
</Flex>
|
||||
) : null
|
||||
),
|
||||
},
|
||||
@@ -64,6 +68,11 @@ function SharesTable({ canManage, ...rest }: Props) {
|
||||
) : null
|
||||
),
|
||||
},
|
||||
{
|
||||
id: "views",
|
||||
Header: t("Views"),
|
||||
accessor: "views",
|
||||
},
|
||||
canManage
|
||||
? {
|
||||
Header: " ",
|
||||
|
||||
Reference in New Issue
Block a user