Skip to content

Commit 1dc3535

Browse files
committed
first commit
0 parents  commit 1dc3535

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+16591
-0
lines changed

.bundle/config

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
BUNDLE_PATH: "vendor/bundle"
2+
BUNDLE_FORCE_RUBY_PLATFORM: 1

.eslintrc.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
root: true,
3+
extends: '@react-native',
4+
};

.gitignore

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# OSX
2+
#
3+
.DS_Store
4+
5+
# Xcode
6+
#
7+
build/
8+
*.pbxuser
9+
!default.pbxuser
10+
*.mode1v3
11+
!default.mode1v3
12+
*.mode2v3
13+
!default.mode2v3
14+
*.perspectivev3
15+
!default.perspectivev3
16+
xcuserdata
17+
*.xccheckout
18+
*.moved-aside
19+
DerivedData
20+
*.hmap
21+
*.ipa
22+
*.xcuserstate
23+
ios/.xcode.env.local
24+
25+
# Android/IntelliJ
26+
#
27+
build/
28+
.idea
29+
.gradle
30+
local.properties
31+
*.iml
32+
*.hprof
33+
.cxx/
34+
*.keystore
35+
!debug.keystore
36+
37+
# node.js
38+
#
39+
node_modules/
40+
npm-debug.log
41+
yarn-error.log
42+
43+
# fastlane
44+
#
45+
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
46+
# screenshots whenever they are needed.
47+
# For more information about the recommended setup visit:
48+
# https://docs.fastlane.tools/best-practices/source-control/
49+
50+
**/fastlane/report.xml
51+
**/fastlane/Preview.html
52+
**/fastlane/screenshots
53+
**/fastlane/test_output
54+
55+
# Bundle artifact
56+
*.jsbundle
57+
58+
# Ruby / CocoaPods
59+
/ios/Pods/
60+
/vendor/bundle/
61+
62+
# Temporary files created by Metro to check the health of the file watcher
63+
.metro-health-check*
64+
65+
# testing
66+
/coverage

.prettierrc.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
arrowParens: 'avoid',
3+
bracketSameLine: true,
4+
bracketSpacing: false,
5+
singleQuote: true,
6+
trailingComma: 'all',
7+
};

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"java.compile.nullAnalysis.mode": "automatic"
3+
}

.watchmanconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

App.tsx

