diff --git a/.DS_Store b/.DS_Store index 353a86c2..2939bfc4 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/assets/create-campaign.svg b/assets/create-campaign.svg deleted file mode 100644 index d9c67303..00000000 --- a/assets/create-campaign.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/assets/dashboard.svg b/assets/dashboard.svg deleted file mode 100644 index b9ecf4cf..00000000 --- a/assets/dashboard.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/assets/index.js b/assets/index.js deleted file mode 100644 index 49dff30b..00000000 --- a/assets/index.js +++ /dev/null @@ -1,31 +0,0 @@ -import createCampaign from './create-campaign.svg'; -import dashboard from './dashboard.svg'; -import logo from './logo.svg'; -import logout from './logout.svg'; -import payment from './payment.svg'; -import profile from './profile.svg'; -import sun from './sun.svg'; -import withdraw from './withdraw.svg'; -import tagType from './type.svg'; -import search from './search.svg'; -import menu from './menu.svg'; -import money from './money.svg'; -import loader from './loader.svg'; -import thirdweb from './thirdweb.png'; - -export { - tagType, - createCampaign, - dashboard, - logo, - logout, - payment, - profile, - sun, - withdraw, - search, - menu, - money, - loader, - thirdweb, -}; diff --git a/assets/loader.svg b/assets/loader.svg deleted file mode 100644 index 476b2dd4..00000000 --- a/assets/loader.svg +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/assets/logo.svg b/assets/logo.svg deleted file mode 100644 index ad1ca4ba..00000000 --- a/assets/logo.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/assets/logout.svg b/assets/logout.svg deleted file mode 100644 index 188cf3b3..00000000 --- a/assets/logout.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/assets/menu.svg b/assets/menu.svg deleted file mode 100644 index 4685dfbc..00000000 --- a/assets/menu.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/assets/money.svg b/assets/money.svg deleted file mode 100644 index 8bf7f8e5..00000000 --- a/assets/money.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/assets/payment.svg b/assets/payment.svg deleted file mode 100644 index b0623289..00000000 --- a/assets/payment.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/assets/profile.svg b/assets/profile.svg deleted file mode 100644 index 0558003e..00000000 --- a/assets/profile.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/assets/search.svg b/assets/search.svg deleted file mode 100644 index 7155623f..00000000 --- a/assets/search.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/assets/sun.svg b/assets/sun.svg deleted file mode 100644 index 89ed57d6..00000000 --- a/assets/sun.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/assets/thirdweb.png b/assets/thirdweb.png deleted file mode 100644 index 2c64711f..00000000 Binary files a/assets/thirdweb.png and /dev/null differ diff --git a/assets/type.svg b/assets/type.svg deleted file mode 100644 index f8eac581..00000000 --- a/assets/type.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/assets/withdraw.svg b/assets/withdraw.svg deleted file mode 100644 index 29d8019b..00000000 --- a/assets/withdraw.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/components/Data/AccountAvatar.tsx b/components/Data/AccountAvatar.tsx deleted file mode 100644 index 8c5b2ca7..00000000 --- a/components/Data/AccountAvatar.tsx +++ /dev/null @@ -1,95 +0,0 @@ -import React, { useState, useEffect } from "react"; -import { useSupabaseClient } from "@supabase/auth-helpers-react"; -import { Database } from "../../utils/database.types"; - -type Profiles = Database['public']['Tables']['profiles']['Row'] - -export default function AccountAvatar ({ - uid, - url, - size, - onUpload -}: { - uid: string, - url: Profiles['avatar_url'] - size: number - onUpload: (url: string) => void -}) { - const supabase = useSupabaseClient(); - const [avatarUrl, setAvatarUrl] = useState(null); - const [uploading, setUploading] = useState(false); - useEffect(() => { - if (url) downloadImage(url); - }, [url]); - - async function downloadImage(path: string) { // Get the avatar url from Supabase for the user (if it exists) - try { - const { data, error } = await supabase.storage.from('avatars').download(path); - if (error) { - throw error; - }; - const url = URL.createObjectURL(data); - setAvatarUrl(url); - } catch (error) { - console.log('Error downloading image: ', error) - } - } - - const uploadAvatar: React.ChangeEventHandler = async (event) => { - try { - setUploading(true); - if (!event.target.files || event.target.files.length === 0) { // If there is no file selected - throw new Error('You must select an image to upload'); - }; - - const file = event.target.files[0]; - const fileExt = file.name.split('.').pop(); - const fileName = `${uid}.${fileExt}`; - const filePath = `${fileName}`; - let { error: uploadError } = await supabase.storage - .from('avatars') - .upload(filePath, file, { upsert: true }) - if (uploadError) { - throw uploadError; - }; - - onUpload(filePath); - } catch (error) { - alert('Error uploading avatar, check console'); - console.log(error); - } finally { - setUploading(false); - } - } - - return ( -
- {avatarUrl ? ( - Avatar - ) : ( -
- )} -
- - -
-
- ); -} \ No newline at end of file diff --git a/components/Data/OffchainAccount.tsx b/components/Data/OffchainAccount.tsx deleted file mode 100644 index 99eb02a0..00000000 --- a/components/Data/OffchainAccount.tsx +++ /dev/null @@ -1,337 +0,0 @@ -import React, { useState, createRef, useEffect } from "react"; -import { useUser, useSupabaseClient, Session } from "@supabase/auth-helpers-react"; -import { Database } from '../../utils/database.types'; -import AccountAvatar from "./AccountAvatar"; -import { imagesCdnAddress } from "../../constants/cdn"; -import { v4 as uuidv4 } from 'uuid'; -import Link from "next/link"; -import { Container, Form, Button, Row, Col, Card } from "react-bootstrap"; -import PlanetEditor from "../../pages/generator/planet-editor"; -import { useScreenshot } from "use-react-screenshot"; - -type Profiles = Database['public']['Tables']['profiles']['Row']; -type Planets = Database['public']['Tables']['planets']['Row']; - -export default function OffchainAccount({ session }: { session: Session}) { - const supabase = useSupabaseClient(); - const user = useUser(); - const [loading, setLoading] = useState(true); - const [username, setUsername] = useState(null); - const [website, setWebsite] = useState(null); // I believe this is the email field - const [avatar_url, setAvatarUrl] = useState(null); - const [address, setAddress] = useState(null); // This should be set by the handler eventually (connected address). - const [images, setImages] = useState([]); - - // User planet - const [userIdForPlanet, setUserIdForPlanet] = useState(null); - const [planetGeneratorImage, setPlanetGeneratorImage] = useState(null); - - const ref = createRef(); - let width = '100%' - const [image, takeScreenShot] = useScreenshot(); - - const getImage = () => takeScreenShot(ref.current); - - useEffect(() => { - getProfile(); - console.log(user.id) - }, [session]); - - async function getProfile() { - try { - setLoading(true); - if (!user) throw new Error('No user authenticated'); - let { data, error, status } = await supabase - .from('profiles') - .select(`username, website, avatar_url, address`) - .eq('id', user.id) - .single() - - if (error && status !== 406) { - throw error; - } - - if (data) { - setUsername(data.username); - setWebsite(data.website); - setAvatarUrl(data.avatar_url); - setAddress(data.address); - } - } catch (error) { - alert('Error loading your user data'); - console.log(error); - } finally { - setLoading(false); - } - } - - async function updateProfile({ - username, - website, - avatar_url, - address, - } : { - username: Profiles['username'] - website: Profiles['website'] - avatar_url: Profiles['avatar_url'] - address: Profiles['address'] - }) { - try { - setLoading(true); - if (!user) throw new Error('No user authenticated!'); - const updates = { - id: user.id, - username, - website, - avatar_url, - address, - updated_at: new Date().toISOString(), - } - let { error } = await supabase.from('profiles').upsert(updates); - if (error) throw error; - alert('Off-chain Profile updated'); - } catch (error) { - alert('Error updating your profile data:'); - console.log(error); - } finally { - setLoading(false); - } - } - - // Gallery components - // Retrieving gallery data for user - async function getImages() { - const { data, error } = await supabase - .storage - .from('images') - .list(user?.id + '/', { - limit: 100, // Get 100 images from this dir - offset: 0, - sortBy: { - column: 'name', - order: 'asc' - } - }); - - if ( data !== null ) { - setImages(data); - } else { - alert('Error loading images'); - console.log(error); - } - } - - async function uploadImage(e) { - let file = e.target.files[0]; - const { data, error } = await supabase - .storage - .from('images') - .upload(user.id + '/' + uuidv4(), file); - - if (data) { - getImages(); - } else { - console.log(error); - } - } - - async function uploadScreenshot(e) { - let file = image + '.png'; - const { data, error } = await supabase - .storage - .from('images') - .upload(user.id + '/' + uuidv4(), file); - - if (data) { - getImages(); - } else { - console.log(error); - } - } - - async function deleteImage (imageName) { - const { error } = await supabase - .storage - .from('images') - .remove([ user.id + '/' + imageName ]) - - if (error) { - alert (error); - } else { - getImages(); - } - } - - useEffect(() => { - if (user) { // Only get images IF the user exists and is logged in - getImages(); // Add a getPosts function to get a user's profile posts - } - }, [user]); - - function convertURIToImageData(URI) { - return new Promise(function(resolve, reject) { - if (URI == null) return reject(); - var canvas = document.createElement('canvas'), - context = canvas.getContext('2d'), - image = new Image(); - image.addEventListener('load', function() { - canvas.width = image.width; - canvas.height = image.height; - context.drawImage(image, 0, 0, canvas.width, canvas.height); - resolve(context.getImageData(0, 0, canvas.width, canvas.height)); - }, false); - image.src = URI; - }); - } - - /* PLANET manipulation */ - async function createPlanet({ // Maybe we should add a getPlanet (getUserPlanet) helper as well? - userId, temperature, radius, date, ticId - } : { - //id: Planets['id'] - userId: Planets['userId'] // Check to see if this page gets the userId as well, or just the username. Foreign key still works regardless - temperature: Planets['temperature'] - radius: Planets['radius'] - date: Planets['date'] - ticId: Planets['ticId'] - }) { - try { - setLoading(true); - // Is the planet ID going to be based on the user id (obviously not in production, but in this version?) - const newPlanetParams = { - id: user.id, // Generate a random id later - // .. other params from database types - } - } catch (error) { - console.log(error); - } finally { - setLoading(false); - } - } - - async function getUserPlanet() { - try { - setLoading(true); - if (!user) throw new Error('No user authenticated'); - let { data, error, status } = await supabase - .from('planets') - .select(`id, userId, temperature, radius, ticId`) - .eq('userId', username) - .single() - - if (error && status !== 406) { - throw error; - } - - if (data) { - setUserIdForPlanet(data.userId); - } - } catch (error) { - console.log(error); - } finally { - setLoading(false); - } - } - - return ( -
- { - setAvatarUrl(url) - updateProfile({ username, website, avatar_url: url, address}) - }} - /> -
- - -

