ota-components-module
v1.3.15
Published
Reusable UI components for OTA applications
Readme
OTA Components Module
A reusable UI components library for React Native applications.
Features
- TypeScript support
- React Native components
- Cross-platform compatibility (iOS, Android, Web)
- Easy to integrate
- Consistent styling
Installation
# Using npm
npm install ota-components-module
# Using yarn
yarn add ota-components-moduleLocal Development
You can use this module locally by adding it to your package.json:
"dependencies": {
"ota-components-module": "file:app-modules/ota-components-module"
}Then run:
npm installAvailable Components
Button Components
ThemedButton: A customizable button with primary and secondary styles
Image Components
MultipleImagePreview: A gallery component for viewing multiple images with paginationImagePickerView: A component for selecting images from camera or galleryImagePickerBottomSheet: A bottom sheet implementation of the image pickerStackedImage: A component for displaying stacked images
Input Components
CustomInput: A basic text input componentFormField: A form field component with label and validationCustomDropdown: A dropdown selection componentSearchViewInput: A search input with clear functionalityKeyboardScrollView: A scrollview that adjusts for keyboard
Layout Components
BottomTwoButtonLayoutComponent: A layout with two buttons at the bottomPropertyHeaderComponent: A header component for property screensBottomSheetDialog: A customizable bottom sheet dialog
Feedback Components
ActivityLoader: A loading indicatorProgressBar: A progress bar componentCustomAlert: A custom alert dialogDialog: A general purpose dialog componentDeleteImageConfirmationDialog: A confirmation dialog for deleting images
Typography Components
Label: A text component with various styles and variants
List Components
SearchableList: A searchable list component
Component Structure
app-modules/ota-components-module/
├── src/
│ ├── button/
│ │ └── ThemedButton.tsx
│ ├── feedback/
│ │ ├── ActivityLoader.tsx
│ │ ├── CustomAlert.tsx
│ │ ├── DeleteImageConfirmationDialog.tsx
│ │ ├── Dialog.tsx
│ │ └── ProgressBar.tsx
│ ├── image/
│ │ ├── ImagePickerBottomSheet.tsx
│ │ ├── ImagePickerView.tsx
│ │ ├── MultipleImagePreview.tsx
│ │ └── StackedImage.tsx
│ ├── input/
│ │ ├── CustomDropdown.tsx
│ │ ├── CustomInput.tsx
│ │ ├── FormField.tsx
│ │ ├── KeyboardScrollView.tsx
│ │ └── SearchViewInput.tsx
│ ├── layout/
│ │ ├── BottomSheetDialog.tsx
│ │ ├── BottomTwoButtonLayoutComponent.tsx
│ │ └── PropertyHeaderComponent.tsx
│ ├── list/
│ │ └── SearchableList.tsx
│ ├── models/
│ │ └── PropertyImage.ts
│ ├── typography/
│ │ └── Label.tsx
│ ├── utils/
│ │ ├── BaseStyle.ts
│ │ └── TextConstants.ts
│ └── index.tsUsage Examples
ThemedButton
import { ThemedButton } from 'ota-components-module';
const MyComponent = () => {
return (
<ThemedButton
title="Press Me"
onPress={() => console.log('Button pressed')}
type="primary" // or "secondary"
size="regular" // or "small"
/>
);
};MultipleImagePreview
import { MultipleImagePreview } from 'ota-components-module';
const MyComponent = () => {
const images = [
{ id: '1', imageBlobUrl: 'https://example.com/image1.jpg' },
{ id: '2', imageBlobUrl: 'https://example.com/image2.jpg' },
];
return (
<MultipleImagePreview
images={images}
initialIndex={0}
onClose={() => console.log('Closed')}
onDelete={(index) => console.log(`Delete image at index ${index}`)}
/>
);
};Label
import { Label, TextSize, TextWeight } from 'ota-components-module';
const MyComponent = () => {
return (
<Label
text="Hello World"
size={TextSize.LARGE}
weight={TextWeight.BOLD}
textColorType="primary"
/>
);
};Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
