Skip to content
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

feat(create-group): create group form #20

Open
wants to merge 49 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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 Apr 30, 2023
1ea4d05
Dropdown Progress + Image Picker Progress
MinT-Napkin May 22, 2023
666a3ab
Merge branch 'main' into create-group-form
MinT-Napkin Jun 2, 2023
b541915
Finished Dropdown and Taginput
MinT-Napkin Jun 7, 2023
b292389
Utilize stack navigation
MinT-Napkin Jun 28, 2023
c50010b
Added GroupContext
MinT-Napkin Jul 3, 2023
cf856a3
submitForm to reset variables
MinT-Napkin Jul 3, 2023
aff02b2
Bug fixes for android
MinT-Napkin Jul 6, 2023
01661f3
Organize group form code into folder
MinT-Napkin Jul 6, 2023
e6dbd77
feat: added api route for creating a new guild and updated guild db s…
lxkedinh Jul 14, 2023
51ceb14
Merge branch 'main' into create-group-form
MinT-Napkin Jul 23, 2023
41f50b9
submission logic progress
MinT-Napkin Jul 24, 2023
1f92f68
Handle errors and website inputs
MinT-Napkin Aug 14, 2023
b4b58f9
Minor fixes + added scrollview to dropdown
MinT-Napkin Aug 14, 2023
ac9b538
Image quality change
MinT-Napkin Aug 14, 2023
3288b5f
Merge branch 'main' into create-group-form
MinT-Napkin Oct 1, 2023
40f2b54
insertGuild prisma (requires uuid)
MinT-Napkin Oct 9, 2023
69cc055
hide imagepicker + submission logic
MinT-Napkin Oct 9, 2023
20a62fa
rename folder
MinT-Napkin Oct 15, 2023
b893293
fix missing banner/icon field
MinT-Napkin Oct 15, 2023
1e2bf37
Merge branch 'main' into create-group-form
MinT-Napkin Oct 15, 2023
eb5c334
feat: UUID autogeneration on insert for guilds
lxkedinh Nov 1, 2023
e26f28a
Merge branch 'create-group-form' of https://github.com/cppsea/icebrea…
MinT-Napkin Nov 1, 2023
0e61924
Merge branch 'main' into create-group-form
MinT-Napkin Nov 13, 2023
421b12f
fix: remove guildId hardcode + minor adjustments to create group screen
MinT-Napkin Nov 20, 2023
af6c06c
fix: added expo-image-picker to eas build plugins
lxkedinh Nov 20, 2023
0c479c8
Merge branch 'main' into create-group-form
MinT-Napkin Dec 18, 2023
8c16e11
Merge branch 'main' to create-group-form
MinT-Napkin Dec 24, 2023
92094cb
Merge branch 'main' into create-group-form
MinT-Napkin Jan 5, 2024
cb69835
feat: image submission through form
MinT-Napkin Jan 8, 2024
5d36c9c
Merge main into create-group-form
MinT-Napkin Jan 8, 2024
33327a5
refactor: clean up variable names in CreateGuildContext
MinT-Napkin Jan 8, 2024
62668b4
refactor: rename file and guild title -> name
MinT-Napkin Jan 8, 2024
401bfbc
chore: deleted unnecessary backend files
MinT-Napkin Jan 8, 2024
887fbaf
fix: revert guild controller createGuild
lxkedinh Jan 9, 2024
c466159
Merge 'main' into 'create-group-form'
MinT-Napkin Jan 18, 2024
65d254a
chore: eslint and text input + regex bug fixes
MinT-Napkin Jan 22, 2024
1b5263f
Merge 'main' into 'create-group-form'
MinT-Napkin Jan 22, 2024
95b165d
refactor: combined create group form screens
MinT-Napkin Jan 29, 2024
00c655d
chore: deleted unnecessary create group form screen files
MinT-Napkin Jan 29, 2024
ac1d0b5
Merge 'main' into 'create-group-screen'
MinT-Napkin Feb 11, 2024
fe92d92
feat: create group screen uses react-hook-form
MinT-Napkin Feb 19, 2024
0a87a63
fix: altered handler regex
MinT-Napkin Feb 19, 2024
0fc79a9
feat: unique handler progress
MinT-Napkin Feb 25, 2024
4b4238b
Merge 'main' into 'create-group-screen'
MinT-Napkin Feb 25, 2024
5149867
feat: validate unique handler
MinT-Napkin Mar 3, 2024
1c2ef98
chore: remove console logs + refactoring
MinT-Napkin Mar 3, 2024
2c08392
chore: merge remote-tracking branch 'origin/main' into create-group-form
lxkedinh Mar 31, 2024
af0bf99
chore: began react-hook-form modifications
lxkedinh Apr 1, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions packages/app/app.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
},
],
],
};
78 changes: 78 additions & 0 deletions packages/app/components/Dropdown.js
MinT-Napkin marked this conversation as resolved.
Show resolved Hide resolved
MinT-Napkin marked this conversation as resolved.
Show resolved Hide resolved
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;
94 changes: 94 additions & 0 deletions packages/app/components/TagInput.js
MinT-Napkin marked this conversation as resolved.
Show resolved Hide resolved
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;
3 changes: 2 additions & 1 deletion packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"expo-auth-session": "~3.8.0",
"expo-constants": "~14.0.2",
"expo-dev-client": "~2.0.1",
"expo-image-picker": "~14.0.2",
"expo-random": "~13.0.0",
"expo-secure-store": "~12.0.0",
"expo-status-bar": "~1.4.2",
Expand All @@ -35,7 +36,7 @@
"react-native-gesture-handler": "~2.8.0",
"react-native-option-menu": "^1.1.3",
"react-native-reanimated": "~2.12.0",
"react-native-safe-area-context": "^4.5.0",
"react-native-safe-area-context": "~4.4.1",
"react-native-screens": "~3.18.0",
"react-native-svg": "13.4.0",
"react-test-renderer": "^18.2.0"
Expand Down
9 changes: 9 additions & 0 deletions packages/app/screens/feed/FeedDrawer.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import PropTypes from "prop-types";

import Ionicons from "@expo/vector-icons/Ionicons";

import CreateGroupStack from "./create_group_form/CreateGroupStack";

const Feed = createDrawerNavigator();

const DARK_BLUE = "darkblue";
Expand Down Expand Up @@ -62,6 +64,13 @@ function FeedDrawer() {
headerShown: false,
}}
/>
<Feed.Screen
name="Create Group"
component={CreateGroupStack}
options={{
headerShown: false,
}}
/>
</Feed.Navigator>
);
}
Expand Down
Loading