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 from 'react'; | |
import ReactDOM from 'react-dom'; | |
import App from '.src/App'; | |
class ErrorBoundary extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state = { hasError: false }; | |
} |
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, { FC } from 'react'; | |
import { Redirect, Switch } from 'react-router-dom'; | |
import { HomePage, LoginPage, NotFoundPage } from 'pages' | |
const Routes: FC = () => ( | |
<Switch> | |
<Route path="/" component={HomePage} exact /> | |
<Route path="/login" component={LoginPage} exact /> | |
<Route path="*" component={NotFoundPage} exact /> |
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 } from "react"; | |
import { SafeAreaView, StyleSheet, TextInput } from "react-native"; | |
const Form = () => { | |
const [phone, onChangePhone] = useState(null); | |
const [email, onChangeEmail] = useState(null); | |
const [url, onChangeUrl] = useState(null); | |
return ( | |
<SafeAreaView> |
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, useRef, useCallback, useEffect } from 'react' | |
// import { api } from 'services/api' | |
// just for this exemple | |
const userList = [ | |
{ | |
id: '1', | |
name: 'Antonio Mesquita', | |
email: 'antonio.mesquita@ifood.com.br', |
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, { FC } from 'react'; | |
import Skeleton from 'react-loading-skeleton'; | |
type titleProps = { | |
loading: boolean; | |
title: string; | |
}; | |
const Title: FC<titleProps> = ({ loading, title }: titleProps) => { | |
return ( |
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
const express = require('express') | |
const http = require('http') | |
const mongoose = require('mongoose') | |
const { ApolloServer } = require('apollo-server-express') | |
const schema = require('./graphql/schema') | |
// create apollo server | |
const server = new ApolloServer({ | |
schema, |
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
const userType = require('./user/type'); | |
const messageType = require('./message/type'); | |
const roomType = require('./room/type'); | |
module.exports = [userType, messageType, roomType]; |
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
const { makeExecutableSchema } = require('graphql-tools') | |
const resolvers = require('./resolver') | |
const typeDefs = require('./type') | |
const schema = makeExecutableSchema({ | |
typeDefs, | |
resolvers, | |
}); | |
module.exports = schema; |
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
const user = require('./user/resolver'); | |
const room = require('./room/resolver'); | |
const message = require('./message/resolver'); | |
const query = { | |
Query: { | |
...user.Query, | |
...room.Query, | |
...message.Query, | |
}, |
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
const { PubSub } = require('apollo-server-express'); | |
const { withFilter } = require('apollo-server'); | |
const Message = require('../../models/message'); | |
const User = require('../../models/user'); | |
const pubsub = new PubSub(); | |
const MESSAGE_SENT = 'messageSent'; |
NewerOlder