Skip to content

Instantly share code, notes, and snippets.

render() {
if (!this.state.isSplashReady) {
return (
<AppLoading
startAsync={this.loadSplashResources}
onFinish={() => this.setState({ isSplashReady: true })}
autoHideSplash={false}
/>
);
}
loadSplashResourcesAsync = async () => {
const splash = require("./assets/images/splash.png");
return Asset.loadAsync(splash);
};
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 => {
import React from "react";
import { Linking, Text, View } from "react-native";
class LinkingDemo extends React.Component {
handleOpenUrl = url => {
Linking.openURL(url);
}
render() {
return (
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() {
import React from "react";
import { Linking, Text, View } from "react-native";
class LinkingDemoModal extends React.Component {
handleOpenUrl = url => {
Linking.openURL(url);
}
render() {
return (
include React from "react";
include { Platform, Share, Text, View } from "react-native";
class ShareDemo extends React.Component {
handleShare = async () => {
try {
const message = "Hey, check out this awesome new app!";
const url = "https://chck.app";
const isIos = Platform.OS === "ios";
let content = {};
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: """
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",
Acme.Models.find_by_email("roadrunner@me.com")
|> Acme.Tasks.Email.welcome_user()
|> Acme.Mailer.deliver_now()