diff --git a/api/accounts/admin.py b/api/accounts/admin.py index 0d2d8ee3c..481200d22 100644 --- a/api/accounts/admin.py +++ b/api/accounts/admin.py @@ -1,5 +1,6 @@ from django.contrib import admin -from .models import Profile, CustomUser +from .models import Profile, CustomUser, SocialMediaType admin.site.register(Profile) admin.site.register(CustomUser) +admin.site.register(SocialMediaType) diff --git a/api/accounts/migrations/0015_profile_groups.py b/api/accounts/migrations/0015_profile_groups.py new file mode 100644 index 000000000..a19ecbb8c --- /dev/null +++ b/api/accounts/migrations/0015_profile_groups.py @@ -0,0 +1,19 @@ +# Generated by Django 3.0.8 on 2020-07-06 13:50 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('community', '0006_media_author'), + ('accounts', '0014_merge_20200518_2025'), + ] + + operations = [ + migrations.AddField( + model_name='profile', + name='groups', + field=models.ManyToManyField(blank=True, null=True, related_name='gropus', to='community.Group'), + ), + ] diff --git a/api/accounts/migrations/0016_auto_20200706_1422.py b/api/accounts/migrations/0016_auto_20200706_1422.py new file mode 100644 index 000000000..67aaa5e77 --- /dev/null +++ b/api/accounts/migrations/0016_auto_20200706_1422.py @@ -0,0 +1,19 @@ +# Generated by Django 3.0.8 on 2020-07-06 14:22 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('community', '0006_media_author'), + ('accounts', '0015_profile_groups'), + ] + + operations = [ + migrations.AlterField( + model_name='profile', + name='groups', + field=models.ManyToManyField(blank=True, null=True, related_name='groups', to='community.Group'), + ), + ] diff --git a/api/accounts/models.py b/api/accounts/models.py index 5edec4954..3a480b860 100644 --- a/api/accounts/models.py +++ b/api/accounts/models.py @@ -2,6 +2,7 @@ from django.contrib.auth.models import AbstractUser from django.apps import apps from .managers import CustomUserManager +from community.models import Group class CustomUser(AbstractUser): @@ -30,7 +31,8 @@ class Profile(models.Model): last_name = models.CharField(max_length=200, null=True) #cities_of_residence = models.ManyToManyField('trip.Location', related_name='people',null=True, blank=True) # city_of_residence = models.CharField(max_length=200) - city_of_residence = models.ForeignKey('trip.Location', on_delete=models.CASCADE, related_name='people', null=True, blank=True) + city_of_residence = models.ForeignKey( + 'trip.Location', on_delete=models.CASCADE, related_name='people', null=True, blank=True) age = models.IntegerField(null=True) dream_destination = models.CharField(max_length=200, blank=True) bio = models.TextField(blank=True) @@ -40,8 +42,11 @@ class Profile(models.Model): 'community.Event', related_name='people', null=True, blank=True) connections = models.ManyToManyField( 'self', related_name='friends', null=True, blank=True) + # Posts, comments, and replies to be defined as foreign key on those respective models within forum app # CoTrip media defined as foreign key in community app + groups = models.ManyToManyField( + Group, related_name='members', null=True, blank=True) def __str__(self): return f'{self.first_name} {self.last_name} Profile' diff --git a/api/accounts/serializers.py b/api/accounts/serializers.py index 974ed5128..a02110a62 100644 --- a/api/accounts/serializers.py +++ b/api/accounts/serializers.py @@ -23,7 +23,7 @@ class ProfileSerializer(serializers.ModelSerializer): class Meta: model = Profile fields = ['user', 'topics', 'hashtags', 'image', 'first_name', 'last_name', 'city_of_residence', - 'age', 'dream_destination', 'bio', 'activities', 'events', 'connections', 'social_media'] + 'age', 'dream_destination', 'bio', 'activities', 'events', 'connections', 'social_media', 'groups'] class UserSerializer(serializers.ModelSerializer): diff --git a/api/community/fixtures/community.json b/api/community/fixtures/community.json index f463e0afa..4906d45f7 100644 --- a/api/community/fixtures/community.json +++ b/api/community/fixtures/community.json @@ -3,24 +3,30 @@ "model": "community.group", "pk": 1, "fields": { + "id": 0, "title": "Moms in DC", - "description": "Ladies others the six desire age. Bred am soon park past read by lain. As excuse eldest no moment. An delight beloved up garrets am cottage private." + "description": "Ladies others the six desire age. Bred am soon park past read by lain. As excuse eldest no moment. An delight beloved up garrets am cottage private.", + "location": 60 } }, { "model": "community.group", "pk": 2, "fields": { + "id": 1, "title": "Moms in NYC", - "description": "Ladies others the six desire age. Bred am soon park past read by lain. As excuse eldest no moment. An delight beloved up garrets am cottage private." + "description": "Ladies others the six desire age. Bred am soon park past read by lain. As excuse eldest no moment. An delight beloved up garrets am cottage private.", + "location": 3658 } }, { "model": "community.group", "pk": 3, "fields": { + "id": 2, "title": "Moms in Philadelphia", - "description": "Ladies others the six desire age. Bred am soon park past read by lain. As excuse eldest no moment. An delight beloved up garrets am cottage private." + "description": "Ladies others the six desire age. Bred am soon park past read by lain. As excuse eldest no moment. An delight beloved up garrets am cottage private.", + "location": 4168 } }, { diff --git a/api/community/migrations/0007_group_location.py b/api/community/migrations/0007_group_location.py new file mode 100644 index 000000000..30c51570c --- /dev/null +++ b/api/community/migrations/0007_group_location.py @@ -0,0 +1,20 @@ +# Generated by Django 3.0.8 on 2020-07-06 15:48 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('trip', '0015_remove_location_groups'), + ('community', '0006_media_author'), + ] + + operations = [ + migrations.AddField( + model_name='group', + name='location', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='group', to='trip.Location'), + ), + ] diff --git a/api/community/models.py b/api/community/models.py index eeb6f39ca..cb5086db7 100644 --- a/api/community/models.py +++ b/api/community/models.py @@ -1,14 +1,16 @@ from django.db import models +from trip.models import Location # Create your models here. class Group(models.Model): - # Location defined in trip.models title = models.CharField(max_length=200) description = models.CharField(max_length=500, blank=True, null=True) -# Members defined in account.models in Profile model -# Posts: one to many with post model + location = models.ForeignKey( + Location, on_delete=models.CASCADE, related_name='group', null=True, blank=True) + # Members defined in account.models in Profile model + # Posts: one to many with post model # (should be) taken care of in the Post model def __str__(self): @@ -46,7 +48,7 @@ class Hashtag(models.Model): def __str__(self): return self.title - + class Media(models.Model): # title and file are required. hashtags, topics, and groups are optional diff --git a/api/community/serializers.py b/api/community/serializers.py index 96e0398ea..3446e8083 100644 --- a/api/community/serializers.py +++ b/api/community/serializers.py @@ -4,7 +4,7 @@ class GroupSerializer(serializers.ModelSerializer): class Meta: model = Group - fields = '__all__' + fields = ['title', 'description', 'location', 'posts', 'members'] class EventSerializer(serializers.ModelSerializer): group = serializers.CharField() diff --git a/api/forum/fixtures/forum.json b/api/forum/fixtures/forum.json index 01b7f74c2..0dcf38cfb 100644 --- a/api/forum/fixtures/forum.json +++ b/api/forum/fixtures/forum.json @@ -9,7 +9,8 @@ "body": "Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit", "likes": 0, "author": 1, - "parent": [] + "parent": [], + "group": 1 } }, { @@ -22,7 +23,8 @@ "body": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.", "likes": 0, "author": 2, - "parent": [] + "parent": [], + "group": 1 } }, { @@ -35,7 +37,8 @@ "body": "Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.", "likes": 0, "author": 3, - "parent": [] + "parent": [], + "group": 1 } }, { @@ -48,7 +51,8 @@ "body": "Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt.", "likes": 0, "author": 5, - "parent": [] + "parent": [], + "group": 2 } }, { @@ -61,7 +65,8 @@ "body": "Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem.", "likes": 0, "author": 4, - "parent": [] + "parent": [], + "group": 2 } }, { @@ -74,7 +79,10 @@ "body": "Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? ", "likes": 0, "author": 1, - "parent": [1] + "parent": [ + 1 + ], + "group": 2 } }, { @@ -87,7 +95,10 @@ "body": "Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?", "likes": 0, "author": 2, - "parent": [2] + "parent": [ + 2 + ], + "group": 2 } }, { @@ -100,7 +111,10 @@ "body": "At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum.", "likes": 0, "author": 3, - "parent": [3] + "parent": [ + 3 + ], + "group": 2 } }, { @@ -113,7 +127,10 @@ "body": "Deleniti atque corrupti quos dolores et quas molestias excepturi sint.", "likes": 0, "author": 4, - "parent": [4] + "parent": [ + 4 + ], + "group": 2 } }, { @@ -126,7 +143,10 @@ "body": "Occaecati cupiditate non provident, similique sunt in culpa qui officia.", "likes": 0, "author": 1, - "parent": [5] + "parent": [ + 5 + ], + "group": 3 } }, { @@ -139,7 +159,10 @@ "body": "Deserunt mollitia animi, id est laborum et dolorum fuga.", "likes": 0, "author": 1, - "parent": [6] + "parent": [ + 6 + ], + "group": 3 } }, { @@ -152,7 +175,10 @@ "body": "Et harum quidem rerum facilis est et expedita distinctio.", "likes": 0, "author": 2, - "parent": [7] + "parent": [ + 7 + ], + "group": 3 } }, { @@ -165,7 +191,10 @@ "body": "Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus.", "likes": 0, "author": 3, - "parent": [8] + "parent": [ + 8 + ], + "group": 3 } }, { @@ -178,7 +207,10 @@ "body": "Omnis voluptas assumenda est, omnis dolor repellendus.", "likes": 0, "author": 4, - "parent": [9] + "parent": [ + 9 + ], + "group": 3 } }, { @@ -191,7 +223,10 @@ "body": "Temporibus autem quibusdam et aut officiis debitis aut rerum.", "likes": 0, "author": 5, - "parent": [10] + "parent": [ + 10 + ], + "group": 3 } } ] diff --git a/api/forum/migrations/0005_post_group.py b/api/forum/migrations/0005_post_group.py new file mode 100644 index 000000000..4e72b2abc --- /dev/null +++ b/api/forum/migrations/0005_post_group.py @@ -0,0 +1,20 @@ +# Generated by Django 3.0.8 on 2020-07-06 14:22 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('community', '0006_media_author'), + ('forum', '0004_auto_20200409_1801'), + ] + + operations = [ + migrations.AddField( + model_name='post', + name='group', + field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='posts', to='community.Group'), + ), + ] diff --git a/api/forum/models.py b/api/forum/models.py index d1ebb264b..c3ac8db5f 100644 --- a/api/forum/models.py +++ b/api/forum/models.py @@ -1,9 +1,11 @@ from django.db import models from accounts.models import Profile +from community.models import Group class Post(models.Model): - parent = models.ManyToManyField('self', related_name='comments', null=True, blank=True) + parent = models.ManyToManyField( + 'self', related_name='comments', null=True, blank=True) post_type = models.CharField(max_length=200, null=True, blank=True) title = models.CharField(max_length=200) time = models.DateTimeField(auto_now=True) @@ -11,6 +13,8 @@ class Post(models.Model): likes = models.IntegerField(default=0) author = models.ForeignKey(Profile, on_delete=models.CASCADE, related_name='posts', null=True) + group = models.ForeignKey( + Group, on_delete=models.CASCADE, related_name='posts', null=True) def __str__(self): return self.title diff --git a/api/trip/migrations/0014_location_groups.py b/api/trip/migrations/0014_location_groups.py new file mode 100644 index 000000000..482e28bd6 --- /dev/null +++ b/api/trip/migrations/0014_location_groups.py @@ -0,0 +1,20 @@ +# Generated by Django 3.0.8 on 2020-07-06 14:22 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('community', '0006_media_author'), + ('trip', '0013_trip_imageurls'), + ] + + operations = [ + migrations.AddField( + model_name='location', + name='groups', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='location', to='community.Group'), + ), + ] diff --git a/api/trip/migrations/0015_remove_location_groups.py b/api/trip/migrations/0015_remove_location_groups.py new file mode 100644 index 000000000..a61154a67 --- /dev/null +++ b/api/trip/migrations/0015_remove_location_groups.py @@ -0,0 +1,17 @@ +# Generated by Django 3.0.8 on 2020-07-06 15:48 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('trip', '0014_location_groups'), + ] + + operations = [ + migrations.RemoveField( + model_name='location', + name='groups', + ), + ] diff --git a/api/trip/models.py b/api/trip/models.py index 6a9df1c98..35846582c 100644 --- a/api/trip/models.py +++ b/api/trip/models.py @@ -1,24 +1,36 @@ from django.db import models + class Country(models.Model): - name = models.CharField(max_length = 200,null=True,blank=True) - code = models.CharField(max_length = 2, default='NA') + name = models.CharField(max_length=200, null=True, blank=True) + code = models.CharField(max_length=2, default='NA') + def __str__(self): return self.name + "(" + self.code + ")" + + class State(models.Model): - name = models.CharField(max_length = 200,null=True,blank=True) - code = models.CharField(max_length = 2, default='NA') - country = models.ForeignKey(Country, on_delete=models.CASCADE,null=True,blank=True) + name = models.CharField(max_length=200, null=True, blank=True) + code = models.CharField(max_length=2, default='NA') + country = models.ForeignKey( + Country, on_delete=models.CASCADE, null=True, blank=True) + def __str__(self): - return self.name +", " + self.country.code + return self.name + ", " + self.country.code #country = models.CharField(max_length=200) + + class Location(models.Model): - name = models.CharField(max_length = 200,null=True,blank=True) - state = models.ForeignKey(State, on_delete=models.CASCADE,null=True,blank=True) - country = models.ForeignKey(Country, on_delete=models.CASCADE,null=True,blank=True) + name = models.CharField(max_length=200, null=True, blank=True) + state = models.ForeignKey( + State, on_delete=models.CASCADE, null=True, blank=True) + country = models.ForeignKey( + Country, on_delete=models.CASCADE, null=True, blank=True) + def __str__(self): return self.name + ", " + self.state.code + class Trip(models.Model): title = models.CharField(max_length=200) @@ -27,16 +39,17 @@ class Trip(models.Model): # Also, we might want to have a many to many relationship so multiple trips can have the same location and one trip and have multiple locations # Tyler advised that we give each trip just one location to make things simpler - overview = models.TextField(max_length=500, null=True,blank=True) + overview = models.TextField(max_length=500, null=True, blank=True) locations = models.ManyToManyField('trip.Location') activities = models.ManyToManyField('trip.Activity') start_date = models.DateField() end_date = models.DateField() - imageURLs = models.CharField(max_length=500, null=True,blank=True) + imageURLs = models.CharField(max_length=500, null=True, blank=True) def __str__(self): return self.name + class Activity(models.Model): for_kids = models.BooleanField() for_moms = models.BooleanField() @@ -54,7 +67,6 @@ def __str__(self): # still missing/ not sure # Location # Groups: One to many rel. with groups model -# Members there: One to many rel. with profile model # Trips: One to many relationship with trip model (I think this is covered in the Trip model...) # Activity diff --git a/api/trip/urls.py b/api/trip/urls.py index 11317c7de..5546d070a 100644 --- a/api/trip/urls.py +++ b/api/trip/urls.py @@ -18,5 +18,5 @@ path('activity', ActivityList.as_view(), name='activity_list'), path('location/bystate', LocationListByState.as_view(), name='location_list_by_state'), path('location/states', StateList.as_view(), name='state_list'), - path('activity/', ActivityDetail.as_view(), name='activity_detail') + path('activity/', ActivityDetail.as_view(), name='activity_detail'), ] diff --git a/client/src/App.js b/client/src/App.js index 5b4f55f5c..e43e1aa19 100644 --- a/client/src/App.js +++ b/client/src/App.js @@ -1,5 +1,5 @@ import React, { Component } from "react"; -import { Route } from "react-router-dom"; +import { Route, Redirect } from "react-router-dom"; import SplashPage from "./pages/SplashPage/SplashPage"; import BookATripPage from "./pages/BookATripPage/BookATripPage"; import CommunityPage from "./pages/CommunityPage/CommunityPage"; @@ -13,12 +13,10 @@ import ForumPage from "./pages/ForumPage/ForumPage"; import DirectoryPeople from "./pages/DirectoryPage/DirectoryPeople"; import DirectoryGroup from "./pages/DirectoryPage/DirectoryGroups"; import HomePage from "../src/pages/HomePage/HomePage"; -import ComingSoonPage from "./pages/ComingSoonPage/ComingSoonPage"; import MemberProfilePage from "./pages/MemberProfilePage/MemberProfilePage"; import TripDetail from "./pages/TripDetail/TripDetail"; import OnboardingPage from "./pages/OnboardingPage/OnboardingPage"; import LoginPage from "./pages/LoginPage/LoginPage"; -import HomePageOldUser from "../src/pages/HomePageOldUser/HomePageOldUser"; import "./App.css"; import { library } from "@fortawesome/fontawesome-svg-core"; import { @@ -68,7 +66,7 @@ class App extends Component { image: "", profileLoaded: false, menuItems: [ - { menuItem: "My Directory", link: "/home" }, + { menuItem: "My Directory", link: "/" }, { menuItem: "Community", link: "/community" }, { menuItem: "Forum", link: "/forum-page" }, { menuItem: "Book A Trip", link: "/book-a-trip" } @@ -109,11 +107,22 @@ class App extends Component { logState = () => console.log("App.js state finished: ", this.state); render() { + const loggedIn = this.state.logged_in; return (
- - + {loggedIn ? ( + ( + + )} + > + ) : ( + + )} + ( - - )} - > )} > - ( - - )} - > - ( - - )} - >
); diff --git a/client/src/components/Navbar/Navbar.js b/client/src/components/Navbar/Navbar.js index bea691a6a..414912f6f 100644 --- a/client/src/components/Navbar/Navbar.js +++ b/client/src/components/Navbar/Navbar.js @@ -32,7 +32,7 @@ class Navbar extends Component { return (
- +
{/* Handles activating the hamburger animation and displays the menu. */} diff --git a/client/src/components/UpcomingTripsCard/UpcomingTripsCard.js b/client/src/components/UpcomingTripsCard/UpcomingTripsCard.js index 041885455..c24a90ae3 100644 --- a/client/src/components/UpcomingTripsCard/UpcomingTripsCard.js +++ b/client/src/components/UpcomingTripsCard/UpcomingTripsCard.js @@ -5,6 +5,7 @@ import Card from "../Card/Card"; import TripCard from "../TripCard/TripCard"; const UpcomingTripsCard = props => { + return (
Upcoming Trips
diff --git a/client/src/pages/ComingSoonPage/ComingSoonPage.css b/client/src/pages/ComingSoonPage/ComingSoonPage.css deleted file mode 100644 index 3e5dfbe0a..000000000 --- a/client/src/pages/ComingSoonPage/ComingSoonPage.css +++ /dev/null @@ -1,15 +0,0 @@ -.ComingSoonPage__wrapper { - display: flex; - flex-direction: column; - justify-content: space-evenly; - align-items: center; - background-color: var(--yellow); - height: 100vh; - width: 100vw; - font-family: var(--default-font); - font-size: 5vw; - color: var(--white); -} -.ComingSoonPage__wrapper h1 { - padding-top: 20vh; -} diff --git a/client/src/pages/ComingSoonPage/ComingSoonPage.js b/client/src/pages/ComingSoonPage/ComingSoonPage.js deleted file mode 100644 index f7c0abfb1..000000000 --- a/client/src/pages/ComingSoonPage/ComingSoonPage.js +++ /dev/null @@ -1,22 +0,0 @@ -import React from "react"; -import "./ComingSoonPage.css"; -import Button from "components/Button/Button"; -import Navbar from "components/Navbar/Navbar.js"; - -// Function based React Component -const ComingSoonPage = props => { - // Default Class to apply to Component - const handleClick = () => { - props.handle_logout(); - props.history.push("/"); - }; - return ( -
- -

Coming Soon!

-
- ); -}; - -export default ComingSoonPage; diff --git a/client/src/pages/ComingSoonPage/ComingSoonPage.stories.js b/client/src/pages/ComingSoonPage/ComingSoonPage.stories.js deleted file mode 100644 index 15da76ead..000000000 --- a/client/src/pages/ComingSoonPage/ComingSoonPage.stories.js +++ /dev/null @@ -1,5 +0,0 @@ -import React from "react"; -import { storiesOf } from "@storybook/react"; -import ComingSoonPage from "./ComingSoonPage"; - -storiesOf("Pages/ComingSoonPage", module).add("Default", () => ); diff --git a/client/src/pages/CommunityPage/CommunityPagePeople.js b/client/src/pages/CommunityPage/CommunityPagePeople.js index 8e97afe22..d46a1c078 100644 --- a/client/src/pages/CommunityPage/CommunityPagePeople.js +++ b/client/src/pages/CommunityPage/CommunityPagePeople.js @@ -1,4 +1,5 @@ -import React from "react"; +import React, { useState, useEffect } from "react"; +import axios from "axios"; import "./CommunityPagePeople.css"; import NavBar from "../../components/Navbar/Navbar"; import people from "assets/images/profile_default.svg"; @@ -24,6 +25,41 @@ const handleClick = e => {}; // Page or const CommunityPage = props => { + const [profile, setProfile] = useState([]); + + // Getting profile list + useEffect(() => { + const fetch = async () => { + const res = await axios.get("http://127.0.0.1:8000/profile"); + setProfile(res.data); + // console.log(res); + }; + fetch(); + }, []); + + //random number between 1 and 5 + const stockImages = [image1, image2, image3, image4, image5]; + const randomPlaceholderImages = () => + stockImages[Math.floor(Math.random() * (stockImages.length - 1 + 1))]; + + const profileList = () => { + return ( + profile && + profile.map(data => { + return ( +
+ +
+ ); + }) + ); + }; + return (
@@ -161,7 +197,7 @@ const CommunityPage = props => {
Moms in WASHINGTON, DC:
-
+ {/*
@@ -191,7 +227,8 @@ const CommunityPage = props => {
{" "} -
+
*/} + {profileList()}
See All
diff --git a/client/src/pages/DirectoryPage/DirectoryGroups.js b/client/src/pages/DirectoryPage/DirectoryGroups.js index 182ddb84b..b48a90d0f 100644 --- a/client/src/pages/DirectoryPage/DirectoryGroups.js +++ b/client/src/pages/DirectoryPage/DirectoryGroups.js @@ -1,236 +1,95 @@ -import React from "react"; +import React, { Component } from "react"; import "./DirectoryGroups.css"; import NavBar from "../../components/Navbar/Navbar"; import people from "assets/images/profile_default.svg"; import Banner from "../../components/Banner/Banner"; import Banner__Directory from "assets/images/Banner__pink.png"; import InputTextField from "../../components/InputTextField/InputTextField"; -import Banner__Community from "assets/images/community_banner.png"; import Button from "../../components/Button/Button"; import Footer from "../../components/Footer/Footer"; -import Pill from "../../components/Pill/Pill"; import GroupCard from "../../components/GroupCard/GroupCard"; import picture1 from "../../assets/images/card_small1.png"; -import picture2 from "../../assets/images/card_small2.png"; -import picture3 from "../../assets/images/card_small3.png"; import Card from "../../components/Card/Card"; - -function pillClick(val) { - console.log(val); -} +import { BASE_URL } from "../../services/constants"; +import { render } from "react-dom"; +import axios from "axios"; // Page or -const DirectoryGroups = props => { - return ( -
- - -

Directory: My Groups

- -
-
- -
+class DirectoryGroups extends Component { + constructor(props) { + super(props); + this.state = { + groups: [] + }; + } -
-
Sort By: Location
-
-
-
-
Group Location:
-
-
- - - - - {" "} - {" "} - - - - { + this.setState({ + groups: response.data + }); + }) + .catch(error => { + render("Error while fetching and parsing API request", error); + }); + } + + render() { + const groups = this.state.groups ? this.state.groups : []; + return ( +
+ + +

Directory: My Groups

+ -
{" "} - See More -
-
Groups in WASHINGTON, DC:
+ + -
-
- -
-
- -
{" "} -
- +
+
+
Your Groups
-
- -
{" "} -
- -
-
- -
{" "} -
- -
-
- -
-
- -
{" "} -
- {" "} - - Discover New Groups - {" "} +
+ {/* Map loops through groups array, assigns the number of members to variable and generates card */} + {groups.map((group, index) => { + return ( +
+ +
+ ); + })} +
+ {" "} + + Discover New Groups + +
+ See All
- See All +
-
-
- ); -}; + ); + } +} export default DirectoryGroups; diff --git a/client/src/pages/DirectoryPage/DirectoryPeople.js b/client/src/pages/DirectoryPage/DirectoryPeople.js index 1a69f4123..1a8dc258e 100644 --- a/client/src/pages/DirectoryPage/DirectoryPeople.js +++ b/client/src/pages/DirectoryPage/DirectoryPeople.js @@ -21,7 +21,7 @@ function pillClick(val) { } const handleClick = e => { - ("/home"); + ("/"); }; // Page or diff --git a/client/src/pages/GroupPage/GroupPage.css b/client/src/pages/GroupPage/GroupPage.css new file mode 100644 index 000000000..e8902a0a0 --- /dev/null +++ b/client/src/pages/GroupPage/GroupPage.css @@ -0,0 +1,8 @@ +.wrapper { + text-align: center; +} + +h1{ + display: inline-block; +} + diff --git a/client/src/pages/GroupPage/GroupPage.js b/client/src/pages/GroupPage/GroupPage.js new file mode 100644 index 000000000..fbf9e7778 --- /dev/null +++ b/client/src/pages/GroupPage/GroupPage.js @@ -0,0 +1,47 @@ +import React from 'react'; +import './GroupPage.css'; +import GroupCard from "../../components/GroupCard/GroupCard"; +import Navbar from '../../components/Navbar/Navbar'; +import Footer from '../../components/Footer/Footer'; +import card1 from "assets/images/card-image-3.png"; +import card2 from "assets/images/card-image-2.png"; +import card3 from "assets/images/card-image.png"; +import people from "assets/images/profile_default.svg"; + + +const GroupPage = props => { + + return ( +
+ + + +
+