Lines changed: 206 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,206 @@
1+
import React, { isValidElement, useEffect, useState } from 'react';
2+
import tw from 'twrnc';
3+
import {
4+
SafeAreaView,
5+
ScrollView,
6+
StatusBar,
7+
StyleSheet,
8+
Text,
9+
View,
10+
TextInput,
11+
TouchableOpacity,
12+
Button,
13+
Dimensions
14+
} from 'react-native';
15+
import {
16+
responsiveHeight,
17+
responsiveWidth,
18+
responsiveFontSize
19+
} from "react-native-responsive-dimensions";
20+
import { object, string, number} from 'yup';
21+
import { Formik } from 'formik';
22+
import BouncyCheckbox from 'react-native-bouncy-checkbox';
23+
let passwordSchema = object({
24+
length: number().min(4,"Length should be min 4 characters")
25+
.max(16,"Length should be max of 16 characters")
26+
.required("Length is Required"),
27+
28+
});
29+
const App = () =>{
30+
const [password,setPassword] = useState('');
31+
const [ispasswordg,setIspasswordg] = useState<boolean>(false);
32+
const [lower,setLower] = useState<boolean>(true);
33+
const [upper,setUpper] = useState<boolean>(false);
34+
const [numbers,setNumbers] = useState<boolean>(false);
35+
const [symbols,setSymbol] = useState<boolean>(false);
36+
const [Height,setHeight] = useState<number | string>();
37+
const [Width,setWidth] = useState<number| string>();
38+
const generateCharacter = (length:number)=>{
39+
let character:string = "";
40+
const uppercase = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
41+
const lowercase = "abcdefghijklmnopqrstuvwxyz";
42+
const number = "0123456789";
43+
const symbol = '!@#$%^&*()_+';
44+
if(upper){
45+
character += uppercase ;
46+
}
47+
if(lower){
48+
character += lowercase ;
49+
}
50+
if(numbers){
51+
character += number ;
52+
}
53+
if(symbols){
54+
character += symbol ;
55+
}
56+
const passwordResult = CreatePassword(length,character);
57+
setPassword(passwordResult);
58+
setIspasswordg(true);
59+
}
60+
61+
const CreatePassword = (length:number,character:String)=>{
62+
let result = '';
63+
for(let i=0;i<length;i++){
64+
const characterIndex = Math.round(Math.random() * character.length);
65+
result += character.charAt(characterIndex);
66+
}
67+
return result;
68+
}
69+
70+
const Reset =()=>{
71+
setPassword('');
72+
setLower(true);
73+
setIspasswordg(false);
74+
setUpper(false);
75+
setSymbol(false);
76+
setNumbers(false);
77+
78+
}
79+
useEffect(()=>{
80+
setHeight(Dimensions.get('window').height);
81+
setWidth(Dimensions.get('window').width);
82+
},[]);
83+
console.log(Height);
84+
console.log(Width);
85+
86+
return(
87+
<ScrollView keyboardShouldPersistTaps='handled'>
88+
<SafeAreaView >
89+
<View style={tw`pr-4 pl-4 flex gap-2`}>
90+
<View style={tw`flex items-center`}>
91+
<Text style={tw`text-red-600 text-${responsiveFontSize(.9)} font-bold mt-2 mb-2`}>🔑Password Generator🔑</Text>
92+
</View>
93+
<Formik
94+
initialValues={{length:'' }}
95+
validationSchema={passwordSchema}
96+
onSubmit={values =>{
97+
generateCharacter(+values.length);
98+
}}>
99+
{({
100+
values,
101+
errors,
102+
touched,
103+
isValid,
104+
handleChange,
105+
handleSubmit,
106+
handleReset
107+
}) => (
108+
<>
109+
<View style={tw`flex flex-row items-center justify-between`}>
110+
<Text style={tw`text-xl`}>Password Length</Text>
111+
<TextInput
112+
value={values.length}
113+
keyboardType='numeric'
114+
onChangeText={handleChange('length')} style={tw`border text-xl rounded-md w-20`} placeholder='Ex:10'/>
115+
</View>
116+
<View style={tw`h-5`}>
117+
{touched.length && errors.length && (
118+
<Text style={tw`text-[#e80202]`}>{errors.length}</Text>
119+
)}
120+
</View>
121+
<View style={tw`flex flex-row items-center justify-between`}>
122+
<Text>Include Lowercase</Text>
123+
<BouncyCheckbox
124+
disableBuiltInState
125+
isChecked={lower}
126+
onPress={()=>setLower(!lower)}
127+
fillColor='#238636'
128+
/>
129+
</View>
130+
<View style={tw`flex flex-row items-center justify-between`}>
131+
<Text>Include Uppercase</Text>
132+
<BouncyCheckbox
133+
disableBuiltInState
134+
isChecked={upper}
135+
onPress={()=>setUpper(!upper)}
136+
fillColor='#238636'
137+
/>
138+
</View>
139+
<View style={tw`flex flex-row items-center justify-between`}>
140+
<Text>Include Number</Text>
141+
<BouncyCheckbox
142+
disableBuiltInState
143+
isChecked={numbers}
144+
onPress={()=>setNumbers(!numbers)}
145+
fillColor='#238636'
146+
/>
147+
</View>
148+
<View style={tw`flex flex-row items-center justify-between`}>
149+
<Text>Include Symbol</Text>
150+
<BouncyCheckbox
151+
disableBuiltInState
152+
isChecked={symbols}
153+
onPress={()=>setSymbol(!symbols)}
154+
fillColor='#238636'
155+
/>
156+
</View>
157+
<View style={tw`flex flex-row justify-center mt-4 gap-2`}>
158+
<TouchableOpacity disabled={!isValid} onPress={handleSubmit}>
159+
<View style={tw`bg-[#06c22b] rounded-md p-5`}>
160+
<Text style={tw`text-white font-bold text-xl`}>Generate Password</Text>
161+
</View>
162+
</TouchableOpacity>
163+
<TouchableOpacity onPress={handleReset}>
164+
<View style={tw`bg-[#e80202] rounded-md p-5`}>
165+
<Text style={tw`text-white font-bold text-xl`}>Reset</Text>
166+
</View>
167+
</TouchableOpacity>
168+
</View>
169+
</>
170+
)}
171+
</Formik>
172+
</View>
173+
{ispasswordg?(
174+
<View style={tw`flex items-center mt-10 bg-[#121212] mr-4 ml-4 p-5`}>
175+
<Text style={tw`text-2xl text-white`} selectable>{password}</Text>
176+
</View>
177+
):null}
178+
179+
{ispasswordg?(
180+
<View style={[tw` flex justify-end items-center`,Style.div1]}>
181+
<Text style={tw`text-black text-xl font-bold`}>
182+
Made with ❤️ By Pritam Joardar
183+
</Text>
184+
</View>
185+
):(
186+
<View style={[tw` flex justify-end items-center`,Style.div]}>
187+
<Text style={tw`text-black text-xl font-bold`}>
188+
Made with ❤️ By Pritam Joardar
189+
</Text>
190+
</View>
191+
)}
192+
193+
</SafeAreaView>
194+
</ScrollView>
195+
)
196+
}
197+
198+
const Style = StyleSheet.create({
199+
div:{
200+
height:responsiveHeight(49),
201+
},
202+
div1:{
203+
height:responsiveHeight(35),
204+
}
205+
})
206+
export default App;

Gemfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
source 'https://rubygems.org'
2+
3+
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
4+
ruby ">= 2.6.10"
5+
6+
# Cocoapods 1.15 introduced a bug which break the build. We will remove the upper
7+
# bound in the template on Cocoapods with next React Native release.
8+
gem 'cocoapods', '>= 1.13', '< 1.15'
9+
gem 'activesupport', '>= 6.1.7.5', '< 7.1.0'

README.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
This is a new [**React Native**](https://reactnative.dev) project, bootstrapped using [`@react-native-community/cli`](https://github.com/react-native-community/cli).
2+
3+
# Getting Started
4+
5+
>**Note**: Make sure you have completed the [React Native - Environment Setup](https://reactnative.dev/docs/environment-setup) instructions till "Creating a new application" step, before proceeding.
6+
7+
## Step 1: Start the Metro Server
8+
9+
First, you will need to start **Metro**, the JavaScript _bundler_ that ships _with_ React Native.
10+
11+
To start Metro, run the following command from the _root_ of your React Native project:
12+
13+
```bash
14+
# using npm
15+
npm start
16+
17+
# OR using Yarn
18+
yarn start
19+
```
20+
21+
## Step 2: Start your Application
22+
23+
Let Metro Bundler run in its _own_ terminal. Open a _new_ terminal from the _root_ of your React Native project. Run the following command to start your _Android_ or _iOS_ app:
24+
25+
### For Android
26+
27+
```bash
28+
# using npm
29+
npm run android
30+
31+
# OR using Yarn
32+
yarn android
33+
```
34+
35+
### For iOS
36+
37+
```bash
38+
# using npm
39+
npm run ios
40+
41+
# OR using Yarn
42+
yarn ios
43+
```
44+
45+
If everything is set up _correctly_, you should see your new app running in your _Android Emulator_ or _iOS Simulator_ shortly provided you have set up your emulator/simulator correctly.
46+
47+
This is one way to run your app — you can also run it directly from within Android Studio and Xcode respectively.
48+
49+
## Step 3: Modifying your App
50+
51+
Now that you have successfully run the app, let's modify it.
52+
53+
1. Open `App.tsx` in your text editor of choice and edit some lines.
54+
2. For **Android**: Press the <kbd>R</kbd> key twice or select **"Reload"** from the **Developer Menu** (<kbd>Ctrl</kbd> + <kbd>M</kbd> (on Window and Linux) or <kbd>Cmd ⌘</kbd> + <kbd>M</kbd> (on macOS)) to see your changes!
55+
56+
For **iOS**: Hit <kbd>Cmd ⌘</kbd> + <kbd>R</kbd> in your iOS Simulator to reload the app and see your changes!
57+
58+
## Congratulations! :tada:
59+
60+
You've successfully run and modified your React Native App. :partying_face:
61+
62+
### Now what?
63+
64+
- If you want to add this new React Native code to an existing application, check out the [Integration guide](https://reactnative.dev/docs/integration-with-existing-apps).
65+
- If you're curious to learn more about React Native, check out the [Introduction to React Native](https://reactnative.dev/docs/getting-started).
66+
67+
# Troubleshooting
68+
69+
If you can't get this to work, see the [Troubleshooting](https://reactnative.dev/docs/troubleshooting) page.
70+
71+
# Learn More
72+
73+
To learn more about React Native, take a look at the following resources:
74+
75+
- [React Native Website](https://reactnative.dev) - learn more about React Native.
76+
- [Getting Started](https://reactnative.dev/docs/environment-setup) - an **overview** of React Native and how setup your environment.
77+
- [Learn the Basics](https://reactnative.dev/docs/getting-started) - a **guided tour** of the React Native **basics**.
78+
- [Blog](https://reactnative.dev/blog) - read the latest official React Native **Blog** posts.
79+
- [`@facebook/react-native`](https://github.com/facebook/react-native) - the Open Source; GitHub **repository** for React Native.

0 commit comments

Comments
 (0)