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 * as FileSystem from 'expo-file-system'; | |
const foo = require('./assets/images/photo1.jpg'); | |
const fooURI = Image.resolveAssetSource(foo).uri; | |
console.log('FooURI: ' + fooURI); | |
const App: () => React$Node = () => { | |
const [imageDownloaded, setImageDownloaded] = useState(0); | |
const docDir = FileSystem.documentDirectory; | |
const localFile = 'file://' + docDir + 'photo1.jpg'; |
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 InputModal = {variableIndex} => { | |
const keyText = useContext(LocationContext); | |
return( | |
<TouchableHighlight | |
style={styles.openButton} | |
onPress={() => { | |
//console.log('modalText: ' + modalText); | |
changeText(modalText); | |
setModalVisible(!modalVisible); | |
console.log('keyText: ' + keyText[variableIndex]); |
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
class Generator(nn.Module): | |
def __init__(self, ngpu): | |
super(Generator, self).__init__() | |
self.ngpu = ngpu | |
self.main = nn.Sequential( | |
# input is Z, going into a convolution | |
nn.ConvTranspose2d( nz, ngf * 8, 4, 1, 0, bias=False), | |
nn.BatchNorm2d(ngf * 8), | |
nn.ReLU(True), | |
# state size. (ngf*8) x 4 x 4 |
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 LocationScreen = ({route, navigation}) => { | |
let variables = route.params.story.variables; | |
useEffect(() => { | |
/* Override variables passed in with anything loaded from AsyncStorage */ | |
variables = getData(route.params.storyID, variables); | |
}, []); | |
console.log('LocationScreen: ' + JSON.stringify(variables)); | |
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
let textToDisplayArray = ParserClass.parseVariables(text); | |
let textList = textToDisplayArray.map((item) => { | |
if (typeof item !== 'string') { | |
return item; | |
} else { | |
return <Text>{item}</Text>; | |
} | |
}); |
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
let textList = textToDisplayArray.map((item) => { | |
if (typeof item !== 'string') { | |
return item; | |
} else { | |
return <Text>{item}</Text>; | |
} | |
}); | |
return <Text>{textList}</Text>; |
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 result = regexifyString({ | |
pattern: /{var .*}/gim, | |
decorator: (match, index) => { | |
console.log(match); | |
let textToDisplay = match.slice(4, -1); | |
return <VarInput inputText={textToDisplay} key={index} />; | |
}, | |
input: text, | |
}); |
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
<Text> Hello | |
<Pressable | |
onPress={() => { | |
console.log('foo!'); | |
}}> | |
<Text> | |
Hello <Text style={{color: 'red'}}> you again </Text> | |
</Text> | |
</Pressable> | |
</Text> |
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 Location = ({jsondata, locationID, storyID}) => { | |
useEffect(() => { | |
console.log('Resetting default location'); | |
setLocation(0); | |
}, [storyID]); |
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
useEffect(() => { | |
console.log( | |
`Location:IN MOUNT: | |
LocationID: ${locationID} + StoryID: ${storyID} + curLocation: ${curLocation}`, | |
); | |
return () => { | |
console.log('Location: CleaningUP'); | |
}; | |
}, []); |
NewerOlder