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
render() { | |
if (!this.state.isSplashReady) { | |
return ( | |
<AppLoading | |
startAsync={this.loadSplashResources} | |
onFinish={() => this.setState({ isSplashReady: true })} | |
autoHideSplash={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
loadSplashResourcesAsync = async () => { | |
const splash = require("./assets/images/splash.png"); | |
return Asset.loadAsync(splash); | |
}; |
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
loadAppResources = async () => { | |
SplashScreen.hide(); | |
const fonts = [ | |
require("./assets/fonts/Roboto.ttf"), | |
require("./assets/fonts/Roboto_bold.ttf"), | |
require("./assets/fonts/Roboto_medium.ttf") | |
]; | |
const cachedFonts = fonts.map(font => { |
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 { Linking, Text, View } from "react-native"; | |
class LinkingDemo extends React.Component { | |
handleOpenUrl = url => { | |
Linking.openURL(url); | |
} | |
render() { | |
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
import React from "react"; | |
import { Text, View } from "react-native"; | |
import { WebBrowser } from "expo"; | |
class LinkingDemoModal extends React.Component { | |
handleOpenUrl = url => { | |
WebBrowser.openBrowserAsync(url); | |
} | |
render() { |
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 { Linking, Text, View } from "react-native"; | |
class LinkingDemoModal extends React.Component { | |
handleOpenUrl = url => { | |
Linking.openURL(url); | |
} | |
render() { | |
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
defmodule Acme.Tasks.Email do | |
import Bamboo.Email | |
alias Acme.Models.User | |
def welcome_user(%User{first_name: first_name, email: email}) do | |
new_email( | |
to: {first_name, email}, | |
from: {"Acme Products", "hello@acme.com"}, | |
subject: "Welcome to Acme Products", | |
text_body: """ |
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
defmodule Acme.Tasks.Email do | |
import Bamboo.Email | |
alias Acme.Models.User | |
def welcome_user(%User{first_name: first_name, email: email, state: "ACTIVE"}) | |
when first_name != "" do | |
new_email( | |
to: {first_name, email}, | |
from: {"Acme Products", "hello@acme.com"}, | |
subject: "Welcome to Acme Products", |
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
Acme.Models.find_by_email("roadrunner@me.com") | |
|> Acme.Tasks.Email.welcome_user() | |
|> Acme.Mailer.deliver_now() |