-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'ootb-views' into MB_BannerView
- Loading branch information
Showing
25 changed files
with
1,604 additions
and
1,083 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { Component } from 'react'; | ||
import { RouteProp } from '@react-navigation/native'; | ||
import { StackNavigationProp } from '@react-navigation/stack'; | ||
|
||
declare type NotificationViewScreenProps = { | ||
route: RouteProp<any, 'NotificationView'>; | ||
navigation: StackNavigationProp<any>; | ||
}; | ||
export default class NotificationViewScreen extends Component<NotificationViewScreenProps> { | ||
constructor(props: NotificationViewScreenProps); | ||
render(): JSX.Element; | ||
} | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import React, { Component } from 'react'; | ||
import { View } from 'react-native'; | ||
import IterableNotificationView from './components/IterableNotificationView'; | ||
|
||
export default class BannerViewScreen extends Component { | ||
constructor(props) { | ||
super(props); | ||
} | ||
|
||
render() { | ||
return <View style={{ flex: 1, padding: 10 }}> | ||
<IterableNotificationView | ||
titleText='Turn on notifications' | ||
titleTextColor='#2489A9' | ||
subTitleText='Get updates on scheduled and trending classes.' | ||
subTitleTextColor='#2489A9' | ||
btnPrimaryText={'Turn on'} | ||
btnPrimaryBgColor={'white'} | ||
btnPrimaryTextColor={'#2489A9'} | ||
backgroundColor={'#C2F0FC'} | ||
/> | ||
<IterableNotificationView | ||
titleText='Turn on notifications 2' | ||
subTitleText='Get updates on scheduled and trending classes.' | ||
titleTextColor='#2489A9' | ||
isShowbtnSecondary={true} | ||
subTitleTextColor='#2489A9' | ||
btnPrimaryText={'Turn on'} | ||
btnPrimaryBgColor={'white'} | ||
btnPrimaryTextColor={'#2489A9'} | ||
backgroundColor={'#C2F0FC'} | ||
btnSecondaryText={'Not now'} | ||
btnSecondaryTextColor={'#2489A9'} | ||
/> | ||
</View> | ||
} | ||
} |
68 changes: 68 additions & 0 deletions
68
SampleApp/javascript/js/components/IterableNotificationView.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
// @ts-nocheck | ||
import React from 'react' | ||
import { | ||
View, | ||
Text, | ||
TouchableOpacity | ||
} from 'react-native' | ||
import { | ||
containerProps, | ||
imageProps, | ||
titleLabelProps, | ||
subTitleLabelProps, | ||
btnPrimaryProps, | ||
btnSecondaryProps | ||
} from '../types/commonType'; | ||
|
||
type notificationViewProps = containerProps & imageProps & titleLabelProps & subTitleLabelProps & btnPrimaryProps & btnSecondaryProps | ||
|
||
const IterableNotificationView = (props: notificationViewProps) => { | ||
const notificationBorderRadius = props.borderRadius ? props.borderRadius : 10; | ||
|
||
return ( | ||
<View style={{ | ||
marginBottom: 20, | ||
borderRadius: notificationBorderRadius, | ||
backgroundColor: props?.backgroundColor ? props?.backgroundColor : '#E4E4E4', | ||
shadowColor: props?.shadowColor ? props?.shadowColor : '#470000', | ||
shadowOffset: { | ||
width: props?.shadowWidth ? props?.shadowWidth : 0, | ||
height: props?.shadowHeight ? props?.shadowHeight : 1 | ||
}, | ||
shadowOpacity: props?.shadowOpacity ? props?.shadowOpacity : 0.2, | ||
elevation: 1 | ||
}}> | ||
<View style={{ paddingHorizontal: 10 }}> | ||
<Text style={{ fontSize: props?.titleFontSize ? props?.titleFontSize : 18, color: props?.titleTextColor ? props?.titleTextColor : 'black', marginVertical: 10, fontWeight: '700' }}> | ||
{props?.titleText ? props?.titleText : 'Notification View Title'} | ||
</Text> | ||
<Text style={{ fontSize: props?.subTitleFontSize ? props?.subTitleFontSize : 16, color: props?.subTitleTextColor ? props?.subTitleTextColor : 'black', marginVertical: 6 }}> | ||
{props?.subTitleText ? props?.subTitleText : "Lorem ipsum dummy text, Lorem ipsum dummy text, Lorem ipsum dummy text, Lorem ipsum dummy text"} | ||
</Text> | ||
<View style={{ flexDirection: 'row', alignItems: 'center', marginVertical: 18 }}> | ||
<TouchableOpacity onPress={() => props?.btnPrimaryOnClick ? props?.btnPrimaryOnClick() : null} | ||
style={{ height: 35, paddingHorizontal: 10, borderRadius: 25, justifyContent: 'center', alignItems: 'center', backgroundColor: props?.btnPrimaryBgColor ? props?.btnPrimaryBgColor : '#6A266D' }}> | ||
<Text style={{ | ||
fontSize: props?.btnPrimaryFontSize ? props?.btnPrimaryFontSize : 14, | ||
color: props?.btnPrimaryTextColor ? props?.btnPrimaryTextColor : 'white', | ||
fontWeight: 'bold' | ||
}}> | ||
{props?.btnPrimaryText ? props.btnPrimaryText : "Learn more"} | ||
</Text> | ||
</TouchableOpacity> | ||
{props?.isShowbtnSecondary ? <TouchableOpacity onPress={() => props?.btnSecondaryOnClick ? props?.btnSecondaryOnClick() : null} style={{ justifyContent: 'center', alignItems: 'center', marginLeft: 20 }}> | ||
<Text style={{ | ||
fontSize: props?.btnSecondaryFontSize ? props?.btnSecondaryFontSize : 14, | ||
color: props?.btnSecondaryTextColor ? props?.btnSecondaryTextColor : 'black', | ||
fontWeight: 'bold' | ||
}}> | ||
{props?.btnSecondaryText ? props?.btnSecondaryText : "action"} | ||
</Text> | ||
</TouchableOpacity> : null} | ||
</View> | ||
</View> | ||
</View> | ||
) | ||
} | ||
|
||
export default IterableNotificationView |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.