import React, { useContext } from "react";
import { ComponentStory, ComponentMeta } from "@storybook/react";
import { View, Text } from "react-native";
import { NewsFeedContext, NewsFeedProvider } from "../../contexts/newsfeed/NewsFeedContext";
// export interface PageProps
const NewsFeedStorageWrapper = ({ children }) => {
return {children};
};
const Web3Component = () => {
const { feed } = useContext(NewsFeedContext);
return (
News feed items taken from storage
{feed &&
feed.map(item => (
id: {item.id}
title: {item.title}
link: {item.link}
content: {item.content}
{item.picture && (
picture:
)}
published: {item.published}
updated: {item.updated}
{item.sponsored_link && sponsored_link: {item.sponsored_link}}
hasSponsoredLogo: {!!item.sponsored_logo}
))}
);
};
const Page = (params: object) => (
);
export default {
title: "News feed with dexie storage",
component: Page
} as ComponentMeta;
const Template: ComponentStory = Page;
export const NewsFeedSDKExample = Template.bind({});