+
+ >
+ );
}
\ No newline at end of file
diff --git a/components/PostCard.tsx b/components/PostCard.tsx
index a8621032..0fb52970 100644
--- a/components/PostCard.tsx
+++ b/components/PostCard.tsx
@@ -65,7 +65,7 @@ export default function PostCard ( { content, created_at, media, profiles:author
{dropdownOpen && (
- )}
+ )} {/* Add a button/handler to show Sandbox info if available */}
{dropdownOpen && (
diff --git a/pages/posts/Profile.tsx b/pages/posts/Profile.tsx
index 0d092d7f..cc22d3ab 100644
--- a/pages/posts/Profile.tsx
+++ b/pages/posts/Profile.tsx
@@ -1,4 +1,4 @@
-import Layout from "../../components/Layout";
+import Layout, { ProfileLayout } from "../../components/Layout";
import Card from "../../components/Card";
import Avatar from "../../components/Avatar";
import Link from "next/link";
@@ -37,48 +37,26 @@ export default function ProfilePage() {
if (!userId) {
return;
}
+ fetchProfile();
+ }, [userId]);
+ function fetchProfile () {
supabase.from('profiles') // Grab profile of userId
.select()
.eq('id', userId)
.then(result => {
if (result.error) { throw result.error; };
if (result.data) { setProfile(result.data[0]); };
- })
- }, [userId]);
-
- /*const [avatar_url, setAvatarUrl] = useState(null);
- const [profiles, setProfiles] = useState(null);
- const supabase = useSupabaseClient();
- const session = useSession();
- const { profile } = useContext(UserContext);
-
- useEffect(() => {
- supabase.from('profiles') // Fetch profile from user id matching session
- .select()
- .eq('id', session?.user?.id)
- .then(result => {
- if (result.data/*.length > 0*//*) {
- setProfiles(result.data[0]);
- }
- });
- }, []);
-
- /*useEffect(() => { // Get the user's avatar (currently this is the logged in user's avatar, it should be changed to match the profile id being viewed #TO-DO)
- supabase.from('profiles')
- .select(`avatar_url`)
- .eq('id', session?.user.id)
- .then(result => {
- setAvatarUrl(result.data[0].avatar_url) //console.log(result.data[0].avatar_url)
- })
- }, []);*/
+ }
+ )
+ }
return (
-
+
-
-
+
+
{profile && ( )}
@@ -115,6 +93,12 @@ export default function ProfilePage() {
Photos
+
+ {/* Add Generator here, highlight the "ProfileNavigation" there */}
+ Sandbox
+
@@ -183,6 +167,6 @@ export default function ProfilePage() {