Skip to content

Commit

Permalink
GorgeousHeader is here
Browse files Browse the repository at this point in the history
  • Loading branch information
WrathChaos committed Aug 22, 2020
1 parent 9e0b44a commit f501611
Show file tree
Hide file tree
Showing 14 changed files with 184 additions and 274 deletions.
78 changes: 35 additions & 43 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,48 +1,26 @@
<img alt="React Native Typescript Library Starter" src="assets/logo.png" width="1050"/>
<img alt="React Native Gorgeous Header" src="assets/logo.png" width="1050"/>

[![Battle Tested ✅](https://img.shields.io/badge/-Battle--Tested%20%E2%9C%85-03666e?style=for-the-badge)](https://github.com/WrathChaos/react-native-typescript-library-starter)
[![Battle Tested ✅](https://img.shields.io/badge/-Battle--Tested%20%E2%9C%85-03666e?style=for-the-badge)](https://github.com/WrathChaos/react-native-gorgeous-header)

[![React Native Typescript Library Starter](https://img.shields.io/badge/-Extremely%20easy%20to%20create%20a%20React%20Native%20Component%20Library%20with%20both%20Stateful%20and%20Functional%20Component%20Examples-orange?style=for-the-badge)](https://github.com/WrathChaos/react-native-typescript-library-starter)
[![React Native Gorgeous Header](https://img.shields.io/badge/-Extremely%20easy%20to%20create%20a%20React%20Native%20Component%20Library%20with%20both%20Stateful%20and%20Functional%20Component%20Examples-orange?style=for-the-badge)](https://github.com/WrathChaos/react-native-gorgeous-header)

[![npm version](https://img.shields.io/npm/v/react-native-typescript-library-starter.svg?style=for-the-badge)](https://www.npmjs.com/package/react-native-typescript-library-starter)
[![npm](https://img.shields.io/npm/dt/react-native-typescript-library-starter.svg?style=for-the-badge)](https://www.npmjs.com/package/react-native-typescript-library-starter)
[![npm version](https://img.shields.io/npm/v/react-native-gorgeous-header.svg?style=for-the-badge)](https://www.npmjs.com/package/react-native-gorgeous-header)
[![npm](https://img.shields.io/npm/dt/react-native-gorgeous-header.svg?style=for-the-badge)](https://www.npmjs.com/package/react-native-gorgeous-header)
![Platform - Android and iOS](https://img.shields.io/badge/platform-Android%20%7C%20iOS-blue.svg?style=for-the-badge)
[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg?style=for-the-badge)](https://opensource.org/licenses/MIT)
[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg?style=for-the-badge)](https://github.com/prettier/prettier)

<p align="center">
<img alt="React Native Typescript Library Starter"
src="assets/Screenshots/typescript.jpg" />
<img alt="React Native Gorgeous Header"
src="assets/Screenshots/React-Native-Gorgeous-Header.png" />
</p>

## Library Usage

- `npm i`
- Delete example folder
- Delete build folder
- Make your own library into the `lib` folder
- Change package.json
- Change README for your own documentation
- `npm run build`

```
> [email protected] build /Users/kuray/Coursion/MyLibraries/ReactNative/react-native-typescript-library-starter
> cd lib && tsc && cp ../package.json ../build/dist/ && Echo Build completed!
Build completed!
```

- Test your build/dist into the new project
- Finally, time to npm publish :)

### Below part is for Documentation ! Remove above Library Usage

# Installation

Add the dependency:

```bash
npm i react-native-typescript-library-starter
npm i react-native-gorgeous-header
```

## Peer Dependencies
Expand All @@ -59,37 +37,51 @@ npm i react-native-typescript-library-starter
## Import

```jsx
import MyComponent from "react-native-typescript-library-starter";
import GorgeousHeader from "react-native-gorgeous-header";
```

## Fundamental Usage

```jsx
<MyComponent />
<GorgeousHeader
menuImageSource={menuImage}
searchImageSource={searchImage}
profileImageSource={{
uri:
"https://images.unsplash.com/photo-1514846226882-28b324ef7f28?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=934&q=80",
}}
/>
```

# Configuration - Props

| Property | Type | Default | Description |
| -------- | :-----: | :-----: | ------------------------------------------------------- |
| outline | boolean | true | make the button outline |
| solid | boolean | false | make the button with a solid background and a shadow |
| gradient | boolean | false | make the button with a gradient background and a shadow |
| width | number | 150 | change the button's width |
## Gorgeous Header Props

| Property | Type | Default | Description |
| ------------------- | :------: | :----------------------------: | ----------------------------------------------------------------------- |
| title | string | Order | change the title |
| subtitle | string | Healthy food can keep you fit. | change the subtitle |
| searchIcon | asset | default | set your own icon for the search one |
| titleTextStyle | style | default | set your own style for title text |
| subtitleTextStyle | style | default | set your own style for subtitle text |
| searchBarStyle | style | default | set your own style for search text input container |
| searchInputStyle | style | default | set your own style for search text input |
| menuImageStyle | style | default | set your own style for hamburger menu image |
| menuImageSource | asset | default | set your own image instead of default hamburger menu image |
| menuImageOnPress | function | undefined | use this to set your own function for pressing the hamburger menu image |
| profileImageStyle | style | default | set your own style for profile image |
| profileImageSource | asset | undefined | use this to set your own image for profile image |
| profileImageOnPress | function | undefined | use this to set your own function for pressing the profile image |

## Future Plans

- [x] ~~LICENSE~~
- [ ] Write an article about the lib on Medium

# Change Log

Change log will be here !

## Author

FreakyCoder, [email protected]

## License

React Native Typescript Library Starter is available under the MIT license. See the LICENSE file for more info.
React Native Gorgeous Header is available under the MIT license. See the LICENSE file for more info.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/Screenshots/typescript.jpg
Binary file not shown.
Binary file modified assets/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 0 additions & 6 deletions example/.prettierrc.js

This file was deleted.

120 changes: 17 additions & 103 deletions example/App.js
Original file line number Diff line number Diff line change
@@ -1,114 +1,28 @@
/**
* Sample React Native App
* https://github.com/facebook/react-native
*
* @format
* @flow strict-local
*/
import React from "react";
import { StatusBar } from "react-native";
import GorgeousHeader from "react-native-gorgeous-header";
import { SafeAreaView } from "react-native-safe-area-context";
// ? Assets
const menuImage = require("./assets/menu.png");
const searchImage = require("./assets/search.png");
const profileImageUri =
"https://images.unsplash.com/photo-1514846226882-28b324ef7f28?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=934&q=80";

import React from 'react';
import {
SafeAreaView,
StyleSheet,
ScrollView,
View,
Text,
StatusBar,
} from 'react-native';

import {
Header,
LearnMoreLinks,
Colors,
DebugInstructions,
ReloadInstructions,
} from 'react-native/Libraries/NewAppScreen';

const App: () => React$Node = () => {
const App = () => {
return (
<>
<StatusBar barStyle="dark-content" />
<SafeAreaView>
<ScrollView
contentInsetAdjustmentBehavior="automatic"
style={styles.scrollView}>
<Header />
{global.HermesInternal == null ? null : (
<View style={styles.engine}>
<Text style={styles.footer}>Engine: Hermes</Text>
</View>
)}
<View style={styles.body}>
<View style={styles.sectionContainer}>
<Text style={styles.sectionTitle}>Step One</Text>
<Text style={styles.sectionDescription}>
Edit <Text style={styles.highlight}>App.js</Text> to change this
screen and then come back to see your edits.
</Text>
</View>
<View style={styles.sectionContainer}>
<Text style={styles.sectionTitle}>See Your Changes</Text>
<Text style={styles.sectionDescription}>
<ReloadInstructions />
</Text>
</View>
<View style={styles.sectionContainer}>
<Text style={styles.sectionTitle}>Debug</Text>
<Text style={styles.sectionDescription}>
<DebugInstructions />
</Text>
</View>
<View style={styles.sectionContainer}>
<Text style={styles.sectionTitle}>Learn More</Text>
<Text style={styles.sectionDescription}>
Read the docs to discover what to do next:
</Text>
</View>
<LearnMoreLinks />
</View>
</ScrollView>
<GorgeousHeader
menuImageSource={menuImage}
searchImageSource={searchImage}
profileImageSource={{
uri: profileImageUri,
}}
/>
</SafeAreaView>
</>
);
};

const styles = StyleSheet.create({
scrollView: {
backgroundColor: Colors.lighter,
},
engine: {
position: 'absolute',
right: 0,
},
body: {
backgroundColor: Colors.white,
},
sectionContainer: {
marginTop: 32,
paddingHorizontal: 24,
},
sectionTitle: {
fontSize: 24,
fontWeight: '600',
color: Colors.black,
},
sectionDescription: {
marginTop: 8,
fontSize: 18,
fontWeight: '400',
color: Colors.dark,
},
highlight: {
fontWeight: '700',
},
footer: {
color: Colors.dark,
fontSize: 12,
fontWeight: '600',
padding: 4,
paddingRight: 12,
textAlign: 'right',
},
});

export default App;
Binary file added example/assets/menu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added example/assets/search.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,8 @@ PODS:
- React-cxxreact (= 0.63.2)
- React-jsi (= 0.63.2)
- React-jsinspector (0.63.2)
- react-native-safe-area-context (3.1.6):
- React
- React-RCTActionSheet (0.63.2):
- React-Core/RCTActionSheetHeaders (= 0.63.2)
- React-RCTAnimation (0.63.2):
Expand Down Expand Up @@ -337,6 +339,7 @@ DEPENDENCIES:
- React-jsi (from `../node_modules/react-native/ReactCommon/jsi`)
- React-jsiexecutor (from `../node_modules/react-native/ReactCommon/jsiexecutor`)
- React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector`)
- react-native-safe-area-context (from `../node_modules/react-native-safe-area-context`)
- React-RCTActionSheet (from `../node_modules/react-native/Libraries/ActionSheetIOS`)
- React-RCTAnimation (from `../node_modules/react-native/Libraries/NativeAnimation`)
- React-RCTBlob (from `../node_modules/react-native/Libraries/Blob`)
Expand Down Expand Up @@ -395,6 +398,8 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/ReactCommon/jsiexecutor"
React-jsinspector:
:path: "../node_modules/react-native/ReactCommon/jsinspector"
react-native-safe-area-context:
:path: "../node_modules/react-native-safe-area-context"
React-RCTActionSheet:
:path: "../node_modules/react-native/Libraries/ActionSheetIOS"
React-RCTAnimation:
Expand Down Expand Up @@ -445,6 +450,7 @@ SPEC CHECKSUMS:
React-jsi: 54245e1d5f4b690dec614a73a3795964eeef13a8
React-jsiexecutor: 8ca588cc921e70590820ce72b8789b02c67cce38
React-jsinspector: b14e62ebe7a66e9231e9581279909f2fc3db6606
react-native-safe-area-context: 1a1fdfdc6f9f5beb55b2f0d10d8cf029efd996f4
React-RCTActionSheet: 910163b6b09685a35c4ebbc52b66d1bfbbe39fc5
React-RCTAnimation: 9a883bbe1e9d2e158d4fb53765ed64c8dc2200c6
React-RCTBlob: 39cf0ece1927996c4466510e25d2105f67010e13
Expand Down
Loading

0 comments on commit f501611

Please sign in to comment.