Skip to content
This repository has been archived by the owner on Jan 13, 2023. It is now read-only.

fix: Replace window.alert with Alert.alert #211

Merged
merged 1 commit into from
Jun 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions boilerplate/app/components/button/button.story.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from "react"
import { ViewStyle, TextStyle } from "react-native"
import { ViewStyle, TextStyle, Alert } from "react-native"
import { storiesOf } from "@storybook/react-native"
import { StoryScreen, Story, UseCase } from "../../../storybook/views"
import { Button } from "./"
Expand All @@ -19,16 +19,16 @@ storiesOf("Button", module)
.add("Style Presets", () => (
<Story>
<UseCase text="Primary" usage="The primary button.">
<Button text="Click It" preset="primary" onPress={() => window.alert("pressed")} />
<Button text="Click It" preset="primary" onPress={() => Alert.alert("pressed")} />
</UseCase>
<UseCase text="Disabled" usage="The disabled behaviour of the primary button.">
<Button text="Click It" preset="primary" onPress={() => window.alert("pressed")} disabled />
<Button text="Click It" preset="primary" onPress={() => Alert.alert("pressed")} disabled />
</UseCase>
<UseCase text="Array Style" usage="Button with array style" >
<Button
text="Click It"
preset="primary"
onPress={() => window.alert("pressed")}
onPress={() => Alert.alert("pressed")}
style={buttonStyleArray}
textStyle={buttonTextStyleArray}
/>
Expand Down
6 changes: 3 additions & 3 deletions boilerplate/app/components/header/header.story.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from "react"
import { View } from "react-native"
import { View, Alert } from "react-native"
import { storiesOf } from "@storybook/react-native"
import { StoryScreen, Story, UseCase } from "../../../storybook/views"
import { Header } from "./header"
Expand All @@ -26,7 +26,7 @@ storiesOf("Header", module)
<Header
headerTx="secondExampleScreen.howTo"
leftIcon="back"
onLeftPress={() => window.alert("left nav")}
onLeftPress={() => Alert.alert("left nav")}
/>
</View>
</UseCase>
Expand All @@ -35,7 +35,7 @@ storiesOf("Header", module)
<Header
headerTx="secondExampleScreen.howTo"
rightIcon="bullet"
onRightPress={() => window.alert("right nav")}
onRightPress={() => Alert.alert("right nav")}
/>
</View>
</UseCase>
Expand Down
4 changes: 2 additions & 2 deletions boilerplate/app/components/text-field/text-field.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { StoryScreen, Story, UseCase } from "../../../storybook/views"
import { Text } from "../text"
import { TextField } from "./"
import { State } from "react-powerplug"
import { ViewStyle, TextStyle } from "react-native"
import { ViewStyle, TextStyle, Alert } from "react-native"

const styleArray: ViewStyle[] = [
{paddingHorizontal: 30},
Expand Down Expand Up @@ -154,7 +154,7 @@ storiesOf("TextField", module)
if(alertWhenFocused) {
// Prevent text field focus from being repeatedly triggering alert
alertWhenFocused = false
window.alert("Text field focuesed with forwarded ref!")
Alert.alert("Text field focuesed with forwarded ref!")
}
}}
/>
Expand Down