repo_name
stringlengths
5
122
path
stringlengths
3
232
text
stringlengths
6
1.05M
WesamAlmasri/social-app
components/Feed/style.ts
import { StyleSheet } from 'react-native'; const styles = StyleSheet.create({ feedContainer: { width: '100%' }, noPostText: { alignSelf: 'center', marginTop: 20, } }); export default styles;
WesamAlmasri/social-app
store/comments/types.ts
<reponame>WesamAlmasri/social-app<filename>store/comments/types.ts import { CommentType } from '../../types'; export type CommentsStateType = { comments: CommentType[]; }; export type UpdateCommentsListActionType = { type: string; payload: CommentType[] | string; }; export type DispatchType = (args: UpdateCo...
WesamAlmasri/social-app
store/notifications/reducer.ts
import * as actionTypes from './actionTypes'; import { ActiveNotificationActionType, ActiveNotificationStateType } from './types'; const initialState: ActiveNotificationStateType = { activeNotification: null, }; const reducer = ( state: ActiveNotificationStateType = initialState, action: ActiveNotificationActio...
WesamAlmasri/social-app
components/ProfileOptions/index.tsx
import React, { useEffect, useState } from 'react'; import { View, Text, TouchableOpacity, Alert, ActivityIndicator } from 'react-native'; import styles from './style'; import { ProfileType, UserFileType } from '../../types'; import { useNavigation } from '@react-navigation/native'; import { useDispatch } from 'react-r...
WesamAlmasri/social-app
components/SingleProfileRow/index.tsx
<reponame>WesamAlmasri/social-app<filename>components/SingleProfileRow/index.tsx import React, { useState } from 'react'; import { View, Text, TouchableWithoutFeedback, TouchableOpacity } from 'react-native'; import styles from './style'; import { ProfileType, UserFileType } from '../../types'; import ProfilePicture fr...
WesamAlmasri/social-app
store/types.ts
<reponame>WesamAlmasri/social-app<filename>store/types.ts import { UserDetailsStateType } from './userDetails/types'; import { ActiveNotificationStateType } from './notifications/types'; import { ActiveChatStateType, ActiveChatUserStateType } from './chat/types'; import { PostsStateType } from './posts/types'; import {...
WesamAlmasri/social-app
components/ProfileInfo/index.tsx
<filename>components/ProfileInfo/index.tsx import React from 'react'; import { View, Text } from 'react-native'; import styles from './style'; import { ProfileType, UserFileType } from '../../types'; import { Entypo, FontAwesome5, MaterialCommunityIcons, MaterialIcons } from '@expo/vector-icons'; export type ProfileHe...
WesamAlmasri/social-app
store/posts/actionCreators.ts
import { PostType } from '../../types'; import * as actionTypes from './actionTypes'; import { UpdatePostsListActionType } from './types'; export const updatePostsList = (posts: PostType[]) => { const action: UpdatePostsListActionType = { type: actionTypes.GET_POSTS, payload: posts, }; return action; };...
WesamAlmasri/social-app
components/ProfileOptions/style.ts
import { StyleSheet } from 'react-native'; const styles = StyleSheet.create({ container: { width: '100%', backgroundColor: '#fff', paddingVertical: 10, justifyContent: 'center', alignItems: 'center' }, editButton: { width: '90%', backgroundColor: '#f1f1f1', justifyContent: 'center...
WesamAlmasri/social-app
components/SendMessageBar/index.tsx
import { Ionicons } from '@expo/vector-icons'; import { useNavigation } from '@react-navigation/core'; import React, { useEffect, useState } from 'react'; import { Alert, KeyboardAvoidingView, Platform, TextInput, TouchableOpacity } from 'react-native'; import { useSelector } from 'react-redux'; import Colors from '../...
WesamAlmasri/social-app
components/Comment/style.ts
import { StyleSheet } from "react-native"; const styles = StyleSheet.create({ commentContainer: { flexDirection: 'row', marginBottom: 15 }, rightPart: { marginLeft: 15 }, username: { fontWeight: 'bold', }, commentText: { }, createdAt: { fontS...
WesamAlmasri/social-app
components/ProfilePicture/index.tsx
<filename>components/ProfilePicture/index.tsx import React from 'react'; import { Image } from 'react-native'; export type ProfilePictureProps = { image?: string, size?: number, } const ProfilePicture = ({ image, size = 50 }: ProfilePictureProps) => { return ( <Image source={{ uri: image || 'https...
WesamAlmasri/social-app
store/posts/reducer.ts
import { PostType } from '../../types'; import * as actionTypes from './actionTypes'; import { UpdatePostsListActionType, PostsStateType } from './types'; const initialState: PostsStateType = { posts: [], }; const reducer = ( state: PostsStateType = initialState, action: UpdatePostsListActionType ): PostsStateT...
WesamAlmasri/social-app
components/MessageBubble/index.tsx
<filename>components/MessageBubble/index.tsx import React from 'react'; import { View, Text } from 'react-native'; import styles from './style'; import { MessageType } from '../../types'; // Dummy Data import meProfile from '../../data/meProfile'; import moment from 'moment'; export type MessageBubbleProps = { me...
WesamAlmasri/social-app
components/ConversationHeader/style.ts
<reponame>WesamAlmasri/social-app<gh_stars>0 import { StyleSheet } from 'react-native'; const styles = StyleSheet.create({ container: { width: '100%', flexDirection: 'row', alignItems: 'center', backgroundColor: '#fff', padding: 10 }, rightSide: { marginLeft: 15, justifyContent: 'spac...
WesamAlmasri/social-app
components/Post/PostHeader/index.tsx
import React, { useEffect, useState } from 'react'; import { Text, View, TouchableOpacity, Modal, Alert, ActivityIndicator } from 'react-native'; import { PostType } from '../../../types'; import { MaterialCommunityIcons } from '@expo/vector-icons'; import Colors from '../../../constants/Colors'; import styles from './...
WesamAlmasri/social-app
store/notifications/actionTypes.ts
<gh_stars>0 export const UPDATE_ACTIVE_NOTIFICATION = 'UPDATE_ACTIVE_NOTIFICATION';
WesamAlmasri/social-app
components/MessageBubble/style.ts
<reponame>WesamAlmasri/social-app import { StyleSheet } from 'react-native'; const styles = StyleSheet.create({ messageContainer: { padding: 10, marginBottom: 10, borderRadius: 15 }, message: { }, createdAt: { fontSize: 10, marginTop: 5, alignSelf: 'flex-end', color: 'g...
WesamAlmasri/social-app
components/Post/PostFooter/index.tsx
<gh_stars>0 import React, { useEffect, useState } from 'react'; import { Text, View, TouchableOpacity } from 'react-native'; import { Ionicons, MaterialCommunityIcons } from '@expo/vector-icons'; import Colors from '../../../constants/Colors'; import { PostType } from '../../../types'; import styles from './style'; imp...
WesamAlmasri/social-app
screens/ProfileScreen.tsx
import React, { useState } from 'react'; import { ActivityIndicator, Alert, SafeAreaView, StyleSheet } from 'react-native'; import Feed from '../components/Feed'; import ProfileHeader from '../components/ProfileHeader'; import ProfileInfo from '../components/ProfileInfo'; import ProfileOptions from '../components/Profi...
WesamAlmasri/social-app
screens/EditProfileScreen.tsx
import { Ionicons } from '@expo/vector-icons'; import { useNavigation } from '@react-navigation/core'; import React, { useEffect, useState } from 'react'; import { ActivityIndicator, Alert, KeyboardAvoidingView, StyleSheet } from 'react-native'; import { Text, View, TextInput, TouchableOpacity, Platform, Image } from '...
WesamAlmasri/social-app
data/notifications.ts
<reponame>WesamAlmasri/social-app const notifications = [ { id: 'd62eb82f-6a08-4460-a958-5edcee1610ea', receiver_id: 'f1039522-4fcc-4b4a-b0b5-e6289371f795', message: 'SoulsReaperX commented on you post', post_id: '11940cf7-dc2a-4687-a39f-6c07ce8c5751', seen: true, created_at: '2021-07-28T23:41...
WesamAlmasri/social-app
types.tsx
<reponame>WesamAlmasri/social-app<gh_stars>0 /** * Learn more about using TypeScript with React Navigation: * https://reactnavigation.org/docs/typescript/ */ export type RootStackParamList = { authController: undefined; socketService: undefined; VerificationCode: undefined; Login: undefined; Register: und...
WesamAlmasri/social-app
store/notifications/actionCreators.ts
<gh_stars>0 // import { NotificationType } from '../../types'; // import * as actionTypes from './actionTypes'; // import { DispatchType, ActiveNotificationActionType } from './types'; // export const updateActiveNotification = (notification: NotificationType) => { // const action: ActiveNotificationActionType = { /...
WesamAlmasri/social-app
components/Post/PostHeader/style.ts
<filename>components/Post/PostHeader/style.ts import { StyleSheet } from "react-native"; const styles = StyleSheet.create({ postHeaderContainer: { flexDirection: 'row', alignItems: 'center', marginBottom: 10 }, middle: { marginHorizontal: 10, flex: 1, }, user...
WesamAlmasri/social-app
screens/ConversationScreen.tsx
import { Ionicons } from '@expo/vector-icons'; import { useNavigation } from '@react-navigation/native'; import { RouteProp, useRoute } from '@react-navigation/core'; import React, { useEffect, useState } from 'react'; import { StyleSheet, View, Text, SafeAreaView, TouchableOpacity, ActivityIndicator, Alert } from 'rea...
WesamAlmasri/social-app
store/userDetails/types.ts
<filename>store/userDetails/types.ts import { ProfileType, UserFileType } from '../../types'; export type UserDetailsStateType = { user: ProfileType<UserFileType> | null; otherProfileUsername: ProfileType<UserFileType> | null; otherProfile: ProfileType<UserFileType> | null; }; export type UserDetailsActionType ...
WesamAlmasri/social-app
components/NewPostRow/style.ts
import { StyleSheet } from "react-native"; const styles = StyleSheet.create({ NewPostRowContainer: { backgroundColor: '#fff', marginVertical: 10, padding: 10 }, newPostButton: { flexDirection: 'row', backgroundColor: '#eeeeee', alignSelf: 'center', wi...
WesamAlmasri/social-app
store/userDetails/reducer.ts
<filename>store/userDetails/reducer.ts import * as actionTypes from './actionTypes'; import { UserDetailsActionType, UserDetailsStateType } from './types'; const initialState: UserDetailsStateType = { user: null, otherProfileUsername: null, otherProfile: null, }; const reducer = ( state: UserDetailsStateType ...
WesamAlmasri/social-app
store/userDetails/actionCreators.ts
import { ProfileType, UserFileType } from '../../types'; import * as actionTypes from './actionTypes'; import { UserDetailsActionType } from './types'; export const updateUserDetails = (userDetails: ProfileType<UserFileType>) => { const action: UserDetailsActionType = { type: actionTypes.UPDATE_USER_DETAILS, ...
WesamAlmasri/social-app
screens/NotificationsScreen.tsx
import { useIsFocused, useNavigation } from '@react-navigation/core'; import React, { useEffect, useState } from 'react'; import { View, Text, StyleSheet, Alert, ActivityIndicator } from 'react-native'; import { FlatList } from 'react-native-gesture-handler'; import SingleNotificationRow from '../components/SingleNotif...
WesamAlmasri/social-app
screens/NewPostScreen.tsx
<gh_stars>0 import React, { useState, useEffect, useRef } from 'react'; import { Platform, StyleSheet, View, Text, TextInput, TouchableOpacity, SafeAreaView, KeyboardAvoidingView, Image, Alert, ActivityIndicator } from 'react-native'; import { AntDesign, Ionicons } from '@expo/vector-icons'; import Colors from '../cons...
WesamAlmasri/social-app
navigation/index.tsx
<reponame>WesamAlmasri/social-app /** * If you are not familiar with React Navigation, check out the "Fundamentals" guide: * https://reactnavigation.org/docs/getting-started * */ import { NavigationContainer, DefaultTheme, DarkTheme } from '@react-navigation/native'; import { createStackNavigator } from '@react-nav...
WesamAlmasri/social-app
data/comments.ts
const comments = [ { id: 'dfgdkjkjk4j5lk34jk5j4k3j', comment: 'nice one', created_at: '2021-07-15T15:14:37.841Z', post_owner: '2b59961c-6112-4a7e-8bfe-3947f066fb81', profile: { id: '2b59961c-6112-4a7e-8bfe-3947f066fb81', first_name: 'flan', last_name: 'alflany', profile_pic...
WesamAlmasri/social-app
store/comments/reducer.ts
import { CommentType } from '../../types'; import * as actionTypes from './actionTypes'; import { CommentsStateType, UpdateCommentsListActionType, DispatchType } from './types'; const initialState: CommentsStateType = { comments: [], }; const reducer = ( state: CommentsStateType = initialState, action: UpdateCo...
WesamAlmasri/social-app
store/chat/types.ts
import { MessageType, ProfileType, UserFileType } from '../../types'; export type ActiveChatStateType = { activeChat: MessageType | null; }; export type ActiveChatActionType = { type: string; payload: MessageType | null; }; export type ActiveChatUserStateType = { activeChatUser: ProfileType<UserFileType> | n...
WesamAlmasri/social-app
navigation/BottomTabNavigator.tsx
<gh_stars>0 /** * Learn more about createBottomTabNavigator: * https://reactnavigation.org/docs/bottom-tab-navigator */ import { Feather, Ionicons } from '@expo/vector-icons'; import { createBottomTabNavigator } from '@react-navigation/bottom-tabs'; import { createStackNavigator } from '@react-navigation/stack'; im...
WesamAlmasri/social-app
data/profiles.ts
const profiles = [ { "id": "1fb0afeb-1d8a-4111-ae93-71fefb59aa11", "first_name": "yahya95", "last_name": "", "caption": "software Devoloper", "profile_picture": { "id": "877182ca-cd33-49c4-b7a4-fd1c421b1cf2", "link": "https://hexagon-sm.s3.eu-central-1...
WesamAlmasri/social-app
components/Post/PostBody/style.ts
<filename>components/Post/PostBody/style.ts import { StyleSheet } from 'react-native'; const styles = StyleSheet.create({ postBodyContainer: { marginBottom: 10 }, content: { marginBottom: 15 }, image: { width: '100%', height: 200, resizeMode: 'cover', }, }); export default styles;
WesamAlmasri/social-app
store/userDetails/actionTypes.ts
<reponame>WesamAlmasri/social-app<gh_stars>0 export const UPDATE_USER_DETAILS = 'UPDATE_USER_DETAILS'; export const UPDATE_OTHER_PROFILE_USERNAME = 'UPDATE_OTHER_PROFILE_USERNAME'; export const UPDATE_OTHER_PROFILE_DETAILS = 'UPDATE_OTHER_PROFILE_DETAILS';
WesamAlmasri/social-app
store/chat/actionTypes.ts
export const ACTIVE_CHAT = 'ACTIVE_CHAT'; export const ACTIVE_CHAT_USER = 'ACTIVE_CHAT_USER';
WesamAlmasri/social-app
components/Comment/index.tsx
import React, { useEffect, useState } from "react"; import { Text, View, TouchableOpacity, Modal, Alert, ActivityIndicator } from 'react-native'; import styles from "./style"; import { CommentType } from "../../types"; import ProfilePicture from "../ProfilePicture"; import moment from 'moment'; import Feather from '@ex...
WesamAlmasri/social-app
store/chat/actionCreators.ts
<reponame>WesamAlmasri/social-app // import { MessageType, ProfileType, UserFileType } from '../../types'; // import * as actionTypes from './actionTypes'; // import { // ActiveChatActionType, // ActiveChatUserActionType, // DispatchActiveChatType, // DispatchActiveChatUserType, // } from './types'; // // Acti...
WesamAlmasri/social-app
components/SendMessageBar/style.ts
import { StyleSheet } from 'react-native'; const styles = StyleSheet.create({ container: { width: '100%', flexDirection: 'row', alignItems: 'center', padding: 5, borderTopColor: '#d0d0d0' }, commentInput: { padding: 10, flex: 1, backgroundColor: '#ebebeb', borderRadius: 20, ...
WesamAlmasri/social-app
screens/MessagesScreen.tsx
import React, { useEffect, useState } from 'react'; import { ActivityIndicator, Alert, StyleSheet } from 'react-native'; import SearchBar from '../components/SearchBar'; import { View, FlatList } from 'react-native'; import SingleProfileWithMessageRow from '../components/SingleProfileWithMessageRow'; import { useIsFo...
WesamAlmasri/social-app
store/posts/actionTypes.ts
export const GET_POSTS = 'GET_POSTS'; export const ADD_POST = 'ADD_POST'; export const UPDATE_POST = 'UPDATE_POST'; export const DELETE_POST = 'DELETE_POST';
WesamAlmasri/social-app
data/chatConversation.ts
const chatConversation = [ { id: 'a8508221-f226-4924-9bc0-86991b3d7a6d', sender_id: 'f1039522-4fcc-4b4a-b0b5-e6289371f795', receiver_id: '2b59961c-6112-4a7e-8bfe-3947f066fb81', message: 'Hey welcom', seen: false, created_at: '2021-08-03T19:54:57.149Z', }, { id: '608b97a2-6ba7-4d68-9d33...
WesamAlmasri/social-app
screens/SearchScreen.tsx
import { useNavigation } from '@react-navigation/core'; import React, { useEffect } from 'react'; import { useState } from 'react'; import { StyleSheet, View, FlatList, Alert } from 'react-native'; import SearchBar from '../components/SearchBar'; import SingleProfileRow from '../components/SingleProfileRow'; import { a...
WesamAlmasri/social-app
components/SingleNotificationRow/style.ts
<filename>components/SingleNotificationRow/style.ts<gh_stars>0 import { StyleSheet } from 'react-native'; const styles = StyleSheet.create({ container: { width: '100%', marginVertical: 5 }, touchableContainer: { width: '100%', flexDirection: 'row', alignItems: 'center', paddingHorizontal:...
WesamAlmasri/social-app
components/SingleNotificationRow/index.tsx
import React, { useEffect, useState } from 'react'; import { View, Text, TouchableWithoutFeedback, TouchableOpacity } from 'react-native'; import styles from './style'; import { NotificationType } from '../../types'; import ProfilePicture from '../ProfilePicture'; import { useNavigation } from '@react-navigation/native...
WesamAlmasri/social-app
screens/SinglePostScreen.tsx
import React, { useState } from 'react'; import { Platform, StyleSheet, SafeAreaView, View, Text, FlatList, TouchableOpacity, TextInput, KeyboardAvoidingView, Alert, ActivityIndicator } from 'react-native'; import Post from '../components/Post'; import { useRoute } from '@react-navigation/native'; import { RouteProp, u...
WesamAlmasri/social-app
socketService.ts
import React, { useEffect } from 'react'; import openSocket from 'socket.io-client'; import { useSelector, useDispatch } from 'react-redux'; import { updateActiveChat } from './store/chat/actionCreators'; import { updateActiveNotification } from './store/notifications/actionCreators'; import { MESSAGES_SOCKET_URL, NOTI...
WesamAlmasri/social-app
components/ConversationInterface/style.ts
<reponame>WesamAlmasri/social-app import { StyleSheet } from 'react-native'; const styles = StyleSheet.create({ feedContainer: { width: '100%', flex: 1, padding: 15 }, noChatText: { fontSize: 20 } }); export default styles;
WesamAlmasri/social-app
components/SearchBar/index.tsx
<gh_stars>0 import React, { useState } from 'react'; import { View, Text, TextInput, TouchableOpacity } from 'react-native'; import styles from './style'; import { Ionicons, Feather } from '@expo/vector-icons'; export type SearchBarProps = { onChangeKeyword: Function } const SearchBar = ({onChangeKeyword}: Search...
WesamAlmasri/social-app
store/comments/actionCreators.ts
<reponame>WesamAlmasri/social-app<filename>store/comments/actionCreators.ts import { CommentType } from '../../types'; import * as actionTypes from './actionTypes'; import { UpdateCommentsListActionType } from './types'; export const updateCommentsList = (comments: CommentType[]) => { const action: UpdateCommentsLis...
WesamAlmasri/social-app
data/meProfile.ts
<filename>data/meProfile.ts const meProfile = { id: '2b59961c-6112-4a7e-8bfe-3947f066fb81', first_name: 'wesamalmas', last_name: ' almasri', caption: 'Software Engineer', profile_picture: { id: '2432jl43l24n32kljjn3lk', link: 'https://hexagon-sm.s3.eu-central-1.amazonaws.com/male.jpg', }, user: { ...
WesamAlmasri/social-app
components/Post/style.ts
<filename>components/Post/style.ts import { StyleSheet } from 'react-native'; const styles = StyleSheet.create({ container: { width: '100%', flexDirection: 'column', padding: 10, backgroundColor: '#fff', marginBottom: 10 }, }); export default styles;
WesamAlmasri/social-app
components/Post/PostFooter/style.ts
<filename>components/Post/PostFooter/style.ts<gh_stars>0 import { StyleSheet } from 'react-native'; const styles = StyleSheet.create({ postFooterContainer: { flexDirection: 'row', justifyContent: 'flex-start', alignItems: 'center', borderTopWidth: 0.5, borderTopColor: '#e7e7e7', p...
WesamAlmasri/social-app
screens/AuthScreen.tsx
<reponame>WesamAlmasri/social-app import { NavigationProp, useNavigation } from '@react-navigation/native'; import axios from 'axios'; import React, { Dispatch, useState, useEffect } from 'react'; import { View, Dimensions, Keyboard, Text, KeyboardAvoidingView, Platform, TextInput, TouchableOpacity, Alert, StyleSheet, ...
WesamAlmasri/social-app
components/ProfileInfo/style.ts
import { StyleSheet } from 'react-native'; const styles = StyleSheet.create({ container: { width: '100%', padding: 10, borderTopWidth: 1, backgroundColor: '#fff', borderColor: '#e5e5e5', marginBottom: 10 }, profileInfoRow: { flexDirection: 'row', alignItems: 'center', marginBo...
WesamAlmasri/social-app
components/Feed/index.tsx
import React, { ComponentType, useEffect, useState } from 'react'; import { View, FlatList, ActivityIndicator, Text } from 'react-native'; import Post from '../Post'; import styles from './style'; import NewPostRow from '../NewPostRow'; import { useSelector } from 'react-redux'; import { StoreStateType } from '../../st...
WesamAlmasri/social-app
store/notifications/types.ts
import { NotificationType } from '../../types'; export type ActiveNotificationStateType = { activeNotification: NotificationType | null; }; export type ActiveNotificationActionType = { type: string; payload: NotificationType; }; export type DispatchType = (args: ActiveNotificationActionType) => ActiveNotificat...
WesamAlmasri/social-app
components/SingleProfileWithMessageRow/style.ts
import { StyleSheet } from 'react-native'; const styles = StyleSheet.create({ container: { width: '100%', marginVertical: 5 }, touchableContainer: { width: '100%', flexDirection: 'row', alignItems: 'center', paddingHorizontal: 15, paddingVertical: 5 }, rightSide:{ marginLeft: ...
WesamAlmasri/social-app
helper.ts
<filename>helper.ts import Axios, { AxiosPromise, AxiosRequestConfig, CancelToken, CancelTokenSource } from 'axios'; import { ME_URL, REFRESH_URL, LOGOUT_URL } from './urls'; import AsyncStorage from '@react-native-async-storage/async-storage'; import { NavigationProp } from '@react-navigation/native'; import {...
WesamAlmasri/social-app
components/SingleProfileWithMessageRow/index.tsx
<gh_stars>0 import React, { useState } from 'react'; import { View, Text, TouchableWithoutFeedback, TouchableOpacity } from 'react-native'; import styles from './style'; import { ProfileWithMessageType, UserFileType } from '../../types'; import ProfilePicture from '../ProfilePicture'; import { useNavigation } from '@re...
WesamAlmasri/social-app
screens/HomeScreen.tsx
import React, { useEffect, useState } from 'react'; import { ActivityIndicator, Alert, StyleSheet, Text } from 'react-native'; import NewPostRow from '../components/NewPostRow'; import Feed from '../components/Feed'; import { View } from '../components/Themed'; import { CategoryType, PostType } from '../types'; impor...
WesamAlmasri/social-app
components/SearchBar/style.ts
import { StyleSheet } from 'react-native'; const styles = StyleSheet.create({ container: { backgroundColor: '#fff', position: 'relative', marginTop: 10 }, searchIcon: { position: 'absolute', left: '3%', top: '50%', }, xIcon: { position: 'absolute', right: '1%', top: '48%' ...
WesamAlmasri/social-app
components/authController.tsx
import React, { useEffect } from 'react'; import axios, { CancelTokenSource } from 'axios'; import { axiosHandler, getData, logout, storeData, tokenName, tokenType } from '../helper'; import { ME_URL, REFRESH_URL } from '../urls'; import { useDispatch } from 'react-redux'; import { updateUserDetails } from '../store/us...
WesamAlmasri/social-app
components/Post/PostBody/index.tsx
<reponame>WesamAlmasri/social-app<gh_stars>0 import React from 'react'; import { Text, View, Image } from 'react-native'; import { PostType } from '../../../types'; import styles from './style'; export type PostBodyProps = { post: PostType } const PostBody = ({ post }: PostBodyProps) => { return ( <Vi...
WesamAlmasri/social-app
data/profilesWithMessages.ts
<gh_stars>0 const profilesWithMessages = [ { id: '1fb0afeb-1d8a-4111-ae93-71fefb59aa11', first_name: 'yahya95', last_name: '', caption: '', profile_picture: { id: '877182ca-cd33-49c4-b7a4-fd1c421b1cf2', link: 'https://hexagon-sm.s3.eu-central-1.amazonaws.com/1627550807425-profile.jpeg'...
WesamAlmasri/social-app
data/singlePost.ts
<reponame>WesamAlmasri/social-app const singlePost = { id: '2b6b9b2e-7ae5-4f36-bdb4-01316e50fc64', text: 'The is the latest post that you will see', created_at: '2021-07-15T15:14:37.841Z', am_like: false, category: { id: 'sdfdsfsd2343232lkn', name: 'artist', }, profile: { id: '2b59961c-6112-4a...
WesamAlmasri/social-app
store/index.ts
<filename>store/index.ts import { createStore, combineReducers, applyMiddleware } from 'redux'; import { composeWithDevTools } from 'redux-devtools-extension'; import thunk from 'redux-thunk'; // import Reducers import userDetailsReducer from './userDetails/reducer'; import notificationsReducer from './notifications/r...
WesamAlmasri/social-app
components/NewPostRow/index.tsx
<filename>components/NewPostRow/index.tsx import React from 'react'; import { View, Text, TouchableOpacity } from 'react-native'; import styles from './style'; import { Ionicons } from '@expo/vector-icons'; import { useNavigation } from '@react-navigation/native'; const NewPostRow = () => { const navigation = use...
WesamAlmasri/social-app
urls.ts
<gh_stars>0 const BASE_URL = 'https://hexagon-sm.herokuapp.com/'; // Socket services urls export const MESSAGES_SOCKET_URL = 'https://hexagon-sm.herokuapp.com:443/messages'; export const NOTIFICATIONS_SOCKET_URL = 'https://hexagon-sm.herokuapp.com:443/notifications'; // Auth endpoints export const SIGN_IN_GOOGLE_URL ...
WesamAlmasri/social-app
components/ConversationHeader/index.tsx
<gh_stars>0 import React from 'react'; import { View, Text, TouchableOpacity } from 'react-native'; import styles from './style'; import { ProfileType, UserFileType } from '../../types'; import ProfilePicture from '../ProfilePicture'; import { FontAwesome } from '@expo/vector-icons'; import { useNavigation } from '@rea...
WesamAlmasri/social-app
store/posts/types.ts
<gh_stars>0 import { PostType } from '../../types'; export type PostsStateType = { posts: PostType[]; }; export type UpdatePostsListActionType = { type: string; payload: PostType[] | string; }; export type PostsListDispatchType = (args: UpdatePostsListActionType) => UpdatePostsListActionType
MarcinMichalik/ng2-busy
src/ng2-busy.service.ts
import {Injectable, Optional} from "@angular/core"; import {Ng2BusyConfig} from "./ng2-busy-config"; @Injectable() export class Ng2BusyService{ config: Ng2BusyConfig; constructor(@Optional() config: Ng2BusyConfig) { this.config = config || new Ng2BusyConfig(); } }
MarcinMichalik/ng2-busy
src/ng2-busy-config.ts
import {Subscription} from "rxjs/Subscription"; export const NG2_BUSY_CONFIG_DEFAULTS = { // template: ` // <div class="ng-busy-default-wrapper"> // <div class="ng-busy-default-text">{{message}}</div> // </div> // `, template: ` <div class="marcin"> <div class="dorota"></div> </div> <div cl...
MarcinMichalik/ng2-busy
webpack.config.ts
<gh_stars>1-10 import * as webpack from 'webpack'; import * as path from 'path'; import * as HtmlWebpackPlugin from 'html-webpack-plugin'; import * as ExtractTextPlugin from 'extract-text-webpack-plugin'; var autoprefixer = require('autoprefixer'); const IS_PROD: boolean = process.argv.indexOf('-p') > -1; export defa...
MarcinMichalik/ng2-busy
demo/demo.module.ts
<filename>demo/demo.module.ts import {NgModule} from '@angular/core'; import {DemoComponent} from './demo.component'; import {BrowserModule} from '@angular/platform-browser'; import {Ng2BusyModule} from "../src/ng2-busy.module"; import {HttpModule} from "@angular/http"; import {BrowserAnimationsModule} from "@angular/p...
MarcinMichalik/ng2-busy
src/ng2-busy-backdrop/ng2-busy-backdrop.component.ts
<filename>src/ng2-busy-backdrop/ng2-busy-backdrop.component.ts import {Component} from "@angular/core"; import {Ng2PromiseTrackerService} from "../ng2-promise-tracker.service"; @Component({ selector: 'ng2-busy-backdrop', template: `<div class="ng-busy-backdrop" [hidden]="!isActive()" [ngClass]="{'ng-busy-show': isAc...
MarcinMichalik/ng2-busy
demo/demo.component.ts
<filename>demo/demo.component.ts<gh_stars>1-10 import {Component} from "@angular/core"; import {Http} from "@angular/http"; @Component({ selector: 'demo-app', templateUrl: './demo.component.html' }) export class DemoComponent{ busyConfig = { busy: null, message: 'My message', backdrop: true }; busy;...
MarcinMichalik/ng2-busy
src/index.ts
<filename>src/index.ts export * from './ng2-busy.module'; export * from './ng2-busy.directive'; export * from './ng2-busy.service'; export * from './ng2-busy-config';
MarcinMichalik/ng2-busy
src/ng2-busy.module.ts
<filename>src/ng2-busy.module.ts import {CommonModule} from "@angular/common"; import {ModuleWithProviders, NgModule} from "@angular/core"; import {Ng2BusyBackdropComponent} from "./ng2-busy-backdrop/ng2-busy-backdrop.component"; import {Ng2BusyConfig} from "./ng2-busy-config"; import {Ng2BusyDirective} from "./ng2-bus...
MarcinMichalik/ng2-busy
src/ng2-busy/ng2-busy-component.ts
import {Component, DoCheck, ElementRef, OnDestroy, ViewChild} from '@angular/core'; import {Ng2PromiseTrackerService} from "../ng2-promise-tracker.service"; export interface Ng2BusyContext { message: string; } @Component({ selector: 'ng2-busy', template: `<div #wrapper [hidden]="!isActive()" [class]="wrapperClass...
hertzg/node-urban-dictionary
src/lib/api/define.ts
<filename>src/lib/api/define.ts<gh_stars>0 import miniget from "miniget"; const URL_DEFINE = "https://api.urbandictionary.com/v0/define"; const URL_RANDOM = "https://api.urbandictionary.com/v0/random"; const buildUrl = (term?: string | null): string => term != null ? `${URL_DEFINE}?term=${encodeURIComponent(ter...
hertzg/node-urban-dictionary
src/lib/report.ts
import { Definition } from "./index"; const buildResult = (def: Definition) => `${def.word}: ${def.definition}`; const buildError = (query: string | null) => query ? `${query}: no results found` : `unable to get random definition`; export const report = (query: string | null, def: Definition | null): void => def...
hertzg/node-urban-dictionary
src/lib/index.ts
<reponame>hertzg/node-urban-dictionary import { defineTerm, ResponseDefinition } from "./api/define"; export interface Definition { term: string | null; id: string; word: string; definition: string; } const score = (e: ResponseDefinition) => e.thumbs_up - e.thumbs_down; const byScoreDesc = (a: ResponseDefinit...
hertzg/node-urban-dictionary
src/bin/udd.ts
<reponame>hertzg/node-urban-dictionary #!/usr/bin/env node import { run } from "../run"; run(process.argv.slice(2)).catch((e) => console.error(e));
hertzg/node-urban-dictionary
src/run.ts
import { define } from "./lib"; import { report } from "./lib/report"; const runDefine = async (term: string | null): Promise<void> => { const def = await define(term); report(term, def); }; export const run = async (args: string[]): Promise<void> => args.length ? runDefine(args.join(" ")) : runDefine(null);
KarthickSelvam/loopback-next
examples/lb3-application/src/application.ts
// Copyright IBM Corp. 2019. All Rights Reserved. // Node module: @loopback/example-lb3-application // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT import {BootMixin} from '@loopback/boot'; import {Lb3AppBooterComponent} from '@loopback/booter-lb3app'; i...
haalto/mop-twitter-pipeline
services/mq-worker/src/config.ts
import * as dotenv from "dotenv"; dotenv.config({ path: `${__dirname}/../.env` }); export const config = { queueName: process.env.MQ_NAME || "tweets", mqUrl: process.env.MQ_URL || "amqp://mq:5672", dbUrl: process.env.DB_URL || "bolt://neo4j:7687", };
haalto/mop-twitter-pipeline
services/stream-handler/src/index.ts
<reponame>haalto/mop-twitter-pipeline import { config } from "./config"; import { getUsersOfList } from "./services/lists"; import { setRulesIfNotSet } from "./services/rules"; import { streamConnect } from "./services/stream"; import { createUsersBatch } from "./services/userServices"; (async () => { console.log("S...
haalto/mop-twitter-pipeline
services/mq-worker/src/index.ts
<reponame>haalto/mop-twitter-pipeline import { getChannel, getQueue } from "./services/mq"; import { createTweet } from "./services/tweetServices"; import { StreamObject } from "./types"; (async () => { console.log("Start MQ-worker"); const channel = await getChannel(); const queue = await getQueue(); channe...
haalto/mop-twitter-pipeline
services/mq-worker/src/services/mq.ts
<reponame>haalto/mop-twitter-pipeline<filename>services/mq-worker/src/services/mq.ts import { connect } from "amqplib"; import { config } from "../config"; const { mqUrl, queueName } = config; const getConnection = () => { return connect(mqUrl); }; export const getChannel = async () => { const connection = await...
haalto/mop-twitter-pipeline
services/client/src/types.ts
export interface User { id: string; name: string; username: string; } export interface Tweet { id: string; author_id: string; text: string; created_at: Date; user: User; } export interface TweetWithUser extends Tweet { user: User; }
haalto/mop-twitter-pipeline
services/client/src/hooks/useTweets.ts
<gh_stars>0 import { useQuery } from "@apollo/client"; import { GET_TWEETS_WITH_USERS } from "../schemas/tweets"; export const useTweets = () => { const { loading, error, data } = useQuery(GET_TWEETS_WITH_USERS); return { loading, error, data: data?.tweetsWithUsers ?? [] }; };
haalto/mop-twitter-pipeline
services/api/src/config.ts
<gh_stars>0 import * as dotenv from "dotenv"; dotenv.config({ path: `${__dirname}/../.env` }); export const config = { port: process.env.PORT || 5000, dbUrl: process.env.DB_URL || "bolt://neo4j:7687", };
haalto/mop-twitter-pipeline
services/stream-handler/src/services/lists.ts
import axios from "axios"; import { config } from "../config"; import { stringify } from "querystring"; import { User } from "../types"; export const getUsersOfList = async ( listId: number, next_token: undefined ): Promise<User[]> => { const { listsURL, bearerToken } = config; const url = `${listsURL}/${listI...
haalto/mop-twitter-pipeline
services/api/src/schemas/User.ts
import { Field, ObjectType } from "type-graphql"; @ObjectType() export default class User { @Field(() => String) id: String; @Field(() => String) name: String; @Field(() => String) username: String; }