diff --git a/src/app/(tabs)/search/story.tsx b/src/app/(tabs)/search/story.tsx index 35466903..dfefe15b 100644 --- a/src/app/(tabs)/search/story.tsx +++ b/src/app/(tabs)/search/story.tsx @@ -5,32 +5,34 @@ import { ScrollView, Share, Text, + View, } from 'react-native'; import HTMLView from 'react-native-htmlview'; import { Button } from 'react-native-paper'; import { SafeAreaView } from 'react-native-safe-area-context'; import jsonStory from '../../../database/story.json'; import globalStyles from '../../../styles/globalStyles'; - -const storyStyles = { - image: { - width: '100%', - height: '5%', - }, -}; +import temp from '../../../styles/temp'; function htmlParser(htmlString: string) { const regexHeading = /(
)+/; // regex grabs heading and paragraph tags for story - const regexTitle = /
 (.*?)p>/; + const regexProcess = /
 (.*?)p>/; const heading = regexHeading.exec(htmlString); const story = regexStory.exec(htmlString); - const title = regexTitle.exec(htmlString); + const process = regexProcess.exec(htmlString); - const storyContent = story ? story[0] : ''; //
paragraph1
... - const storyTitle = title ? title[0] : ''; - return [storyContent, storyTitle]; + const contentHeading = heading + ? heading[0].replace('paragraph1
... + const contentProcess = process ? process[0].replace(' ', '') : ''; + return { + heading: contentHeading, + story: contentStory, + process: contentProcess, + }; } function StoryScreen() { @@ -52,12 +54,10 @@ function StoryScreen() { setContent(json.content.rendered); setAuthor(jsonStory.author); setGenres( - `${ - jsonStory['genre-medium'] - .map(txt => `${txt}`) - .toString() - .replace(',', '') //