Skip to content

Commit

Permalink
added blog posts to help
Browse files Browse the repository at this point in the history
  • Loading branch information
p4p1 committed Sep 26, 2021
1 parent 879967e commit 63471fe
Show file tree
Hide file tree
Showing 9 changed files with 54 additions and 35 deletions.
3 changes: 0 additions & 3 deletions app/components/Code.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ export default class Code extends React.Component
}

render() {
console.log(this.props.data);
if (this.props.data === undefined) {
return (<View></View>);
}
Expand Down Expand Up @@ -38,8 +37,6 @@ const styles = StyleSheet.create({
container: {
marginBottom: 10,
marginTop: 10,
marginRight: 10,
marginLeft: 10,
backgroundColor: '#333333',
justifyContent: 'center',
paddingTop: 10,
Expand Down
1 change: 0 additions & 1 deletion app/components/Notif.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ const styles = StyleSheet.create({
marginTop: 10,
},
container: {
flex: 1,
backgroundColor: '#333333',
justifyContent: 'center',
paddingTop: 10,
Expand Down
4 changes: 3 additions & 1 deletion app/navigation/Notif/TopTabBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ const styles = StyleSheet.create({
paddingLeft: 10,
alignItems: 'center',
flexDirection: 'row-reverse',
backgroundColor: '#444333',
position: 'absolute',
top: 0,
zIndex: 1,
},
button_container: {
backgroundColor: '#000',
Expand Down
6 changes: 3 additions & 3 deletions app/screens/Code/FavoritesScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,10 @@ export default class FavoritesScreen extends React.Component
render () {
return (
<View style={styles.container}>
<ScrollView style={{width:'90%', height:'80%' }}
<ScrollView style={{width:'100%', height:'100%' }}
refreshControl={<RefreshControl refreshing={this.state.refreshing}
onRefresh={this.onRefresh}/>}>
<View style={{height: 50}}></View>
{
this.state.data.length == 0 ?
<View>
Expand All @@ -67,6 +68,7 @@ export default class FavoritesScreen extends React.Component
run={() => this.props.navigation.navigate('InspectFavCode', {"data" : codeData})} key={i} />
)
}
<View style={{height: 80}}></View>
</ScrollView>
</View>
);
Expand All @@ -88,8 +90,6 @@ const styles = StyleSheet.create({
backgroundColor: '#444333',
alignItems: 'center',
justifyContent: 'center',
paddingTop: 30,
paddingBottom: 5,
},
save_clip:{
justifyContent: 'center',
Expand Down
9 changes: 5 additions & 4 deletions app/screens/Code/SubmitedScreen.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { Text, RefreshControl, StyleSheet, FlatList, View } from 'react-native';
import { Text, RefreshControl, StyleSheet, FlatList, ScrollView, View } from 'react-native';

import Code from '../../components/Code.js';

Expand Down Expand Up @@ -52,7 +52,6 @@ export default class SubmitedScreen extends React.Component
'authorization': `Bearer ${this.props.token}`
}
}).then((response) => response.json()).then((json) => {
console.log(json);
this.setState({data: [...this.state.data, ...json]});
this.setState({page: current_page});
}).catch((err) => {
Expand All @@ -70,9 +69,11 @@ export default class SubmitedScreen extends React.Component
if (this.state.data.length == 0) {
return (
<View style={styles.container}>
<View>
<ScrollView style={{width:'90%', height:'80%' }}
refreshControl={<RefreshControl refreshing={this.state.refreshing}
onRefresh={this.onRefresh}/>}>
<Text style={styles.header}>Nothing has been shared yet!</Text>
</View>
</ScrollView>
</View>
);
}
Expand Down
2 changes: 1 addition & 1 deletion app/screens/Code/ViewCodeScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ const styles = StyleSheet.create({
mainCont: {
width: '100%',
height: '90%',
paddingTop: 80,
paddingTop: 50,
paddingBottom: 10,
paddingRight: 10,
paddingLeft: 10,
Expand Down
4 changes: 3 additions & 1 deletion app/screens/Notifications/FavoritesScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,10 @@ export default class FavoritesScreen extends React.Component
<Inspect selected={this.state.selected} run={() =>
this.setState({modal: !this.state.modal})} />
</Modal>
<ScrollView style={{width:'90%', height:'80%' }}
<ScrollView style={{width:'100%', height:'80%' }}
refreshControl={<RefreshControl refreshing={this.state.refreshing}
onRefresh={this.onRefresh}/>}>
<View style={{height: 80}}></View>
{
this.state.data.length == 0 ?
<View>
Expand All @@ -95,6 +96,7 @@ export default class FavoritesScreen extends React.Component
info={(data) => this.info(data)} />
)
}
<View style={{height: 80}}></View>
</ScrollView>
</View>
);
Expand Down
45 changes: 26 additions & 19 deletions app/screens/Notifications/NotificationScreen.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { Text, Modal, RefreshControl, StyleSheet, ScrollView, View, Clipboard, TouchableOpacity } from 'react-native';
import { FlatList, Text, Modal, RefreshControl, StyleSheet, ScrollView, View, Clipboard, TouchableOpacity } from 'react-native';
import AsyncStorage from '@react-native-community/async-storage';
import { FontAwesomeIcon } from '@fortawesome/react-native-fontawesome'
import { faCopy } from '@fortawesome/free-solid-svg-icons'
Expand Down Expand Up @@ -136,6 +136,24 @@ export default class HomeScreen extends React.Component
if (this.state.api_id == undefined) {
return (<SplashScreen />);
}
if (this.state.data.length == 0) {
return (
<View style={styles.container}>
<ScrollView style={{width:'90%', height:'80%' }}
refreshControl={<RefreshControl refreshing={this.state.refreshing}
onRefresh={this.onRefresh}/>}>
<View>
<Text style={styles.header}>Waiting for requests on</Text>
<TouchableOpacity style={styles.save_clip}
onPress={() => Clipboard.setString(this.props.url + "api/" + this.state.api_id)}>
<Text style={styles.para}>{this.props.url}api/{this.state.api_id}</Text>
<FontAwesomeIcon size={20} color={'#aaaaaa'} icon={ faCopy } />
</TouchableOpacity>
</View>
</ScrollView>
</View>
);
}
return (
<View style={styles.container}>
<Modal animationType={"slide"} transparent={true}
Expand All @@ -144,28 +162,17 @@ export default class HomeScreen extends React.Component
<Inspect selected={this.state.selected} run={() =>
this.setState({modal: !this.state.modal})} />
</Modal>
<ScrollView style={{width:'90%', height:'80%' }}
<FlatList style={{width:'100%', height:'100%' }}
refreshControl={<RefreshControl refreshing={this.state.refreshing}
onRefresh={this.onRefresh}/>}>
{
this.state.data.length == 0 ?
<View>
<Text style={styles.header}>Waiting for requests on</Text>
<TouchableOpacity style={styles.save_clip}
onPress={() => Clipboard.setString(this.props.url + "api/" + this.state.api_id)}>
<Text style={styles.para}>{this.props.url}api/{this.state.api_id}</Text>
<FontAwesomeIcon size={20} color={'#aaaaaa'} icon={ faCopy } />
</TouchableOpacity>
</View>
:
this.state.data.map(
(notifData,i) => <Notif data={notifData} key={i}
onRefresh={this.onRefresh}/>} keyExtractor={item => item._id} data={this.state.data}
renderItem={({item}) => (
<Notif data={item}
delete={(data) => this.remove(data)}
save={(data) => this.save(data)}
info={(data) => this.info(data)} />
)
}
</ScrollView>
)} onEndReached={this.loadMore} onEndReachedThreshold={0.5} initialNumToRender={10}
ListFooterComponent={<View style={{height:80}}></View>}
ListHeaderComponent={<View style={{height:70}}></View>} />
</View>
);
}
Expand Down
15 changes: 13 additions & 2 deletions app/screens/User/HelpScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ const apiDocURL = "https://documenter.getpostman.com/view/10616927/Tz5p6y9A";
const trelloURL= "https://github.com/p4p1/xss_bomb/projects";
const playURL = "https://play.google.com/store/apps/details?id=com.p4p1.xss_bomb";
const meURL = "https://leosmith.xyz";
const blogPost1 = "https://leosmith.xyz/blog/xss-bomb.html";
const blogPost2 = "https://leosmith.xyz/blog/xss-bomb-devlog1.html";

const version = "V0.1.2";

Expand Down Expand Up @@ -108,14 +110,23 @@ export default class HelpScreen extends React.Component
<Text style={styles.header}>Who built this?</Text>
<Text style={styles.para}>
This app was built by me (p4p1) over on github and is provided for free
there if you wish to support me this app will probably be on the store for
$2 ish.
there if you wish to support me this app is on the play store:
</Text>
<Button title={"About author"} onPress={() => this.openURL(meURL)}/>
<View style={styles.padding}></View>
<Button title={"Support me (Google Play)"} onPress={() =>
this.openURL(playURL)} color={'#2CAA4C'}/>
<View style={styles.padding}></View>
<Text style={styles.para}>
This app also has a few blog posts provided on the author's website
kind of like a devlog here are the posts:
</Text>
<Button title={"General architecture of the app"} onPress={() =>
this.openURL(blogPost1)} color={'#9315b7'}/>
<View style={styles.padding}></View>
<Button title={"The social network update"} onPress={() =>
this.openURL(blogPost2)} color={'#9315b7'}/>
<View style={styles.padding}></View>
<Text style={styles.header}>Is this open source?</Text>
<Text style={styles.para}>
Yes this app is open source and you can contribute over on github.
Expand Down

0 comments on commit 63471fe

Please sign in to comment.