Skip to content

Commit

Permalink
🪞🗞 ↝ Confirmed next builds without article pages
Browse files Browse the repository at this point in the history
  • Loading branch information
Gizmotronn committed Mar 1, 2023
1 parent 744a0d6 commit be57978
Show file tree
Hide file tree
Showing 20 changed files with 169 additions and 148 deletions.
File renamed without changes.
4 changes: 2 additions & 2 deletions components/NavigationCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default function NavigationCard(){
</svg>
<span className="hidden md:block">Home</span>
</Link>
<Link href="/posts/profile/friends" className={pathname === '/profile/friends' ? activeElementClasses : nonActiveElementClasses}>
<Link href="/posts/user/cebdc7a2-d8af-45b3-b37f-80f328ff54d6" className={pathname === '/profile/friends' ? activeElementClasses : nonActiveElementClasses}>
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" strokeWidth={1.5} stroke="currentColor" className="w-6 h-6">
<path strokeLinecap="round" strokeLinejoin="round" d="M18 18.72a9.094 9.094 0 003.741-.479 3 3 0 00-4.682-2.72m.94 3.198l.001.031c0 .225-.012.447-.037.666A11.944 11.944 0 0112 21c-2.17 0-4.207-.576-5.963-1.584A6.062 6.062 0 016 18.719m12 0a5.971 5.971 0 00-.941-3.197m0 0A5.995 5.995 0 0012 12.75a5.995 5.995 0 00-5.058 2.772m0 0a3 3 0 00-4.681 2.72 8.986 8.986 0 003.74.477m.94-3.197a5.971 5.971 0 00-.94 3.197M15 6.75a3 3 0 11-6 0 3 3 0 016 0zm6 3a2.25 2.25 0 11-4.5 0 2.25 2.25 0 014.5 0zm-13.5 0a2.25 2.25 0 11-4.5 0 2.25 2.25 0 014.5 0z" />
</svg>
Expand All @@ -36,7 +36,7 @@ export default function NavigationCard(){
</svg>
<span className="hidden md:block">Saved posts</span>
</Link>
<Link href="/posts/notifications" className={pathname === '/notifications' ? activeElementClasses : nonActiveElementClasses}>
<Link href="/planets/fdd401bf-3925-49ba-a155-4c3dba8dd93f" className={pathname === '/notifications' ? activeElementClasses : nonActiveElementClasses}> {/* For testing -> final should be /posts/notifications */}
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" strokeWidth={1.5} stroke="currentColor" className="w-6 h-6">
<path strokeLinecap="round" strokeLinejoin="round" d="M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0" />
</svg>
Expand Down
2 changes: 1 addition & 1 deletion components/Planets/PlanetAvatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default function PlanetAvatar ({ uid, url, size, /*onUpload*/ }: {
const [uploading, setUploading] = useState(false);

const supabase = useSupabaseClient<Database>();
const [avatarUrl, setAvatarUrl] = useState<Planets['avatar_url']>(null);
const [avatarUrl, setAvatarUrl] = useState<Planets['avatar_url']>(null); // I believe this is causing the invalid uuid syntax error

useEffect(() => {
if (url) downloadImage(url);
Expand Down
7 changes: 4 additions & 3 deletions components/Planets/PlanetCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ import React, { useEffect, useState } from "react";
import Card from "../Card";

import { useSupabaseClient } from "@supabase/auth-helpers-react";
import { PlanetEditorFromData } from "../../pages/generator/planet-editor";
import PlanetEditor, { PlanetEditorFromData } from "../../pages/generator/planet-editor";
import StakePlay from "../../pages/stake/play";
import UtterancesComments from "../Lens/Utterances";

export function PlanetCard ({ activeTab, planetId }) {
const supabase = useSupabaseClient();
Expand All @@ -17,7 +18,7 @@ export function PlanetCard ({ activeTab, planetId }) {
)};
{activeTab === 'data' && (
<div><Card noPadding={false}>
{/*<PlanetEditor />*/}
<PlanetEditor />
<PlanetEditorFromData
// temperature = planet?.temperature
/> {/* Put inside pages/planets/planet.tsx underneath the tabs to see in action temporarily */}
Expand All @@ -26,7 +27,7 @@ export function PlanetCard ({ activeTab, planetId }) {
{activeTab === 'refs' && (
<div><Card noPadding={false}>
Planet Name
</Card></div>
</Card><Card noPadding={false}><UtterancesComments /></Card></div>
)};
{activeTab === 'sandbox' && (
<div><Card noPadding={false}>
Expand Down
2 changes: 1 addition & 1 deletion components/Planets/PlanetNavigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default function PlanetTabs ({ planetId, activeTab }) {
</svg>
<span className="hidden sm:block">Datasets</span>
</Link>
<Link href={`/planets/${planetId}/refs`} className={activeTab === 'refs' ? activeTabClasses : tabClasses}> {/* Posts that mention/use the planetId */}
<Link href={`/planets/${planetId}/data`} className={activeTab === 'refs' ? activeTabClasses : tabClasses}> {/* Posts that mention/use the planetId */}
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" strokeWidth={1.5} stroke="currentColor" className="w-6 h-6">
<path strokeLinecap="round" strokeLinejoin="round" d="M9.568 3H5.25A2.25 2.25 0 003 5.25v4.318c0 .597.237 1.17.659 1.591l9.581 9.581c.699.699 1.78.872 2.607.33a18.095 18.095 0 005.223-5.223c.542-.827.369-1.908-.33-2.607L11.16 3.66A2.25 2.25 0 009.568 3z" />
<path strokeLinecap="round" strokeLinejoin="round" d="M6 6h.008v.008H6V6z" />
Expand Down
4 changes: 1 addition & 3 deletions components/Posts/ProfileCard.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, { useEffect, useState } from "react"
import UtterancesComments from "../Lens/Utterances"
import Card from "../Card"
import FriendInfo from "../FriendInfo"
import PostCard from "../PostCard"
Expand Down Expand Up @@ -47,7 +46,7 @@ export function ProfileContent ({ activeTab, userId }) {
<div>
{ posts.length > 0 && posts.map(post => (
<PostCard key={post.created_at} {...post} profiles={profile} /*media={media}*/ />
))}
))} {/* Section to show their long-form articles here */}
{/*<PostCard key = { postMessage.id } { ..post } />*/}
{/* Create a post card to tag the user */}
</div>
Expand All @@ -59,7 +58,6 @@ export function ProfileContent ({ activeTab, userId }) {
<p className="mb-2 text-sm">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aut doloremque harum maxime mollitia perferendis praesentium quaerat. Adipisci, delectus eum fugiat incidunt iusto molestiae nesciunt odio porro quae quaerat, reprehenderit, sed.</p>
<p className="mb-2 text-sm">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Amet assumenda error necessitatibus nesciunt quas quidem quisquam reiciendis, similique. Amet consequuntur facilis iste iure minima nisi non praesentium ratione voluptas voluptatem?</p>
</Card>
<UtterancesComments />
</div>
)}
{activeTab === 'friends' && (
Expand Down
2 changes: 1 addition & 1 deletion components/Posts/ProfileNavigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default function ProfileTabs ({ userId, activeTab }) {

return (
<div className="mt-6 md:mt-10 flex gap-0">
<Link href={`/posts/profile/${userId}/posts`} className={activeTab === 'posts' ? activeTabClasses : tabClasses}>
<Link href={`/posts/profile/${userId}/`} className={activeTab === 'posts' ? activeTabClasses : tabClasses}>
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" strokeWidth={1.5} stroke="currentColor" className="w-6 h-6">
<path strokeLinecap="round" strokeLinejoin="round" d="M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z" />
</svg>
Expand Down
26 changes: 26 additions & 0 deletions context/AnomalyContext.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { createContext, useEffect, useState } from "react";
import { useSession, useSupabaseClient } from "@supabase/auth-helpers-react";

export const AnomalyContext = createContext ( { } );

export default function AnomalyContextProvider ( { children, planetId } ) {
const session = useSession();
const supabase = useSupabaseClient();
const [planet, setAnomaly] = useState(null);

useEffect(() => {
if (!session?.user?.id) { return; };
supabase.from('planets') // Change to specific anomaly table
.select()
.eq('id', planetId )
.then( result => {
setAnomaly ( result.data?.[0] );
});
}, [planetId]);

return (
<AnomalyContext.Provider value={{ planet }}>
{ children }
</AnomalyContext.Provider>
);
};
17 changes: 8 additions & 9 deletions context/UserContext.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
import {createContext, useEffect, useState} from "react";
import {useSession, useSupabaseClient} from "@supabase/auth-helpers-react";
import { createContext, useEffect, useState } from "react";
import { useSession, useSupabaseClient } from "@supabase/auth-helpers-react";

export const UserContext = createContext({});

export function UserContextProvider({children}) {
export function UserContextProvider ( { children } ) {
const session = useSession();
const supabase = useSupabaseClient();
const [profile,setProfile] = useState(null);

useEffect(() => {
if (!session?.user?.id) {
return;
}
if (!session?.user?.id) { return; };
supabase.from('profiles')
.select()
.eq('id', session.user.id)
Expand All @@ -20,8 +19,8 @@ export function UserContextProvider({children}) {
}, [session?.user?.id]);

return (
<UserContext.Provider value={{profile}}>
{children}
<UserContext.Provider value={{ profile }}>
{ children }
</UserContext.Provider>
);
}
};
9 changes: 8 additions & 1 deletion pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Global imports
import React, { useState } from 'react';
import { AppProps } from 'next/app';

// Styling imports
import '../styles/globals.css';
Expand All @@ -12,8 +13,14 @@ import { useRouter } from 'next/router';

// On-Chain session provider
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; // For Lens graphql queries
// import { ChakraProvider } from '@chakra-ui/react'; -> We're replacing the chakra lens feed (for now) with <Card /> from `./components/`
import { ChainId, ThirdwebProvider } from '@thirdweb-dev/react';
// import { StateContextProvider } from "../context/proposals";
// import { MoralisProvider } from "react-moralis";

// Anomaly/Generator Providers
import 'bootstrap/dist/css/bootstrap.min.css';
import 'rc-slider/assets/index.css';
import 'rc-tooltip/assets/bootstrap.css';

function MyApp({ Component, pageProps }) {
const router = useRouter();
Expand Down
2 changes: 1 addition & 1 deletion pages/gallery/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export default function GalleryIndex () {
.storage
.from('images')
.upload(session?.user?.id + '/' + uuidv4(), file);

// send request to Flask with url of (session?.user?.id + '/' + uuidv4(), file)
if (data) {
getImages();
} else {
Expand Down
6 changes: 5 additions & 1 deletion pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import { useSession } from "@supabase/auth-helpers-react";
import Link from "next/link";
import React from "react";

export default function Home() {
const session = useSession();

return (
<div>Entry point to client</div>
<>
<div>Entry point to client</div>
<Link href='/posts'>Test</Link>
</>
)
}
51 changes: 0 additions & 51 deletions pages/journal/index.tsx

This file was deleted.

65 changes: 0 additions & 65 deletions pages/planets/mars.tsx

This file was deleted.

Loading

1 comment on commit be57978

@Gizmotronn
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#28

Please sign in to comment.