mirror of
https://github.com/Myzel394/kleckrelay-website.git
synced 2025-06-19 07:55:25 +02:00
adapated to new alias notes
This commit is contained in:
parent
44c29bae12
commit
c71c36fcc5
@ -164,6 +164,18 @@
|
|||||||
"label": "Erstellungsdatum",
|
"label": "Erstellungsdatum",
|
||||||
"empty": "Nicht verfügbar"
|
"empty": "Nicht verfügbar"
|
||||||
},
|
},
|
||||||
|
"creationContext": {
|
||||||
|
"label": "Kontext",
|
||||||
|
"web": {
|
||||||
|
"label": "Auf dieser Instanz erstellt"
|
||||||
|
},
|
||||||
|
"extension": {
|
||||||
|
"label": "In der Erweiterung erstellt"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"createdOn": {
|
||||||
|
"label": "Erstellt auf"
|
||||||
|
},
|
||||||
"personalNotes": {
|
"personalNotes": {
|
||||||
"label": "Persönliche Notizen",
|
"label": "Persönliche Notizen",
|
||||||
"empty": "-",
|
"empty": "-",
|
||||||
|
@ -172,6 +172,18 @@
|
|||||||
"label": "Created at",
|
"label": "Created at",
|
||||||
"empty": "Unavailable"
|
"empty": "Unavailable"
|
||||||
},
|
},
|
||||||
|
"creationContext": {
|
||||||
|
"label": "Creation Context",
|
||||||
|
"web": {
|
||||||
|
"label": "Created on this instance"
|
||||||
|
},
|
||||||
|
"extension": {
|
||||||
|
"label": "Created in the extension"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"createdOn": {
|
||||||
|
"label": "Created on"
|
||||||
|
},
|
||||||
"personalNotes": {
|
"personalNotes": {
|
||||||
"label": "Personal Notes",
|
"label": "Personal Notes",
|
||||||
"empty": "-",
|
"empty": "-",
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import {ReactElement} from "react"
|
import {ReactElement} from "react"
|
||||||
import {useTranslation} from "react-i18next"
|
import {useTranslation} from "react-i18next"
|
||||||
|
|
||||||
import {Grid, Typography} from "@mui/material"
|
import {Box, Grid, Typography} from "@mui/material"
|
||||||
|
|
||||||
export interface SimpleOverlayInformationProps {
|
export interface SimpleOverlayInformationProps {
|
||||||
label: string
|
label: string
|
||||||
@ -25,12 +25,10 @@ export default function SimpleOverlayInformation({
|
|||||||
<Typography variant="overline">{label}</Typography>
|
<Typography variant="overline">{label}</Typography>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item>
|
<Grid item>
|
||||||
<Grid container spacing={1} flexDirection="row" alignItems="center">
|
<Box display="flex" flexDirection="row" gap={1} alignItems="center">
|
||||||
{icon && <Grid item>{icon}</Grid>}
|
{icon}
|
||||||
<Grid item>
|
{children || <Typography variant="body2">{emptyTextValue}</Typography>}
|
||||||
{children || <Typography variant="body2">{emptyTextValue}</Typography>}
|
</Box>
|
||||||
</Grid>
|
|
||||||
</Grid>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
)
|
)
|
||||||
|
@ -2,8 +2,8 @@ import * as yup from "yup"
|
|||||||
import {TiDelete} from "react-icons/ti"
|
import {TiDelete} from "react-icons/ti"
|
||||||
import {AxiosError} from "axios"
|
import {AxiosError} from "axios"
|
||||||
import {ReactElement, useContext, useMemo, useState} from "react"
|
import {ReactElement, useContext, useMemo, useState} from "react"
|
||||||
import {MdCheckCircle, MdEditCalendar} from "react-icons/md"
|
import {MdCheckCircle, MdEditCalendar, MdExtension} from "react-icons/md"
|
||||||
import {RiStickyNoteFill} from "react-icons/ri"
|
import {RiGlobalLine, RiLinkM, RiStickyNoteFill} from "react-icons/ri"
|
||||||
import {FieldArray, FormikProvider, useFormik} from "formik"
|
import {FieldArray, FormikProvider, useFormik} from "formik"
|
||||||
import {FaPen} from "react-icons/fa"
|
import {FaPen} from "react-icons/fa"
|
||||||
import {useTranslation} from "react-i18next"
|
import {useTranslation} from "react-i18next"
|
||||||
@ -16,6 +16,7 @@ import {
|
|||||||
Grid,
|
Grid,
|
||||||
IconButton,
|
IconButton,
|
||||||
InputAdornment,
|
InputAdornment,
|
||||||
|
Link,
|
||||||
List,
|
List,
|
||||||
ListItem,
|
ListItem,
|
||||||
ListItemIcon,
|
ListItemIcon,
|
||||||
@ -51,6 +52,11 @@ interface Form {
|
|||||||
detail?: string
|
detail?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const CREATION_CONTEXT_ICON_MAP: Record<AliasNote["data"]["creationContext"], ReactElement> = {
|
||||||
|
web: <RiGlobalLine />,
|
||||||
|
extension: <MdExtension />,
|
||||||
|
}
|
||||||
|
|
||||||
export default function AliasNotesForm({id, notes, queryKey}: AliasNotesFormProps): ReactElement {
|
export default function AliasNotesForm({id, notes, queryKey}: AliasNotesFormProps): ReactElement {
|
||||||
const {t} = useTranslation()
|
const {t} = useTranslation()
|
||||||
const {showError, showSuccess} = useErrorSuccessSnacks()
|
const {showError, showSuccess} = useErrorSuccessSnacks()
|
||||||
@ -215,6 +221,43 @@ export default function AliasNotesForm({id, notes, queryKey}: AliasNotesFormProp
|
|||||||
</SimpleOverlayInformation>
|
</SimpleOverlayInformation>
|
||||||
</Grid>
|
</Grid>
|
||||||
)}
|
)}
|
||||||
|
{notes.data.creationContext && (
|
||||||
|
<Grid item>
|
||||||
|
<SimpleOverlayInformation
|
||||||
|
icon={CREATION_CONTEXT_ICON_MAP[notes.data.creationContext]}
|
||||||
|
label={t(
|
||||||
|
"routes.AliasDetailRoute.sections.notes.form.creationContext.label",
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
<Typography variant="body1">
|
||||||
|
{t(
|
||||||
|
`routes.AliasDetailRoute.sections.notes.form.creationContext.${notes.data.creationContext}.label`,
|
||||||
|
)}
|
||||||
|
</Typography>
|
||||||
|
</SimpleOverlayInformation>
|
||||||
|
</Grid>
|
||||||
|
)}
|
||||||
|
{notes.data.createdOn && (
|
||||||
|
<Grid item>
|
||||||
|
<SimpleOverlayInformation
|
||||||
|
icon={<RiLinkM />}
|
||||||
|
label={t(
|
||||||
|
"routes.AliasDetailRoute.sections.notes.form.createdOn.label",
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
<Link
|
||||||
|
href={notes.data.createdOn}
|
||||||
|
component="a"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer nofollow"
|
||||||
|
>
|
||||||
|
<Typography variant="body1">
|
||||||
|
{notes.data.createdOn}
|
||||||
|
</Typography>
|
||||||
|
</Link>
|
||||||
|
</SimpleOverlayInformation>
|
||||||
|
</Grid>
|
||||||
|
)}
|
||||||
<Grid item>
|
<Grid item>
|
||||||
<SimpleOverlayInformation
|
<SimpleOverlayInformation
|
||||||
label={t(
|
label={t(
|
||||||
|
@ -101,6 +101,7 @@ export interface AliasNote {
|
|||||||
version: "1.0"
|
version: "1.0"
|
||||||
data: {
|
data: {
|
||||||
createdAt: Date | null
|
createdAt: Date | null
|
||||||
|
createdOn: string | null
|
||||||
creationContext: "extension" | "web"
|
creationContext: "extension" | "web"
|
||||||
personalNotes: string
|
personalNotes: string
|
||||||
websites: Array<{
|
websites: Array<{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user