Skip to content

Instantly share code, notes, and snippets.

View gorkemozkan's full-sized avatar
🥰
work hard, be nice.

Görkem gorkemozkan

🥰
work hard, be nice.
  • PR Yazılım
  • İzmir
  • 17:54 (UTC +03:00)
View GitHub Profile
@gorkemozkan
gorkemozkan / ReadMore.tsx
Created April 11, 2025 08:01
Read More With Library
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
}
@gorkemozkan
gorkemozkan / ReadMore.tsx
Last active April 11, 2025 08:02
ReadMore Without Library
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);
}
@gorkemozkan
gorkemozkan / .tsx
Last active April 11, 2025 06:38
HTMLRenderer
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 {
@gorkemozkan
gorkemozkan / memoize.js
Created September 18, 2023 19:24
Memoize
function memoize(callback) {
const cache = new Map();
return (...args) => {
const strArgs = String(args)
if (cache.has(strArgs)) {
return String(cache.get(strArgs));;
}
@gorkemozkan
gorkemozkan / pagination.js
Last active September 16, 2023 21:53
Pagination Helper
class PaginationHelper {
constructor(collection, itemsPerPage) {
this.collection = collection;
this.itemsPerPage = itemsPerPage;
}
itemCount() {
return this.collection.length;
}
pageCount() {
return Math.ceil(this.itemCount() / this.itemsPerPage);