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
'use strict' | |
import React, { Component } from 'react' | |
import { | |
Text, | |
View | |
} from 'react-native' | |
// Styles are separated from the component | |
// since components tend to have crazy number of lines |
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
ACTION = build | |
AD_HOC_CODE_SIGNING_ALLOWED = NO | |
ALTERNATE_GROUP = staff | |
ALTERNATE_MODE = u+w,go-w,a+rX | |
ALTERNATE_OWNER = grantdavis | |
ALWAYS_SEARCH_USER_PATHS = NO | |
ALWAYS_USE_SEPARATE_HEADERMAPS = YES | |
APPLE_INTERNAL_DEVELOPER_DIR = /AppleInternal/Developer | |
APPLE_INTERNAL_DIR = /AppleInternal | |
APPLE_INTERNAL_DOCUMENTATION_DIR = /AppleInternal/Documentation |
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
// note that currentFirstResponder is obtained by this: | |
// | |
// static var currentFirstResponder: UIResponder? | |
// func findFirstResponder(sender: Any) { | |
// currentFirstResponder = self | |
// } | |
// | |
// class func currentFirstResponder() -> UIResponder? { | |
// currentFirstResponder = nil | |
// UIApplication.shared.sendAction(#selector(findFirstResponder), to: nil, from: nil, for: nil) |
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 statements here | |
function App() { | |
// Placeholder function for handling changes to our chat bar | |
const handleChange = () => {}; | |
// Placeholder function for handling the form submission | |
const handleSubmit = () => {}; | |
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
* { | |
box-sizing: border-box; | |
} | |
html, body { | |
height: 100%; | |
} | |
#root { | |
display: flex; |
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, { useEffect, useState } from 'react'; | |
import API, { graphqlOperation } from '@aws-amplify/api'; | |
import { listMessages } from './graphql/queries'; | |
// ... rest of the code here |
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 [messages, setMessages] = useState([]); | |
useEffect(() => { | |
API | |
.graphql(graphqlOperation(listMessages)) | |
.then((response) => { | |
const items = response.data?.listMessages?.items; | |
if (items) { | |
setMessages(items); |
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
{messages.map((message) => ( | |
<div | |
key={message.id} | |
className={message.author === 'Dave' ? 'message me' : 'message'}>{message.body}</div> | |
))} |
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
.message { | |
align-self: flex-start; | |
... | |
} | |
.message.me { | |
align-self: flex-end; | |
... | |
} |