This repository has been archived by the owner on Jun 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 74
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
Showing
6 changed files
with
4,273 additions
and
2,932 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,20 @@ | ||
import React from "react"; | ||
import PropTypes from "prop-types"; | ||
import { View, Text, TextInput, TouchableOpacity } from "react-native"; | ||
import { Text, TouchableOpacity } from "react-native"; | ||
|
||
import styles from "./styles"; | ||
|
||
const Tag = ({ label, onPress, tagContainerStyle, tagTextStyle, readonly }) => { | ||
const tagText = <Text style={[styles.tagLabel, tagTextStyle]}>{label}</Text>; | ||
|
||
if (readonly) { | ||
return ( | ||
<View style={[styles.tag, tagContainerStyle]}> | ||
{tagText} | ||
</View> | ||
) | ||
} else { | ||
return ( | ||
<TouchableOpacity style={[styles.tag, tagContainerStyle]} onPress={onPress}> | ||
{tagText} | ||
</TouchableOpacity> | ||
) | ||
} | ||
} | ||
const Tag = ({ label, onPress, tagContainerStyle, tagTextStyle }) => { | ||
return ( | ||
<TouchableOpacity style={[styles.tag, tagContainerStyle]} onPress={onPress}> | ||
<Text style={[styles.tagLabel, tagTextStyle]}>{label}</Text> | ||
</TouchableOpacity> | ||
); | ||
}; | ||
|
||
Tag.propTypes = { | ||
label: PropTypes.string.isRequired, | ||
onPress: PropTypes.func, | ||
readonly: PropTypes.bool | ||
onPress: PropTypes.func.isRequired | ||
}; | ||
|
||
export default Tag; |
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.