-
Notifications
You must be signed in to change notification settings - Fork 38
Ootb views demo omni #666
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
evantk91
wants to merge
13
commits into
evan/feature/embedded
Choose a base branch
from
ootb-views-demo-omni
base: evan/feature/embedded
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Ootb views demo omni #666
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
bce9f1f
CardView basic layout added
vishal753 7c96427
CardView Added
vishal753 98a39ea
Merge branch 'master' into MB_CardView
devcsomnicg 804ce96
Added Banner View
vishal753 4c0290e
Added Notification View
vishal753 ffc33de
Card View Sample code updated
vishal753 26d7b7b
Merge pull request #507 from devcsomnicg/MB_NotificationView
evantk91 59e5755
Merge branch 'master' into MB_CardView
hani-iterable 94bfd5f
Merge branch 'ootb-views' into MB_BannerView
hani-iterable 048679b
Merge pull request #506 from devcsomnicg/MB_BannerView
evantk91 f5a9bc6
Merge pull request #505 from devcsomnicg/MB_CardView
evantk91 becd6f2
stashed changes
b1ded0b
Merge branch 'card_view' into ootb-views
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 BannerViewScreenProps = { | ||
route: RouteProp<any, 'BannerView'>; | ||
navigation: StackNavigationProp<any>; | ||
}; | ||
export default class BannerViewScreen extends Component<BannerViewScreenProps> { | ||
constructor(props: BannerViewScreenProps); | ||
render(): JSX.Element; | ||
} | ||
export {}; |
This file contains hidden or 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,26 @@ | ||
import React, { Component } from 'react'; | ||
import { View } from 'react-native'; | ||
import IterableBannerView from './components/IterableBannerView'; | ||
|
||
export default class BannerViewScreen extends Component { | ||
constructor(props) { | ||
super(props); | ||
} | ||
|
||
render() { | ||
return <View style={{ flex: 1, padding: 10 }}> | ||
<IterableBannerView | ||
titleText='Banner View 1' | ||
subTitleText='Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum' | ||
imgSrc='https://codesymphony.in/assets/technology/home-page/Serverless.png' | ||
btnPrimaryText={'Try Premium'} | ||
/> | ||
<IterableBannerView | ||
titleText='Banner View 2' | ||
subTitleText='Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum 2233' | ||
imgSrc='https://codesymphony.in/assets/technology/home-page/Selenium.png' | ||
isShowbtnSecondary={true} | ||
/> | ||
</View> | ||
} | ||
} |
This file contains hidden or 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 CardViewScreenProps = { | ||
route: RouteProp<any>; | ||
navigation: StackNavigationProp<any>; | ||
}; | ||
export default class CardViewScreen extends Component<CardViewScreenProps> { | ||
constructor(props: CardViewScreenProps); | ||
render(): JSX.Element; | ||
} | ||
export {}; |
This file contains hidden or 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,25 @@ | ||
import React, { Component } from 'react'; | ||
import { View } from 'react-native'; | ||
import IterableCardView from './components/IterableCardView'; | ||
|
||
export default class CardViewScreen extends Component { | ||
constructor(props) { | ||
super(props); | ||
} | ||
|
||
render() { | ||
return <View style={{ flex: 1, padding: 10 }}> | ||
<IterableCardView | ||
titleText='Card View 1' | ||
subTitleText='Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum' | ||
isShowbtnSecondary={true} | ||
/> | ||
<IterableCardView | ||
titleText='Card View 2' | ||
subTitleText='Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum 2233' | ||
imgSrc='https://codesymphony.in/assets/projects/sonetel/Sonetel%205.png' | ||
isShowbtnSecondary={true} | ||
/> | ||
</View> | ||
} | ||
} |
This file contains hidden or 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 hidden or 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 |
---|---|---|
@@ -1,17 +1,38 @@ | ||
import React, { Component } from 'react'; | ||
import { View, } from 'react-native'; | ||
import { ListItem } from 'react-native-elements'; | ||
import { coffees } from './Data'; | ||
import { TouchableOpacity, View, Text } from 'react-native'; | ||
|
||
export default class HomeScreen extends Component { | ||
constructor(props) { | ||
super(props); | ||
} | ||
navigate(coffee) { | ||
this.props.navigation.navigate('Detail', { coffee: coffee }); | ||
navigateToCardView() { | ||
console.log("Card View"); | ||
this.props.navigation.navigate('CardView'); | ||
} | ||
|
||
navigateToBannerView() { | ||
console.log("Banner View"); | ||
this.props.navigation.navigate('BannerView'); | ||
} | ||
|
||
navigateToNotificationView() { | ||
console.log("Notification View"); | ||
this.props.navigation.navigate('NotificationView'); | ||
} | ||
|
||
render() { | ||
return (React.createElement(View, null, coffees.map((coffee, i) => (React.createElement(ListItem, { onPress: () => { | ||
this.props.navigation.navigate('Detail', { coffee: coffee }); | ||
}, key: i, leftAvatar: { source: coffee.icon }, title: coffee.name, subtitle: coffee.subtitle, bottomDivider: true, chevron: true }))))); | ||
return <View style={{ flex: 1, padding: 10 }}> | ||
<TouchableOpacity style={{ padding: 10, width: '100%', justifyContent: 'center' }} onPress={() => this.navigateToCardView()}> | ||
<Text style={{ textAlign: 'center', color: 'blue', fontSize: 16 }}>{"Card View Demo"}</Text> | ||
</TouchableOpacity> | ||
|
||
<TouchableOpacity style={{ padding: 10, width: '100%', justifyContent: 'center' }} onPress={() => this.navigateToNotificationView()}> | ||
<Text style={{ textAlign: 'center', color: 'blue', fontSize: 16 }}>{"Notification View Demo"}</Text> | ||
</TouchableOpacity> | ||
|
||
<TouchableOpacity style={{ padding: 10, width: '100%', justifyContent: 'center' }} onPress={() => this.navigateToBannerView()}> | ||
<Text style={{ textAlign: 'center', color: 'blue', fontSize: 16 }}>{"Banner View Demo"}</Text> | ||
</TouchableOpacity> | ||
</View> | ||
} | ||
} | ||
} |
This file contains hidden or 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 hidden or 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 hidden or 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> | ||
} | ||
} |
This file contains hidden or 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,76 @@ | ||
// @ts-nocheck | ||
import React from 'react' | ||
import { | ||
View, | ||
Text, | ||
Image, | ||
TouchableOpacity | ||
} from 'react-native' | ||
import { | ||
containerProps, | ||
imageProps, | ||
titleLabelProps, | ||
subTitleLabelProps, | ||
btnPrimaryProps, | ||
btnSecondaryProps | ||
} from '../types/commonType'; | ||
|
||
type bannerViewProps = containerProps & imageProps & titleLabelProps & subTitleLabelProps & btnPrimaryProps & btnSecondaryProps | ||
|
||
const IterableBannerView = (props: bannerViewProps) => { | ||
|
||
const imgURI = props?.imgSrc ? props.imgSrc : 'https://codesymphony.in/assets/projects/noobstrom/noob-web-4.png'; | ||
const bannerBorderRadius = props.borderRadius ? props.borderRadius : 10; | ||
|
||
return ( | ||
<View style={{ | ||
marginBottom: 20, | ||
borderRadius: bannerBorderRadius, | ||
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 }}> | ||
<View style={{ flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', marginTop: 10 }}> | ||
<Text style={{ fontSize: props?.titleFontSize ? props?.titleFontSize : 18, color: props?.titleTextColor ? props?.titleTextColor : 'black', marginVertical: 10, fontWeight: '700' }}> | ||
{props?.titleText ? props?.titleText : 'Banner View Title'} | ||
</Text> | ||
<View style={{ height: 50, width: 50 }}> | ||
<Image source={{ uri: imgURI }} style={{ height: props?.imgHeight ? props?.imgHeight : '100%', width: props?.imgWidth ? props?.imgWidth : '100%' }} /> | ||
</View> | ||
</View> | ||
<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> | ||
) | ||
} | ||
|
||
Comment on lines
+1
to
+75
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
export default IterableBannerView |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function with high complexity (count = 56): IterableBannerView [qlty:function-complexity]