Files
landscape-template/src/mocks/data/posts.ts
2022-04-16 15:52:35 +03:00

92 lines
2.8 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { Bounty, Question, Story } from "src/features/Posts/types";
import { getAvatarImage, getCoverImage } from "./utils";
const getAuthor = () => ({
id: 12,
name: "John Doe",
image: getAvatarImage()
})
const date = 'Mon Mar 14 2022 20:33:17 GMT+0200 (Eastern European Standard Time)'
let posts = {
stories: [
{
id: 1,
title: 'Digital Editor, Mars Review of Books',
cover_image: getCoverImage(),
comments_count: 31,
date,
votes_count: 120,
excerpt: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. In odio libero accumsan...',
type: "story",
tags: [
{ id: 1, title: "lnurl" },
{ id: 2, title: "webln" },
{ id: 3, title: "guide" },
],
author: getAuthor()
}
] as Story[],
bounties: [
{
type: "bounty",
id: 1,
title: 'Digital Editor, Mars Review of Books',
cover_image: getCoverImage(),
applicants_count: 31,
date,
votes_count: 120,
excerpt: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. In odio libero accumsan...',
tags: [
{ id: 1, title: "lnurl" },
{ id: 2, title: "webln" },
{ id: 3, title: "guide" },
],
author: getAuthor(),
deadline: "25 May",
reward_amount: 200_000,
}
] as Bounty[],
questions: [
{
type: "question",
id: 1,
title: 'Digital Editor, Mars Review of Books',
answers_count: 31,
date,
votes_count: 70,
excerpt: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. In odio libero accumsan...',
tags: [
{ id: 1, title: "lnurl" },
{ id: 2, title: "webln" },
],
author: getAuthor(),
comments: [
{
id: 1,
author: getAuthor(),
date,
body: 'Naw, Im 42 and know people who started in their 50s, you got this!'
},
{
id: 2,
author: getAuthor(),
date,
body: 'Naw, Im 42 and know people who started in their 50s, you got this!'
},
]
}
] as Question[]
}
posts.bounties = posts.bounties.map(b => ({ ...b, __typename: "Bounty" }))
posts.questions = posts.questions.map(b => ({ ...b, __typename: "Question" }))
posts.stories = posts.stories.map(b => ({ ...b, __typename: "Story" }))
export {
posts,
}