Skip to content

Commit

Permalink
πŸ§‘πŸ»β€πŸ«πŸ‘˜ ↝ Adding components from #54
Browse files Browse the repository at this point in the history
  • Loading branch information
Gizmotronn committed Jun 30, 2023
1 parent 869091b commit c17fc45
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 28 deletions.
18 changes: 1 addition & 17 deletions pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,11 @@ import { useSession, useSupabaseClient } from "@supabase/auth-helpers-react";
import Link from "next/link";
import React, { useEffect, useState } from "react";
import CoreLayout from "../components/Core/Layout";
import UserOnboarding from "../components/onboarding/comments";
import SocialGraphHomeNoSidebar, { SocialGraphHomeModal } from "./posts";
import Db from "./tests/db";
import { Database } from "../utils/database.types";
import AccountAvatar, { AccountAvatarV1, AccountAvatarV2 } from "../components/AccountAvatar";
import { url } from "inspector";
import AccountEditor from "../components/Core/UpdateProfile";
import DbHeader from "../components/Backend/Header";
import Login from "./login";
import IndexAuth from "../components/Core/indexAuth";
import Instructions from "../components/onboarding";

type Profiles = Database['public']['Tables']['profiles']['Row'];

Expand All @@ -35,14 +29,8 @@ export default function Home() {
const [username, setUsername] = useState<Profiles['username']>(null);

return (
<>
<CoreLayout>
{ !session && (
<Login />
)}
{ session && (
<><IndexAuth />
<>
<IndexAuth />
<section>
<div className="px-4 mx-auto max-w-7xl sm:px-6 md:px-12 lg:px-24">
<div className="flex flex-col w-full mb-12 text-center">
Expand Down Expand Up @@ -173,10 +161,6 @@ export default function Home() {
</div>
</div>
</footer>
</>
</>
)}
</CoreLayout>
</>
)
}
6 changes: 2 additions & 4 deletions pages/posts/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,18 +62,16 @@ export default function SocialGraphHomeNoSidebar () {

function fetchPosts () {
supabase.from('posts')
.select('id, content, created_at, media, profiles(id, avatar_url, username)') // Reset id on testing playground server later
.select('id, content, created_at, profiles(id, avatar_url, username)') // Reset id on testing playground server later
.order('created_at', { ascending: false })
.then( result => { setPosts(result.data); });

supabase.from('posts_duplicate')
.select('id, content, created_at, media, planets2, profiles(id, avatar_url, username)') // Reset id on testing playground server later
.select('id, content, created_at, planets2, profiles(id, avatar_url, username)') // Reset id on testing playground server later
.order('created_at', { ascending: false })
.then( result => { setPlanetPosts(result.data); });
}

if (!session) { return <Login />; };

return (
<Layout hideNavigation={true}>
<UserContext.Provider value={{profile}}> {/* Move this into `_app.tsx` later */}
Expand Down
8 changes: 1 addition & 7 deletions pages/tests/db.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { useSession, useSupabaseClient } from "@supabase/auth-helpers-react";
import InfoFAQ from "../../components/Info/faq";
import { SocialGraphHomeModal } from "../posts";
import Login from "../login";
import Link from "next/link";

export default function Db () {
Expand All @@ -10,10 +9,6 @@ export default function Db () {

return (
<div className='container' style={{ padding: '50px 0 100px 0' }}>
{!session ? (
<></>
): (
<>
<section>
<div className="px-4 mx-auto max-w-7xl sm:px-6 md:px-12 lg:px-24">
<div className="flex flex-col w-full mb-12 text-center">
Expand Down Expand Up @@ -196,8 +191,7 @@ export default function Db () {
</div>
</div>
</footer>
</>
)}</div>
</div>
)
}

Expand Down

0 comments on commit c17fc45

Please sign in to comment.