-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9b61716
commit 1f4a6f4
Showing
4 changed files
with
120 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import * as React from 'react'; | ||
|
||
import { Alert, StyleSheet, View } from 'react-native'; | ||
import { | ||
Chip, HStack, Icon, Text, VStack | ||
} from '@amalgama/embassy-ui'; | ||
import MaterialCommunityIcon from 'react-native-vector-icons/MaterialCommunityIcons'; | ||
|
||
const styles = StyleSheet.create( { | ||
container: { | ||
marginBottom: 20 | ||
}, | ||
separator: { | ||
height: 1, | ||
minWidth: '100%', | ||
marginTop: 2, | ||
marginBottom: 6, | ||
backgroundColor: 'black' | ||
}, | ||
vspace: { | ||
height: 10, | ||
minWidth: '100%' | ||
} | ||
} ); | ||
|
||
const onChipPressed = () => Alert.alert( 'Pressed!' ); | ||
const onDeletePressed = () => Alert.alert( 'Delete pressed!' ); | ||
|
||
const ChipExamples = () => ( | ||
<VStack style={styles.container} space="2"> | ||
<Text variant="headline">Chip Component</Text> | ||
<View style={styles.vspace} /> | ||
<HStack space="2" width="100%" flexWrap="wrap"> | ||
<Chip label="Label" onPress={onChipPressed} /> | ||
<Chip label="Selected" onPress={onChipPressed} selected /> | ||
<Chip label="Disabled" onPress={onChipPressed} disabled /> | ||
</HStack> | ||
<HStack space="2" width="100%" flexWrap="wrap"> | ||
<Chip | ||
icon={<Icon name="lightning-bolt-outline" as={MaterialCommunityIcon} />} | ||
label="Left Icon" | ||
/> | ||
<Chip | ||
label="Delete Icon" | ||
onDeletePress={onDeletePressed} | ||
/> | ||
</HStack> | ||
<HStack space="2" width="100%" flexWrap="wrap"> | ||
<Chip | ||
label="Custom Delete Icon" | ||
deleteIcon={<Icon name="close-circle-outline" as={MaterialCommunityIcon} />} | ||
onDeletePress={onDeletePressed} | ||
/> | ||
</HStack> | ||
</VStack> | ||
); | ||
|
||
export default ChipExamples; |
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,58 @@ | ||
import * as React from 'react'; | ||
|
||
import { Alert, StyleSheet, View } from 'react-native'; | ||
import { | ||
Chip, HStack, Icon, Text, VStack | ||
} from '@amalgama/embassy-ui'; | ||
import MaterialCommunityIcon from 'react-native-vector-icons/MaterialCommunityIcons'; | ||
|
||
const styles = StyleSheet.create( { | ||
container: { | ||
marginBottom: 20 | ||
}, | ||
separator: { | ||
height: 1, | ||
minWidth: '100%', | ||
marginTop: 2, | ||
marginBottom: 6, | ||
backgroundColor: 'black' | ||
}, | ||
vspace: { | ||
height: 10, | ||
minWidth: '100%' | ||
} | ||
} ); | ||
|
||
const onChipPressed = () => Alert.alert( 'Pressed!' ); | ||
const onDeletePressed = () => Alert.alert( 'Delete pressed!' ); | ||
|
||
const ChipExamples = () => ( | ||
<VStack style={styles.container} space="2"> | ||
<Text variant="headline">Chip Component</Text> | ||
<View style={styles.vspace} /> | ||
<HStack space="2" width="100%" flexWrap="wrap"> | ||
<Chip label="Label" onPress={onChipPressed} /> | ||
<Chip label="Selected" onPress={onChipPressed} selected /> | ||
<Chip label="Disabled" onPress={onChipPressed} disabled /> | ||
</HStack> | ||
<HStack space="2" width="100%" flexWrap="wrap"> | ||
<Chip | ||
icon={<Icon name="lightning-bolt-outline" as={MaterialCommunityIcon} />} | ||
label="Left Icon" | ||
/> | ||
<Chip | ||
label="Delete Icon" | ||
onDeletePress={onDeletePressed} | ||
/> | ||
</HStack> | ||
<HStack space="2" width="100%" flexWrap="wrap"> | ||
<Chip | ||
label="Custom Delete Icon" | ||
deleteIcon={<Icon name="close-circle-outline" as={MaterialCommunityIcon} />} | ||
onDeletePress={onDeletePressed} | ||
/> | ||
</HStack> | ||
</VStack> | ||
); | ||
|
||
export default ChipExamples; |