-
- - setUsername(e.target.value)} - /> -

-
- - setWebsite(e.target.value)} - />
-

-
- - setAddress(e.target.value)} - /> -

-
- -

-
- -
- {"ScreenShot"} -
} - style={{ - border: "1px solid #ccc", - padding: "10px", - marginTop: "20px" - }} - > - -
-
- - <> -

Your photos


-

Upload image of your model for analysis

- - uploadImage(e)} /> -
- -



-

Your images

- - {images.map((image) => { - return ( - - - - - - - - - ) - })} - - -
-
- -
-
- ) -} \ No newline at end of file diff --git a/components/FeedPost.tsx b/components/FeedPost.tsx deleted file mode 100644 index 92b2910f..00000000 --- a/components/FeedPost.tsx +++ /dev/null @@ -1,47 +0,0 @@ -import { MediaRenderer } from '@thirdweb-dev/react'; -import Link from 'next/link'; -import React from 'react'; -import { ExplorePublicationsQuery } from '../graphql/generated'; -import styles from '../styles/FeedPost.module.css'; -import { useComments } from '@lens-protocol/react'; - -type Props = { - publication: ExplorePublicationsQuery["explorePublications"]["items"][0]; -} - -export default function FeedPost ({publication}: Props) { - var postId = publication.id; - - return ( -
-
- - - {publication.profile.name || publication.profile.handle} - -
-
-

{publication.metadata.name}

-

{publication.metadata.content}

- - {(publication.metadata.image || publication.metadata.media?.length > 0) && ( - - )} -
-
-

{publication.stats.totalAmountOfCollects} Collects

-

{publication.stats.totalAmountOfComments} Comments

-

{publication.stats.totalAmountOfMirrors} Mirrors

-
-
- ); -}; diff --git a/components/Header.tsx b/components/Header.tsx deleted file mode 100644 index 1f51a5e0..00000000 --- a/components/Header.tsx +++ /dev/null @@ -1,40 +0,0 @@ -import Link from "next/link"; -import React from "react"; -import styles from '../styles/Header.module.css'; -import SignInButton from "./SignInButton"; - -export default function Header () { - return ( - <> -
-
- - logo - - - 🚀 - - - ⌚️ - - - 🪐 {/* Make submenu items */} - - - 🎨 - - - 🌌 - - - ⛓ - -
-
- -
-
-
- - ) -} \ No newline at end of file diff --git a/components/Layout.tsx b/components/Layout.tsx index a36ed4d9..03b85c66 100644 --- a/components/Layout.tsx +++ b/components/Layout.tsx @@ -1,15 +1,23 @@ import NavigationCard from "./Sidebar"; import styles from '../../styles/social-graph/Home.module.css'; -export default function Layout({ children }) { -
-
-
{/* Sidebar */} - -
-
- {children} -
+export default function Layout({children,hideNavigation}) { + let rightColumnClasses = ''; + if (hideNavigation) { + rightColumnClasses += 'w-full'; + } else { + rightColumnClasses += 'mx-4 md:mx-0 md:w-9/12'; + } + return ( +
+ {!hideNavigation && ( +
+ +
+ )} +
+ {children}
-
+
+ ); } \ No newline at end of file diff --git a/components/Navigation/NavHoverBox.js b/components/Navigation/NavHoverBox.js deleted file mode 100644 index d9a78b2d..00000000 --- a/components/Navigation/NavHoverBox.js +++ /dev/null @@ -1,40 +0,0 @@ -import React from 'react' -import { - Flex, - Heading, - Text, - Icon -} from '@chakra-ui/react' - -export default function NavHoverBox({ title, icon, description }) { - return ( - <> - - - - {title} - {description} - - - ) -} \ No newline at end of file diff --git a/components/Navigation/NavItem.js b/components/Navigation/NavItem.js deleted file mode 100644 index 1c87be85..00000000 --- a/components/Navigation/NavItem.js +++ /dev/null @@ -1,48 +0,0 @@ -import React from 'react'; -import { - Flex, - Text, - Icon, - Link, - Menu, - MenuButton, - MenuList -} from '@chakra-ui/react'; -import NavHoverBox from './NavHoverBox'; - -export default function NavItem({ icon, title, description, active, navSize }) { - return ( - - - - - - - {title} - - - - - - - - - ) -} \ No newline at end of file diff --git a/components/Navigation/Sidebar.js b/components/Navigation/Sidebar.js deleted file mode 100644 index e4a74f4a..00000000 --- a/components/Navigation/Sidebar.js +++ /dev/null @@ -1,106 +0,0 @@ -import React, { useState } from 'react' -import { - Flex, - Text, - IconButton, - Divider, - Avatar, - Heading -} from '@chakra-ui/react'; -import { - FiMenu, - FiHome, - FiCalendar, - FiUser, - FiDollarSign, - FiBriefcase, - FiSettings -} from 'react-icons/fi'; -import { IoPawOutline } from 'react-icons/io5'; -import NavItem from './NavItem'; -import Link from 'next/link'; - -// Getting user data for sidebar -import { useAddress, useNetworkMismatch, useNetwork, ConnectWallet, ChainId, MediaRenderer } from '@thirdweb-dev/react'; -import useLensUser from '../../lib/auth/useLensUser'; -import useLogin from '../../lib/auth/useLogin'; -import SignInButton from '../SignInButton'; - -export default function Sidebar() { - const address = useAddress(); // Detect connected wallet - const isOnWrongNetwork = useNetworkMismatch(); // Is different to `activeChainId` in `_app.tsx` - const [, switchNetwork] = useNetwork(); // Switch network to `activeChainId` - const { isSignedInQuery, profileQuery } = useLensUser(); - const { mutate: requestLogin } = useLogin(); - - const [navSize, changeNavSize] = useState("small"); - - return ( - - - } - onClick={() => { - if (navSize == "small") - changeNavSize("large") - else - changeNavSize("small") - }} - /> - - - - - - - - - - - - - Liam Arbuckle - @parselay.lens - - - - - - - - - - ) -} \ No newline at end of file diff --git a/components/Posts/MessageBoard.tsx b/components/Posts/MessageBoard.tsx deleted file mode 100644 index bf7d898e..00000000 --- a/components/Posts/MessageBoard.tsx +++ /dev/null @@ -1,21 +0,0 @@ - -import React, { useContext } from "react"; -import { Link, Outlet } from "react-router-dom"; -import { UserContextProvider } from "@supabase/auth-ui-react/dist/esm/src/components/Auth/UserContext"; - -export default function MessageBoard() { - //const userProfile = useContext(UserContext); - return ( -
- -

Message Board

- - {/*{userProfile.session ? ( - <> - ) : ( -

You'll need to to join the discussions

- )} - */} -
- ) -} \ No newline at end of file diff --git a/components/Posts/PostFormCard.tsx b/components/Posts/PostFormCard.tsx index 62ade257..17b3d35c 100644 --- a/components/Posts/PostFormCard.tsx +++ b/components/Posts/PostFormCard.tsx @@ -6,7 +6,6 @@ import Avatar, { AvatarFromTable } from "./Avatar"; import { useEffect, useState } from "react"; import { Auth, ThemeSupa } from "@supabase/auth-ui-react"; import { useSession, useSupabaseClient, useUser, Session } from "@supabase/auth-helpers-react"; -import AccountAvatar from "../Data/AccountAvatar"; import { Database } from "../../utils/database.types"; type Profiles = Database['public']['Tables']['profiles']['Row']; @@ -19,11 +18,7 @@ export default function PostFormCard () { return (
- +