-
Notifications
You must be signed in to change notification settings - Fork 0
feat(create-group): create group form #20
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
Open
MinT-Napkin
wants to merge
49
commits into
main
Choose a base branch
from
create-group-form
base: main
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.
Open
Changes from 34 commits
Commits
Show all changes
49 commits
Select commit
Hold shift + click to select a range
42e5239
3 screen form with basic text validation
MinT-Napkin 1ea4d05
Dropdown Progress + Image Picker Progress
MinT-Napkin 666a3ab
Merge branch 'main' into create-group-form
MinT-Napkin b541915
Finished Dropdown and Taginput
MinT-Napkin b292389
Utilize stack navigation
MinT-Napkin c50010b
Added GroupContext
MinT-Napkin cf856a3
submitForm to reset variables
MinT-Napkin aff02b2
Bug fixes for android
MinT-Napkin 01661f3
Organize group form code into folder
MinT-Napkin e6dbd77
feat: added api route for creating a new guild and updated guild db s…
lxkedinh 51ceb14
Merge branch 'main' into create-group-form
MinT-Napkin 41f50b9
submission logic progress
MinT-Napkin 1f92f68
Handle errors and website inputs
MinT-Napkin b4b58f9
Minor fixes + added scrollview to dropdown
MinT-Napkin ac9b538
Image quality change
MinT-Napkin 3288b5f
Merge branch 'main' into create-group-form
MinT-Napkin 40f2b54
insertGuild prisma (requires uuid)
MinT-Napkin 69cc055
hide imagepicker + submission logic
MinT-Napkin 20a62fa
rename folder
MinT-Napkin b893293
fix missing banner/icon field
MinT-Napkin 1e2bf37
Merge branch 'main' into create-group-form
MinT-Napkin eb5c334
feat: UUID autogeneration on insert for guilds
lxkedinh e26f28a
Merge branch 'create-group-form' of https://github.com/cppsea/icebrea…
MinT-Napkin 0e61924
Merge branch 'main' into create-group-form
MinT-Napkin 421b12f
fix: remove guildId hardcode + minor adjustments to create group screen
MinT-Napkin af6c06c
fix: added expo-image-picker to eas build plugins
lxkedinh 0c479c8
Merge branch 'main' into create-group-form
MinT-Napkin 8c16e11
Merge branch 'main' to create-group-form
MinT-Napkin 92094cb
Merge branch 'main' into create-group-form
MinT-Napkin cb69835
feat: image submission through form
MinT-Napkin 5d36c9c
Merge main into create-group-form
MinT-Napkin 33327a5
refactor: clean up variable names in CreateGuildContext
MinT-Napkin 62668b4
refactor: rename file and guild title -> name
MinT-Napkin 401bfbc
chore: deleted unnecessary backend files
MinT-Napkin 887fbaf
fix: revert guild controller createGuild
lxkedinh c466159
Merge 'main' into 'create-group-form'
MinT-Napkin 65d254a
chore: eslint and text input + regex bug fixes
MinT-Napkin 1b5263f
Merge 'main' into 'create-group-form'
MinT-Napkin 95b165d
refactor: combined create group form screens
MinT-Napkin 00c655d
chore: deleted unnecessary create group form screen files
MinT-Napkin ac1d0b5
Merge 'main' into 'create-group-screen'
MinT-Napkin fe92d92
feat: create group screen uses react-hook-form
MinT-Napkin 0a87a63
fix: altered handler regex
MinT-Napkin 0fc79a9
feat: unique handler progress
MinT-Napkin 4b4238b
Merge 'main' into 'create-group-screen'
MinT-Napkin 5149867
feat: validate unique handler
MinT-Napkin 1c2ef98
chore: remove console logs + refactoring
MinT-Napkin 2c08392
chore: merge remote-tracking branch 'origin/main' into create-group-form
lxkedinh af0bf99
chore: began react-hook-form modifications
lxkedinh 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
MinT-Napkin marked this conversation as resolved.
Show resolved
Hide resolved
|
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,78 @@ | ||
| 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, setDropdownError}) => { | ||
| const [isOpen, setIsOpen] = useState(false); | ||
|
|
||
| const toggleDropdown = () => { | ||
| setIsOpen(!isOpen); | ||
| }; | ||
|
|
||
| const selectOption = (option) => { | ||
| setValue(option); | ||
| setIsOpen(false); | ||
| if(setDropdownError != null) | ||
| { | ||
| setDropdownError(''); | ||
| } | ||
| }; | ||
|
|
||
| return ( | ||
| <View style={styles.dropdownContainer}> | ||
| <TouchableOpacity | ||
| style={styles.dropdownButton} | ||
| onPress={toggleDropdown} | ||
| > | ||
| <Text style={styles.dropdownButtonText}> | ||
| {value || 'Select an option'} | ||
| </Text> | ||
| </TouchableOpacity> | ||
|
|
||
| {isOpen && ( | ||
| <ScrollView style={styles.optionsContainer}> | ||
| {options.map((option) => ( | ||
| <TouchableOpacity | ||
| key={option} | ||
| style={styles.optionButton} | ||
| onPress={() => selectOption(option)} | ||
| > | ||
| <Text style={styles.optionText}>{option}</Text> | ||
| </TouchableOpacity> | ||
| ))} | ||
| </ScrollView> | ||
| )} | ||
| </View> | ||
| ); | ||
| }; | ||
|
|
||
| const styles = StyleSheet.create({ | ||
| dropdownContainer: { | ||
| backgroundColor: '#fff', | ||
| borderRadius: 4, | ||
| padding: 10, | ||
| }, | ||
| dropdownButton: { | ||
| padding: 10, | ||
| borderWidth: 1, | ||
| borderColor: '#ccc', | ||
| borderRadius: 4, | ||
| }, | ||
| dropdownButtonText: { | ||
| fontSize: 16, | ||
| color: '#333', | ||
| }, | ||
| optionsContainer: { | ||
| marginTop: 10, | ||
| maxHeight: 200, | ||
| }, | ||
| optionButton: { | ||
| padding: 10, | ||
| }, | ||
| optionText: { | ||
| fontSize: 16, | ||
| color: '#333', | ||
| }, | ||
| }); | ||
|
|
||
| export default Dropdown; |
MinT-Napkin marked this conversation as resolved.
Show resolved
Hide resolved
|
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,94 @@ | ||
| import React, { useState } from 'react'; | ||
| import { TextInput, Button, View, Text, StyleSheet } from 'react-native'; | ||
|
|
||
| const TagInput = ({ value, setValue, tags, setTags, maxTags, setTagsError }) => { | ||
| 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 ( | ||
| <View style={styles.container}> | ||
| <View style={styles.inputContainer}> | ||
| <TextInput | ||
| value={value} | ||
| onChangeText={(newText) => { | ||
| setValue(newText); | ||
| if(setTagsError != null) | ||
| { | ||
| setTagsError(''); | ||
| } | ||
| }} | ||
| placeholder="Enter a tag" | ||
| style={styles.input} | ||
| /> | ||
| <Button title="Add Tag" onPress={addTag} disabled={tags.length >= maxTags} /> | ||
| </View> | ||
|
|
||
| <View style={styles.tagsContainer}> | ||
| {tags.map((tag, index) => ( | ||
| <View key={index} style={styles.tag}> | ||
| <Text style={styles.tagText}>{tag}</Text> | ||
| <Button | ||
| title="X" | ||
| onPress={() => removeTag(index)} | ||
| style={styles.removeButton} | ||
| /> | ||
| </View> | ||
| ))} | ||
| </View> | ||
| </View> | ||
| ); | ||
| }; | ||
|
|
||
| const styles = StyleSheet.create({ | ||
| container: { | ||
| flexDirection: 'column', | ||
| alignItems: 'flex-start', | ||
| justifyContent: 'flex-start', | ||
| }, | ||
| inputContainer: { | ||
| flexDirection: 'row', | ||
| alignItems: 'center', | ||
| justifyContent: 'space-between', | ||
| }, | ||
| input: { | ||
| flex: 1, | ||
| height: 40, | ||
| margin: 6, | ||
| borderWidth: 1, | ||
| padding: 10, | ||
| }, | ||
| tagsContainer: { | ||
| flexDirection: 'row', | ||
| flexWrap: 'wrap', | ||
| }, | ||
| tag: { | ||
| backgroundColor: '#e0e0e0', | ||
| borderRadius: 8, | ||
| paddingVertical: 1, | ||
| paddingHorizontal: 4, | ||
| margin: 4, | ||
| flexDirection: 'row', | ||
| alignItems: 'center', | ||
| }, | ||
| tagText: { | ||
| marginRight: 2, | ||
| }, | ||
| removeButton: { | ||
| backgroundColor: '#ff0000', | ||
| paddingVertical: 2, | ||
| paddingHorizontal: 4, | ||
| borderRadius: 4, | ||
| }, | ||
| }); | ||
|
|
||
| export default TagInput; |
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
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.
Uh oh!
There was an error while loading. Please reload this page.