Skip to content

Instantly share code, notes, and snippets.

View vishalnarkhede's full-sized avatar
🖊️
Vishal is typing ...

Vishal Narkhede vishalnarkhede

🖊️
Vishal is typing ...
View GitHub Profile
// src/screens/ChannelScreen.js
import React, {useEffect, useState} from 'react';
import {View, SafeAreaView, StyleSheet} from 'react-native';
import {
Chat,
Channel,
MessageList,
MessageInput,
} from 'stream-chat-react-native';
// src/components/ChannelHeader.js
import React from 'react';
import {TouchableOpacity, View, StyleSheet} from 'react-native';
import {getChannelDisplayName, notImplemented, truncate} from '../utils';
import {useTheme, useNavigation} from '@react-navigation/native';
import {SVGIcon} from './SVGIcon';
import {SCText} from './SCText';
// src/screens/ChannelListScreen.js
import React from 'react';
import {View, StyleSheet} from 'react-native';
import {useTheme} from '@react-navigation/native';
import {ChannelList} from '../components/ChannelList/ChannelList';
import {ChatClientService} from '../utils';
import {NewMessageBubble} from '../components/NewMessageBubble';
// src/components/ChannelList/ChannelList.js
import React from 'react';
import {View, StyleSheet, SectionList} from 'react-native';
import {TouchableOpacity} from 'react-native-gesture-handler';
import {useNavigation, useTheme} from '@react-navigation/native';
import {ChatClientService, notImplemented} from '../../utils';
import {SVGIcon} from '../SVGIcon';
@vishalnarkhede
vishalnarkhede / sc2-NewMessageBubble.js
Created October 31, 2020 15:16
src/components/NewMessageBubble.js
// src/components/NewMessageBubble.js
import React from 'react';
import {StyleSheet, TouchableOpacity} from 'react-native';
import {useNavigation, useTheme} from '@react-navigation/native';
import {SVGIcon} from './SVGIcon';
export const NewMessageBubble = () => {
const navigation = useNavigation();
@vishalnarkhede
vishalnarkhede / sc2-ScreenHeader.js
Last active October 31, 2020 15:22
src/screens/ScreenHeader.js
// src/screens/ScreenHeader.js
import React from 'react';
import {Image, StyleSheet, View, TouchableOpacity} from 'react-native';
import {useSafeAreaInsets} from 'react-native-safe-area-context';
import {useNavigation} from '@react-navigation/native';
import {useTheme} from '@react-navigation/native';
import {SVGIcon} from '../components/SVGIcon';
import {SCText} from '../components/SCText';
// App.js
/* eslint-disable react-hooks/exhaustive-deps */
import React, {useEffect, useState} from 'react';
import {
ActivityIndicator,
View,
StyleSheet,
SafeAreaView,
LogBox,
@vishalnarkhede
vishalnarkhede / sc2-appTheme.js
Created October 31, 2020 09:32
src/appTheme.js
// src/appTheme.js
export const DarkTheme = {
dark: true,
colors: {
primary: '#121115',
background: '#19181c',
backgroundSecondary: '#212527',
card: 'rgb(255, 255, 255)',
text: '#d8d8d9',
@vishalnarkhede
vishalnarkhede / sc2-SCText.js
Created October 31, 2020 09:23
src/components/SCText.js
// src/components/SCText.js
import React from 'react';
import {Text} from 'react-native';
import {useTheme} from '@react-navigation/native';
export const SCText = props => {
const {colors} = useTheme();
const style = Array.isArray(props.style)
? [
@vishalnarkhede
vishalnarkhede / sc2-SVGIcon.js
Last active October 31, 2020 10:05
src/components/SVGIcon.js
// src/components/SVGIcon.js
import React from 'react';
import {useTheme} from '@react-navigation/native';
import FileAttachmentIcon from '../images/svgs/channel/attachment.svg';
import ImageAttachmentIcon from '../images/svgs/channel/picture.svg';
import FileAttachmentIconDark from '../images/svgs/channel/attachment-dark.svg';
import ImageAttachmentIconDark from '../images/svgs/channel/picture-dark.svg';