Skip to content

Instantly share code, notes, and snippets.

@SharePerson
SharePerson / ApplicationTypeModel.cs
Created January 24, 2020 23:16
ApplicationTypeModel
public class ApplicationTypeModel
{
public int Id { set; get; }
public string ApplicationName { set; get; }
}
@SharePerson
SharePerson / select.html
Created January 24, 2020 23:14
Select HTML
<select id="ApplicationType" name="ApplicationType">
<option value=""> - Select Type - </option>
<option value="0">Forum</option>
<option value="1">Weblog</option>
<option value="2">Gallery</option>
<option value="3">GuestBook</option>
</select>
@SharePerson
SharePerson / Outsideclick.js
Created January 21, 2020 07:57
On outside click
outsideClick={() => {
if(closeOnClickOutside) {
this.setState({ modalVisible: false });
}
}}
@SharePerson
SharePerson / BasicScreen.js
Created January 20, 2020 23:14
CustomModal inside BasicScreen
<CustomModal
animation="slide"
visible={this.state.modalVisible}
mode="overFullScreen"
boxBackgroundColor="lightyellow"
transparentContainer={transparent}
bottomHalf={bottomHalf}
outsideClick={() => {
if(closeOnClickOutside) {
this.setState({ modalVisible: false });
@SharePerson
SharePerson / NavigationParamaters.js
Created January 20, 2020 23:02
Custom Modal properties from navigation parameters
const { navigation } = this.props;
const transparent = navigation.getParam('transparent', false);
const bottomHalf = navigation.getParam('bottomHalf', false);
const closeOnClickOutside = navigation.getParam('closeOnClickOutside', false);
@SharePerson
SharePerson / StyleSheetFactory.js
Created January 20, 2020 22:18
StyleSheetFactory internal class
class StyleSheetFactory {
static getSheet({
boxBgColor,
fullscreen,
bottomHalf,
modalHeight
}) {
const styles = StyleSheet.create({
mainContainer: { flex: 1 },
modalWrapper: {
@SharePerson
SharePerson / CustomModalExample.js
Created January 20, 2020 22:11
CustomModal children
<CustomModal>
<Text>I'm inside the modal!</Text>
</CustomModal>
@SharePerson
SharePerson / CustomModalRender.js
Created January 20, 2020 22:04
CustomModal render() function
render() {
const modalHeight = this.props.bottomHalf? this.height / 2: this.height;
const styles = StyleSheetFactory.getSheet({
boxBgColor: this.props.boxBackgroundColor,
fullscreen: this.props.fullscreen,
modalHeight: modalHeight,
bottomHalf: this.props.bottomHalf
});
return (
<Modal
@SharePerson
SharePerson / CustomModalImports.js
Last active May 21, 2020 21:19
CustomModal Imports
import React, { Component } from 'react';
import {
View,
Modal,
StyleSheet,
Dimensions,
TouchableWithoutFeedback
} from 'react-native';