This file contains hidden or 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 from 'react' | |
import { View } from 'react-native'; | |
import { MainNavProps } from '../navigation/types/MainStackParams'; | |
export const ConversationScreen = ({}: MainNavProps<'Conversation'>) => { | |
return ( | |
<View /> | |
); | |
}; |
This file contains hidden or 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 from 'react' | |
import { View } from 'react-native'; | |
import { AuthNavProps } from '../navigation/types/AuthStackParams'; | |
export const LoginScreen = ({}: AuthNavProps<'Conversation'>) => { | |
return ( | |
<View /> | |
); | |
}; |
This file contains hidden or 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
overwrite: true | |
schema: "http://localhost:5000/graphql" | |
documents: | |
- components/**/*.tsx | |
- graphql/queries/*.ts | |
generates: | |
graphql/generated.ts: | |
plugins: | |
- typescript | |
- typescript-operations |
This file contains hidden or 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 { ApolloClient, split, HttpLink, InMemoryCache } from '@apollo/client'; | |
import { getMainDefinition } from '@apollo/client/utilities'; | |
import { WebSocketLink } from '@apollo/link-ws'; | |
import Introspection from './introspection-result.json'; | |
const wsLink = new WebSocketLink({ | |
uri: `ws://localhost:5000/graphql`, | |
options: { reconnect: true } | |
}); |
This file contains hidden or 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 from 'react'; | |
import { AsyncStorage } from 'react-native'; | |
import UUID from 'uuid-random'; | |
import { useApolloClient } from '@apollo/client'; | |
type User = { | |
_id: string; | |
name: string; | |
} |
This file contains hidden or 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 from 'react'; | |
import { NavigationContainer } from '@react-navigation/native'; | |
import { AuthContext, getUserFromStorage } from '../contexts/AuthContext'; | |
import { MainStackScreens } from './MainStack'; | |
import { AuthStackScreens } from './AuthStack'; | |
export const Routes: React.FC = () => { | |
const [loading, setLoading] = React.useState(true); | |
const { setUser, user } = React.useContext(AuthContext); |
This file contains hidden or 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 * as React from 'react'; | |
import { AppLoading } from 'expo'; | |
import { ApolloProvider } from '@apollo/client'; | |
import { client } from './graphql/client'; | |
import { Routes } from './navigation/Routes'; | |
import { AuthProvider, getUserFromStorage } from './contexts/AuthContext'; | |
const App = ({ skipLoadingScreen }: { skipLoadingScreen: boolean }) => { | |
const [isLoadingComplete, setLoadingComplete] = React.useState(false); |
This file contains hidden or 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 * as React from "react"; | |
import { ViewStyle, StyleSheet, TextInputProps, View, TextInput } from "react-native"; | |
interface InputProps extends TextInputProps { | |
noWrapper?: boolean; | |
containerStyle?: ViewStyle; | |
} | |
export const Input = (props: InputProps) => { | |
const { noWrapper, containerStyle, ...other } = props; |
This file contains hidden or 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 from 'react' | |
import { View } from 'react-native'; | |
import { gql } from '@apollo/client'; | |
export const MessageItemFragment = gql` | |
fragment MessageItem on Message { | |
_id | |
sender_id | |
senderName | |
text |