Recipe views now using UserInfoView.
This commit is contained in:
parent
d4686d0a39
commit
b8787cd8f9
@ -36,7 +36,7 @@ const getRecipeInfos = async ({
|
||||
updated: rawUpdated,
|
||||
title,
|
||||
ownerId,
|
||||
ownerUsername,
|
||||
owner,
|
||||
isPublic,
|
||||
starCount,
|
||||
mainImage: rawMainImage,
|
||||
@ -46,7 +46,7 @@ const getRecipeInfos = async ({
|
||||
updated: new Date(rawUpdated),
|
||||
title,
|
||||
ownerId,
|
||||
ownerUsername,
|
||||
owner,
|
||||
isPublic,
|
||||
starCount,
|
||||
mainImage: toImageView(rawMainImage),
|
||||
|
@ -1,4 +1,5 @@
|
||||
import ImageView, { RawImageView, toImageView } from './ImageView'
|
||||
import UserInfoView from './UserInfoView'
|
||||
|
||||
export interface RawFullRecipeView {
|
||||
id: number
|
||||
@ -7,8 +8,7 @@ export interface RawFullRecipeView {
|
||||
slug: string
|
||||
title: string
|
||||
text: string
|
||||
ownerId: number
|
||||
ownerUsername: string
|
||||
owner: UserInfoView
|
||||
starCount: number
|
||||
viewerCount: number
|
||||
mainImage: RawImageView
|
||||
@ -22,8 +22,7 @@ interface FullRecipeView {
|
||||
slug: string
|
||||
title: string
|
||||
text: string
|
||||
ownerId: number
|
||||
ownerUsername: string
|
||||
owner: UserInfoView
|
||||
starCount: number
|
||||
viewerCount: number
|
||||
mainImage: ImageView
|
||||
@ -37,8 +36,7 @@ export const toFullRecipeView = ({
|
||||
slug,
|
||||
title,
|
||||
text,
|
||||
ownerId,
|
||||
ownerUsername,
|
||||
owner,
|
||||
starCount,
|
||||
viewerCount,
|
||||
mainImage: rawMainImage,
|
||||
@ -50,8 +48,7 @@ export const toFullRecipeView = ({
|
||||
slug,
|
||||
title,
|
||||
text,
|
||||
ownerId,
|
||||
ownerUsername,
|
||||
owner,
|
||||
starCount,
|
||||
viewerCount,
|
||||
mainImage: toImageView(rawMainImage),
|
||||
|
@ -1,11 +1,12 @@
|
||||
import ImageView, { RawImageView } from './ImageView'
|
||||
import UserInfoView from './UserInfoView'
|
||||
|
||||
export interface RawRecipeInfoView {
|
||||
id: number
|
||||
updated: string
|
||||
title: string
|
||||
ownerId: number
|
||||
ownerUsername: string
|
||||
owner: UserInfoView
|
||||
isPublic: boolean
|
||||
starCount: number
|
||||
mainImage: RawImageView
|
||||
@ -16,8 +17,7 @@ interface RecipeInfoView {
|
||||
id: number
|
||||
updated: Date
|
||||
title: string
|
||||
ownerId: number
|
||||
ownerUsername: string
|
||||
owner: UserInfoView
|
||||
isPublic: boolean
|
||||
starCount: number
|
||||
mainImage: ImageView
|
||||
|
@ -19,7 +19,7 @@ const Recipe = ({ recipe, imgUrl }: RecipeProps) => {
|
||||
<StarCount count={recipe.starCount} />
|
||||
</div>
|
||||
<div className={classes.infoRow}>
|
||||
<UserIconAndName username={recipe.ownerUsername} />
|
||||
<UserIconAndName username={recipe.owner.username} />
|
||||
<RecipeVisibilityIcon isPublic={recipe.isPublic} />
|
||||
</div>
|
||||
</div>
|
||||
|
@ -76,7 +76,7 @@ const Recipes = () => {
|
||||
<RecipeCard
|
||||
key={view.id}
|
||||
title={view.title}
|
||||
ownerUsername={view.ownerUsername}
|
||||
ownerUsername={view.owner.username}
|
||||
slug={view.slug}
|
||||
mainImageUrl={
|
||||
slugsAndImgUrls.find(({ data: slugAndImgUrl }) => {
|
||||
|
Loading…
Reference in New Issue
Block a user