diff --git a/packages/app/Root.js b/packages/app/Root.js index 7ca9e08b..c69011c8 100644 --- a/packages/app/Root.js +++ b/packages/app/Root.js @@ -58,7 +58,7 @@ function App() { } catch (err) { await logoutUser(); console.log( - "Something went wrong trying to auto log in with stored access token" + "Something went wrong trying to auto log in with stored access token", ); } @@ -89,7 +89,7 @@ function App() { } catch (err) { await logoutUser(); console.log( - "Something went wrong trying to auto log in with newly fetched access token from stored refresh token" + "Something went wrong trying to auto log in with newly fetched access token from stored refresh token", ); } }; diff --git a/packages/app/app.config.js b/packages/app/app.config.js index ad74d11d..90d6f683 100644 --- a/packages/app/app.config.js +++ b/packages/app/app.config.js @@ -55,5 +55,12 @@ module.exports = { iosUrlScheme: process.env.IOS_GOOGLE_URL_SCHEME, }, ], + [ + "expo-image-picker", + { + photosPermission: + "Allow Icebreak to access your photos for choosing profile icons and thumbnail images.", + }, + ], ], }; diff --git a/packages/app/components/Dropdown.js b/packages/app/components/Dropdown.js new file mode 100644 index 00000000..9dbdb1d7 --- /dev/null +++ b/packages/app/components/Dropdown.js @@ -0,0 +1,84 @@ +import PropTypes from "prop-types"; +import React, { useState } from "react"; +import { TouchableOpacity, Text, View, StyleSheet } from "react-native"; +import { ScrollView } from "react-native-gesture-handler"; + +const Dropdown = ({ options, value, setValue }) => { + const [isOpen, setIsOpen] = useState(false); + + const toggleDropdown = () => { + setIsOpen(!isOpen); + }; + + const selectOption = (option) => { + setValue(option); + setIsOpen(false); + }; + + return ( + + + + {value || "Select an option"} + + + + {isOpen && ( + + {options.map((option) => ( + selectOption(option)}> + {option} + + ))} + + )} + + ); +}; + +const colors = { + white: "#fff", + grey: "#ccc", + black: "#333", +}; + +const styles = StyleSheet.create({ + dropdownButton: { + borderColor: colors.grey, + borderRadius: 4, + borderWidth: 1, + padding: 10, + }, + dropdownButtonText: { + color: colors.blue, + fontSize: 16, + }, + dropdownContainer: { + backgroundColor: colors.white, + borderRadius: 4, + padding: 10, + }, + optionButton: { + padding: 10, + }, + optionText: { + color: colors.blue, + fontSize: 16, + }, + optionsContainer: { + marginTop: 10, + maxHeight: 200, + }, +}); + +Dropdown.propTypes = { + options: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string])) + .isRequired, + value: PropTypes.string.isRequired, + setValue: PropTypes.func.isRequired, +}; + +export default Dropdown; diff --git a/packages/app/components/TagInput.js b/packages/app/components/TagInput.js new file mode 100644 index 00000000..6851381e --- /dev/null +++ b/packages/app/components/TagInput.js @@ -0,0 +1,108 @@ +import PropTypes from "prop-types"; +import React from "react"; +import { TextInput, Button, View, Text, StyleSheet } from "react-native"; + +const TagInput = ({ value, setValue, tags, setTags, maxTags }) => { + const addTag = () => { + if (value && tags.length < maxTags && !tags.includes(value)) { + setTags([...tags, value]); + setValue(""); + } + }; + + const removeTag = (index) => { + const updatedTags = [...tags]; + updatedTags.splice(index, 1); + setTags(updatedTags); + }; + + return ( + + + { + setValue(newText); + }} + placeholder="Enter a tag" + style={styles.input} + /> +