mirror of
https://github.com/Myzel394/kleckrelay-website.git
synced 2025-06-21 08:40:32 +02:00
added ExternalLinkIndication.tsx
This commit is contained in:
parent
91cd655d5d
commit
ff972478be
20
src/components/ExternalLinkIndication.tsx
Normal file
20
src/components/ExternalLinkIndication.tsx
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
import {ReactElement} from "react"
|
||||||
|
import {HiOutlineExternalLink} from "react-icons/hi"
|
||||||
|
|
||||||
|
import {Box, BoxProps} from "@mui/material"
|
||||||
|
|
||||||
|
export interface ExternalLinkIndicationProps extends BoxProps {}
|
||||||
|
|
||||||
|
export default function ExternalLinkIndication({
|
||||||
|
children,
|
||||||
|
...props
|
||||||
|
}: ExternalLinkIndicationProps): ReactElement {
|
||||||
|
return (
|
||||||
|
<Box component="span" {...props} display="flex" alignItems="center">
|
||||||
|
<Box component="span" mr={1}>
|
||||||
|
{children}
|
||||||
|
</Box>
|
||||||
|
<HiOutlineExternalLink />
|
||||||
|
</Box>
|
||||||
|
)
|
||||||
|
}
|
@ -40,5 +40,7 @@ export * from "./LanguageButton"
|
|||||||
export {default as LanguageButton} from "./LanguageButton"
|
export {default as LanguageButton} from "./LanguageButton"
|
||||||
export * from "./ExpandableListItem"
|
export * from "./ExpandableListItem"
|
||||||
export {default as ExpandableListItem} from "./ExpandableListItem"
|
export {default as ExpandableListItem} from "./ExpandableListItem"
|
||||||
|
export * from "./ExternalLinkIndication"
|
||||||
|
export {default as ExternalLinkIndication} from "./ExternalLinkIndication"
|
||||||
|
|
||||||
export * as SimplePageBuilder from "./simple-page-builder"
|
export * as SimplePageBuilder from "./simple-page-builder"
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
import {ReactElement} from "react"
|
import {ReactElement} from "react"
|
||||||
import {useTranslation} from "react-i18next"
|
import {useTranslation} from "react-i18next"
|
||||||
import {BsArrowsAngleExpand} from "react-icons/bs"
|
import {BsArrowsAngleExpand} from "react-icons/bs"
|
||||||
|
import {HiOutlineExternalLink} from "react-icons/hi"
|
||||||
|
|
||||||
import {List, ListItemButton, ListItemText} from "@mui/material"
|
import {List, ListItemButton, ListItemText} from "@mui/material"
|
||||||
|
|
||||||
import {DecryptedReportContent} from "~/server-types"
|
import {DecryptedReportContent} from "~/server-types"
|
||||||
import {ExpandableListItem} from "~/components"
|
import {ExpandableListItem, ExternalLinkIndication} from "~/components"
|
||||||
|
|
||||||
export interface ExpandedUrlsListItemProps {
|
export interface ExpandedUrlsListItemProps {
|
||||||
urls: DecryptedReportContent["messageDetails"]["content"]["expandedUrls"]
|
urls: DecryptedReportContent["messageDetails"]["content"]["expandedUrls"]
|
||||||
@ -32,7 +33,11 @@ export default function ExpandedUrlsListItem({urls}: ExpandedUrlsListItemProps):
|
|||||||
rel="noopener noreferrer nofollow"
|
rel="noopener noreferrer nofollow"
|
||||||
>
|
>
|
||||||
<ListItemText
|
<ListItemText
|
||||||
primary={urlData.expandedUrl}
|
primary={
|
||||||
|
<ExternalLinkIndication>
|
||||||
|
{urlData.expandedUrl}
|
||||||
|
</ExternalLinkIndication>
|
||||||
|
}
|
||||||
secondary={urlData.originalUrl}
|
secondary={urlData.originalUrl}
|
||||||
/>
|
/>
|
||||||
</ListItemButton>
|
</ListItemButton>
|
||||||
|
@ -10,7 +10,7 @@ import {Grid, List, ListItemButton, ListItemText} from "@mui/material"
|
|||||||
|
|
||||||
import {DecryptedReportContent, ServerSettings} from "~/server-types"
|
import {DecryptedReportContent, ServerSettings} from "~/server-types"
|
||||||
import {isDev} from "~/constants/development"
|
import {isDev} from "~/constants/development"
|
||||||
import {ExpandableListItem} from "~/components"
|
import {ExpandableListItem, ExternalLinkIndication} from "~/components"
|
||||||
|
|
||||||
export interface ProxiedImagesListItemProps {
|
export interface ProxiedImagesListItemProps {
|
||||||
images: DecryptedReportContent["messageDetails"]["content"]["proxiedImages"]
|
images: DecryptedReportContent["messageDetails"]["content"]["proxiedImages"]
|
||||||
@ -38,7 +38,7 @@ export default function ProxiedImagesListItem({images}: ProxiedImagesListItemPro
|
|||||||
key={image.imageProxyId}
|
key={image.imageProxyId}
|
||||||
>
|
>
|
||||||
<ListItemText
|
<ListItemText
|
||||||
primary={image.url}
|
primary={<ExternalLinkIndication>{image.url}</ExternalLinkIndication>}
|
||||||
secondary={
|
secondary={
|
||||||
<>
|
<>
|
||||||
<Grid
|
<Grid
|
||||||
|
Loading…
x
Reference in New Issue
Block a user