Add full recipe text to share interaction
This commit is contained in:
parent
30e76b6509
commit
ec890777b9
@ -1,7 +1,12 @@
|
||||
import { absolutePathForRecipe } from '@/app/paths';
|
||||
import { PhotoSetAttributes } from '../category';
|
||||
import ShareModal from '@/share/ShareModal';
|
||||
import { formatRecipe, shareTextForRecipe } from '.';
|
||||
import {
|
||||
formatRecipe,
|
||||
shareTextForRecipe,
|
||||
getRecipePropsFromPhotos,
|
||||
generateRecipeText,
|
||||
} from '.';
|
||||
import RecipeOGTile from './RecipeOGTile';
|
||||
|
||||
export default function RecipeShareModal({
|
||||
@ -12,11 +17,18 @@ export default function RecipeShareModal({
|
||||
}: {
|
||||
recipe: string
|
||||
} & PhotoSetAttributes) {
|
||||
// Omit title from RecipeProps
|
||||
const { data, film } = getRecipePropsFromPhotos(photos) ?? {};
|
||||
const recipeText = data && film
|
||||
? generateRecipeText({ data, film })
|
||||
: undefined;
|
||||
|
||||
return (
|
||||
<ShareModal
|
||||
pathShare={absolutePathForRecipe(recipe, true)}
|
||||
navigatorTitle={formatRecipe(recipe)}
|
||||
socialText={shareTextForRecipe(recipe)}
|
||||
navigatorTitle={formatRecipe(recipe)}
|
||||
navigatorText={recipeText}
|
||||
>
|
||||
<RecipeOGTile {...{ recipe, photos, count, dateRange }} />
|
||||
</ShareModal>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user