diff --git a/src/dashboardWebView/components/Contents/Item.tsx b/src/dashboardWebView/components/Contents/Item.tsx index e5782eaa..5f585d02 100644 --- a/src/dashboardWebView/components/Contents/Item.tsx +++ b/src/dashboardWebView/components/Contents/Item.tsx @@ -28,7 +28,8 @@ export const Item: React.FunctionComponent = ({ const view = useRecoilValue(ViewSelector); const settings = useRecoilValue(SettingsSelector); const draftField = useMemo(() => settings?.draftField, [settings]); - const [customHtml, setCustomHtml] = useState(undefined); + const [imageHtml, setImageHtml] = useState(undefined); + const [footerHtml, setFooterHtml] = useState(undefined); const { getColors } = useThemeColors(); const escapedTitle = useMemo(() => { @@ -87,9 +88,24 @@ export const Item: React.FunctionComponent = ({ ...pageData }).then(htmlContent => { if (htmlContent) { - setCustomHtml(htmlContent); + setFooterHtml(htmlContent); } else { - setCustomHtml(undefined); + setFooterHtml(undefined); + } + }); + + window.fmExternal.getCardImage(fmFilePath, { + fmFilePath, + date, + title, + description, + type, + ...pageData + }).then(htmlContent => { + if (htmlContent) { + setImageHtml(htmlContent); + } else { + setImageHtml(undefined); } }); } @@ -113,28 +129,32 @@ export const Item: React.FunctionComponent = ({ ) }`} > - {pageData[PREVIEW_IMAGE_FIELD] ? ( - {escapedTitle} - ) : ( -
: + pageData[PREVIEW_IMAGE_FIELD] ? ( + {escapedTitle} + ) : ( +
+ +
) - }`} - > - -
- )} + }
@@ -181,8 +201,8 @@ export const Item: React.FunctionComponent = ({
{ - customHtml && ( -
+ footerHtml && ( +
) }