Groups You Can Join!

+
+
+ + + + + + + + + +
+
+
+ ) +} + + +export default GroupPage \ No newline at end of file diff --git a/client/src/pages/HomePage/HomePage.js b/client/src/pages/HomePage/HomePage.js index 286593764..b76f1366c 100644 --- a/client/src/pages/HomePage/HomePage.js +++ b/client/src/pages/HomePage/HomePage.js @@ -34,6 +34,7 @@ import MediaCard from "../../components/MediaCard/MediaCard"; import SignUp from "components/SignUpAd/SignUpAd"; import Banner from "components/Banner/Banner"; import PersonCard from "components/PersonCard/PersonCard"; +import SplashPage from "pages/SplashPage/SplashPage"; const personCard1 = ( { }; const HomePage = props => { - return ( - - -
- - {props.first_name ?

Welcome, {props.first_name}!

:

Welcome!

} -
- New User Sample - Old User Sample - -
- -

CoTripper Scrapbook

-
- - - - +
+ +

CoTripper Scrapbook

+
+ + - - - - - -
-
-
-
- {" "} -
+ + + + + + +
+
+
+ +
+ {" "} +
-
{/* {this.state.counter === 3 ? (
- +

Skip

diff --git a/client/src/services/User.js b/client/src/services/User.js index dbc9ad56f..a223691e7 100644 --- a/client/src/services/User.js +++ b/client/src/services/User.js @@ -23,7 +23,7 @@ export function handleSignup(data, history) { first_name: json.user.profile.first_name, image: json.user.profile.image }); - history.push("/home"); + history.push("/"); }) .catch(err => { console.log(err); @@ -48,7 +48,7 @@ export function handleLogin(data, history) { first_name: json.user.profile.first_name, image: json.user.profile.image }); - history.push("/home"); + history.push("/"); }) .catch(err => { console.log(err);