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 "./App.css"; | |
function App() { | |
const [isLoading, setIsLoading] = React.useState(false); | |
const [isConnected, setIsConnected] = React.useState(false); | |
const [batteryLevel, setBatteryLevel] = React.useState(0); | |
const btnText = isLoading | |
? "Loading..." |
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 AuthBackground from "./components/AuthBackground"; | |
import Button from "./components/Button"; | |
import FormInput from "./components/FormInput"; | |
export { AuthBackground, Button, FormInput }; |
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
npx react-native-builder-bob init |
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
npm install react-native-builder-bob |
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 getStories = () => { | |
return { | |
"./src/stories/Button.stories.tsx": require("../src/stories/Button.stories.tsx"), | |
"./src/stories/AuthBackground.stories.tsx": require("../src/stories/AuthBackground.stories"), | |
"./src/stories/TextField.stories.tsx": require("../src/stories/FormInput.stories"), | |
}; | |
}; |
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 { ComponentMeta, ComponentStoryObj } from "@storybook/react-native"; | |
import FormInput from "../components/FormInput"; | |
const meta: ComponentMeta<typeof FormInput> = { | |
title: "Form/FormInput", | |
component: FormInput, | |
}; | |
export default meta; | |
type Story = ComponentStoryObj<typeof FormInput>; |
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 { View, Text, StyleSheet, TextInput } from "react-native"; | |
import React from "react"; | |
interface FormInputProps { | |
placeholder?: string; | |
title: string; | |
} | |
const FormInput = (props: FormInputProps) => { | |
const [value, setValue] = React.useState<string>(""); |
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 AuthBackground from "../components/AuthBackground"; | |
import type { Meta, StoryObj } from "@storybook/react-native"; | |
const meta: Meta<typeof AuthBackground> = { | |
title: "Auth Background", | |
component: AuthBackground, | |
}; | |
export default meta; |
NewerOlder