feat(app-widget): multiline description (#3873)
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
import { Fragment } from "react";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { redirect } from "next/navigation";
|
import { redirect } from "next/navigation";
|
||||||
import { ActionIcon, ActionIconGroup, Anchor, Avatar, Card, Group, Stack, Text, Title } from "@mantine/core";
|
import { ActionIcon, ActionIconGroup, Anchor, Avatar, Card, Group, Stack, Text, Title } from "@mantine/core";
|
||||||
@@ -98,7 +99,12 @@ const AppCard = async ({ app }: AppCardProps) => {
|
|||||||
</Text>
|
</Text>
|
||||||
{app.description && (
|
{app.description && (
|
||||||
<Text size="sm" c="gray.6" lineClamp={4}>
|
<Text size="sm" c="gray.6" lineClamp={4}>
|
||||||
{app.description}
|
{app.description.split("\n").map((line, index) => (
|
||||||
|
<Fragment key={index}>
|
||||||
|
{line}
|
||||||
|
<br />
|
||||||
|
</Fragment>
|
||||||
|
))}
|
||||||
</Text>
|
</Text>
|
||||||
)}
|
)}
|
||||||
{app.href && (
|
{app.href && (
|
||||||
|
|||||||
@@ -97,7 +97,13 @@ export const AppForm = ({
|
|||||||
<Stack>
|
<Stack>
|
||||||
<TextInput {...form.getInputProps("name")} withAsterisk label={t("app.field.name.label")} />
|
<TextInput {...form.getInputProps("name")} withAsterisk label={t("app.field.name.label")} />
|
||||||
<IconPicker {...form.getInputProps("iconUrl")} />
|
<IconPicker {...form.getInputProps("iconUrl")} />
|
||||||
<Textarea {...form.getInputProps("description")} label={t("app.field.description.label")} />
|
<Textarea
|
||||||
|
{...form.getInputProps("description")}
|
||||||
|
label={t("app.field.description.label")}
|
||||||
|
autosize
|
||||||
|
minRows={2}
|
||||||
|
resize="vertical"
|
||||||
|
/>
|
||||||
<TextInput {...form.getInputProps("href")} label={t("app.field.url.label")} />
|
<TextInput {...form.getInputProps("href")} label={t("app.field.url.label")} />
|
||||||
|
|
||||||
<Checkbox
|
<Checkbox
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import type { PropsWithChildren } from "react";
|
import type { PropsWithChildren } from "react";
|
||||||
import { Suspense } from "react";
|
import { Fragment, Suspense } from "react";
|
||||||
import { Flex, Text, Tooltip, UnstyledButton } from "@mantine/core";
|
import { Flex, Text, Tooltip, UnstyledButton } from "@mantine/core";
|
||||||
import { IconLoader } from "@tabler/icons-react";
|
import { IconLoader } from "@tabler/icons-react";
|
||||||
import combineClasses from "clsx";
|
import combineClasses from "clsx";
|
||||||
@@ -65,7 +65,12 @@ export default function AppWidget({ options, isEditMode, height, width }: Widget
|
|||||||
enabled={Boolean(app.href) && !isEditMode}
|
enabled={Boolean(app.href) && !isEditMode}
|
||||||
>
|
>
|
||||||
<Tooltip.Floating
|
<Tooltip.Floating
|
||||||
label={app.description}
|
label={app.description?.split("\n").map((line, index) => (
|
||||||
|
<Fragment key={index}>
|
||||||
|
{line}
|
||||||
|
<br />
|
||||||
|
</Fragment>
|
||||||
|
))}
|
||||||
position="right-start"
|
position="right-start"
|
||||||
multiline
|
multiline
|
||||||
disabled={!options.showDescriptionTooltip || !app.description}
|
disabled={!options.showDescriptionTooltip || !app.description}
|
||||||
|
|||||||
Reference in New Issue
Block a user