diff --git a/package.json b/package.json index e530d78..d51f275 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nampi-frontend", - "version": "0.6.14", + "version": "0.6.15", "private": true, "dependencies": { "//": "TODO: Replace with the original react-leaflet package after this [issue](https://github.com/PaulLeCam/react-leaflet/issues/891) is resolved.", diff --git a/src/App/components/ActDetails/index.tsx b/src/App/components/ActDetails/index.tsx deleted file mode 100644 index 849454d..0000000 --- a/src/App/components/ActDetails/index.tsx +++ /dev/null @@ -1,73 +0,0 @@ -import { useAct } from "nampi-use-api"; -import { FormattedMessage, useIntl } from "react-intl"; -import { Heading } from "../Heading"; -import { ItemInheritance } from "../ItemInheritance"; -import { ItemLabels } from "../ItemLabels"; -import { ItemLink } from "../ItemLink"; -import { LoadingPlaceholder } from "../LoadingPlaceholder"; - -interface Props { - idLocal: string; -} - -export const ActDetails = ({ idLocal }: Props) => { - const { formatList, formatDate } = useIntl(); - const { data } = useAct({ idLocal }); - return data ? ( - <> - - - - - - - - ) : ( - - ); -}; diff --git a/src/App/components/ActsPage/index.tsx b/src/App/components/ActsPage/index.tsx deleted file mode 100644 index 1ccbf52..0000000 --- a/src/App/components/ActsPage/index.tsx +++ /dev/null @@ -1,43 +0,0 @@ -import { namespaces } from "App/namespaces"; -import { FormattedMessage, useIntl } from "react-intl"; -import { useParams } from "react-router-dom"; -import { ActDetails } from "../ActDetails"; -import { FilterableItemList } from "../FilterableItemList"; -import { PlaceholderText } from "../PlaceholderText"; -import { SidebarPage } from "../SidebarPage"; - -interface Params { - idLocal: string; -} - -export const ActsPage = () => { - const { formatMessage } = useIntl(); - const { idLocal } = useParams(); - return ( - - } - main={ - idLocal ? ( - - ) : ( - - - - ) - } - /> - ); -}; diff --git a/src/App/components/AspectDetails/index.tsx b/src/App/components/AspectDetails/index.tsx index 95122f3..8d041c9 100644 --- a/src/App/components/AspectDetails/index.tsx +++ b/src/App/components/AspectDetails/index.tsx @@ -13,6 +13,7 @@ import { Heading } from "../Heading"; import { ItemComments } from "../ItemComments"; import { ItemInheritance } from "../ItemInheritance"; import { ItemLabels } from "../ItemLabels"; +import { ItemPermalink } from "../ItemPermalink"; import { ItemSameAs } from "../ItemSameAs"; import { ItemTexts } from "../ItemTexts"; import { LoadingPlaceholder } from "../LoadingPlaceholder"; @@ -123,6 +124,7 @@ export const AspectDetails = ({ idLocal }: Props) => { /> )} + diff --git a/src/App/components/AuthorDetails/index.tsx b/src/App/components/AuthorDetails/index.tsx index 0e64a42..0c4e4a9 100644 --- a/src/App/components/AuthorDetails/index.tsx +++ b/src/App/components/AuthorDetails/index.tsx @@ -10,6 +10,7 @@ import { FilterableItemList } from "../FilterableItemList"; import { Heading } from "../Heading"; import { ItemInheritance } from "../ItemInheritance"; import { ItemLabels } from "../ItemLabels"; +import { ItemPermalink } from "../ItemPermalink"; import { LoadingPlaceholder } from "../LoadingPlaceholder"; interface Props { @@ -67,6 +68,7 @@ export const AuthorDetails = ({ idLocal }: Props) => { values={{ label: getText(data.labels) }} /> + diff --git a/src/App/components/EventDetails/index.tsx b/src/App/components/EventDetails/index.tsx index ff460ae..35b85c1 100644 --- a/src/App/components/EventDetails/index.tsx +++ b/src/App/components/EventDetails/index.tsx @@ -13,6 +13,7 @@ import { ItemComments } from "../ItemComments"; import { ItemInheritance } from "../ItemInheritance"; import { ItemLabels } from "../ItemLabels"; import { ItemLink } from "../ItemLink"; +import { ItemPermalink } from "../ItemPermalink"; import { ItemTexts } from "../ItemTexts"; import { LoadingPlaceholder } from "../LoadingPlaceholder"; import { Map } from "../Map"; @@ -80,6 +81,7 @@ export const EventDetails = ({ idLocal }: Props) => { /> )} + diff --git a/src/App/components/GroupDetails/index.tsx b/src/App/components/GroupDetails/index.tsx index aaabf7c..f0643dd 100644 --- a/src/App/components/GroupDetails/index.tsx +++ b/src/App/components/GroupDetails/index.tsx @@ -13,6 +13,7 @@ import { ItemComments } from "../ItemComments"; import { ItemInheritance } from "../ItemInheritance"; import { ItemLabels } from "../ItemLabels"; import { ItemLink } from "../ItemLink"; +import { ItemPermalink } from "../ItemPermalink"; import { ItemSameAs } from "../ItemSameAs"; import { ItemTexts } from "../ItemTexts"; import { LoadingPlaceholder } from "../LoadingPlaceholder"; @@ -84,6 +85,7 @@ export const GroupDetails = ({ idLocal }: Props) => { /> )} + diff --git a/src/App/components/ItemPermalink/index.tsx b/src/App/components/ItemPermalink/index.tsx new file mode 100644 index 0000000..dbf08d4 --- /dev/null +++ b/src/App/components/ItemPermalink/index.tsx @@ -0,0 +1,34 @@ +import { faCopy } from "@fortawesome/free-solid-svg-icons"; +import { Item } from "nampi-use-api"; +import { FormattedMessage, useIntl } from "react-intl"; +import { IconButton } from "../IconButton"; + +interface Props { + item: Item; +} + +export const ItemPermalink = ({ item }: Props) => { + const intl = useIntl(); + return ( +
+ navigator.clipboard.writeText(item.id)} + /> + ), + }} + /> +
+ ); +}; diff --git a/src/App/components/PersonDetails/index.tsx b/src/App/components/PersonDetails/index.tsx index e992e5c..a9e5a43 100644 --- a/src/App/components/PersonDetails/index.tsx +++ b/src/App/components/PersonDetails/index.tsx @@ -24,6 +24,7 @@ import { ItemComments } from "../ItemComments"; import { ItemInheritance } from "../ItemInheritance"; import { ItemLabels } from "../ItemLabels"; import { ItemLink } from "../ItemLink"; +import { ItemPermalink } from "../ItemPermalink"; import { ItemSameAs } from "../ItemSameAs"; import { ItemTexts } from "../ItemTexts"; import { LoadingPlaceholder } from "../LoadingPlaceholder"; @@ -243,6 +244,7 @@ export const PersonDetails = ({ idLocal }: Props) => { /> )} + diff --git a/src/App/components/PlaceDetails/index.tsx b/src/App/components/PlaceDetails/index.tsx index 87a8f38..3dd2010 100644 --- a/src/App/components/PlaceDetails/index.tsx +++ b/src/App/components/PlaceDetails/index.tsx @@ -14,6 +14,7 @@ import { Heading } from "../Heading"; import { ItemComments } from "../ItemComments"; import { ItemInheritance } from "../ItemInheritance"; import { ItemLabels } from "../ItemLabels"; +import { ItemPermalink } from "../ItemPermalink"; import { ItemSameAs } from "../ItemSameAs"; import { ItemTexts } from "../ItemTexts"; import { LoadingPlaceholder } from "../LoadingPlaceholder"; @@ -92,6 +93,7 @@ export const PlaceDetails = ({ idLocal }: Props) => { /> )} + diff --git a/src/App/components/SourceDetails/index.tsx b/src/App/components/SourceDetails/index.tsx index 6e27cbb..4194e3a 100644 --- a/src/App/components/SourceDetails/index.tsx +++ b/src/App/components/SourceDetails/index.tsx @@ -12,6 +12,7 @@ import { Heading } from "../Heading"; import { ItemComments } from "../ItemComments"; import { ItemInheritance } from "../ItemInheritance"; import { ItemLabels } from "../ItemLabels"; +import { ItemPermalink } from "../ItemPermalink"; import { ItemSameAs } from "../ItemSameAs"; import { ItemTexts } from "../ItemTexts"; import { LoadingPlaceholder } from "../LoadingPlaceholder"; @@ -81,6 +82,7 @@ export const SourceDetails = ({ idLocal }: Props) => { /> )} + diff --git a/src/App/index.tsx b/src/App/index.tsx index a7dea8c..91c6091 100644 --- a/src/App/index.tsx +++ b/src/App/index.tsx @@ -1,7 +1,6 @@ import { useAuth } from "nampi-use-api"; import { Route, Router, Switch } from "react-router"; import { About } from "./components/About"; -import { ActsPage } from "./components/ActsPage"; import { AspectsPage } from "./components/AspectsPage"; import { AuthorsPage } from "./components/AuthorsPage"; import { Data } from "./components/Data"; @@ -31,11 +30,6 @@ export const App = () => { -