Skip to content

Instantly share code, notes, and snippets.

View alic-xc's full-sized avatar
🎯
Flexin

Olamilekan Alade alic-xc

🎯
Flexin
View GitHub Profile
@alic-xc
alic-xc / App.js
Last active January 21, 2024 14:04
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..."
@alic-xc
alic-xc / index.ts
Created December 22, 2023 09:26
This file will be created inside the src directory.
import AuthBackground from "./components/AuthBackground";
import Button from "./components/Button";
import FormInput from "./components/FormInput";
export { AuthBackground, Button, FormInput };
@alic-xc
alic-xc / gist:479cd5201f5116ac340c2316e3e6074e
Created December 22, 2023 08:44
Configure your library
npx react-native-builder-bob init
npm install react-native-builder-bob
....
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"),
};
};
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>;
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>("");
import Button from "../components/Button";
import type { Meta, StoryObj } from "@storybook/react-native";
const meta: Meta<typeof Button> = {
title: "General/Button",
component: Button,
};
export default meta;
import { Text, StyleSheet, TouchableOpacity } from "react-native";
import React from "react";
interface ButtonProps {
title: string;
}
const Button = (props: ButtonProps) => {
return (
<TouchableOpacity style={style.buttonContainer}>
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;