This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { FC } from 'react'; | |
import theme from '@/theme'; | |
import clip from 'text-clipper'; | |
import { Dimensions, } from 'react-native' | |
import { TEXT_STYLES } from '@/lib/typography'; | |
import ReadMoreFawaz from '@fawazahmed/react-native-read-more'; | |
interface Props { | |
text: string | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState, useCallback, useEffect, useRef } from 'react'; | |
import { View, TouchableOpacity, StyleSheet, LayoutAnimation, Platform, UIManager, Text, LayoutChangeEvent, Animated } from 'react-native'; | |
import theme from '@/theme'; | |
import HTMLRenderer from './HTMLRenderer'; | |
import StyledText from '@/components/UI/StyledText'; | |
if (Platform.OS === 'android' && UIManager.setLayoutAnimationEnabledExperimental) { | |
UIManager.setLayoutAnimationEnabledExperimental(true); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import theme from '@/theme'; | |
import { FC, memo } from 'react'; | |
import { StyleSheet, View, LogBox, useWindowDimensions } from 'react-native'; | |
import RenderHtml, { HTMLSource, MixedStyleDeclaration } from 'react-native-render-html'; | |
LogBox.ignoreLogs([ | |
/Support for defaultProps will be removed/, | |
]); | |
interface Props { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function memoize(callback) { | |
const cache = new Map(); | |
return (...args) => { | |
const strArgs = String(args) | |
if (cache.has(strArgs)) { | |
return String(cache.get(strArgs));; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PaginationHelper { | |
constructor(collection, itemsPerPage) { | |
this.collection = collection; | |
this.itemsPerPage = itemsPerPage; | |
} | |
itemCount() { | |
return this.collection.length; | |
} | |
pageCount() { | |
return Math.ceil(this.itemCount() / this.itemsPerPage); |