Skip to content

Commit 3eb7431

Browse files
committed
🩶🛴 ↝ Working to integrate initialClassification routes
1 parent f386bfa commit 3eb7431

17 files changed

+1285
-2619
lines changed
+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
import { ReactNode, useEffect } from 'react';
2+
import Link from 'next/link';
3+
import { Auth, ThemeSupa } from '@supabase/auth-ui-react';
4+
import { useSession, useSupabaseClient } from '@supabase/auth-helpers-react';
5+
import { useRouter } from 'next/router';
6+
7+
export function SupabaseAuthWrapper({ children }: { children: ReactNode }) {
8+
return (
9+
<div className='flex min-h-full flex-col justify-center pt-10 sm:px-6 lg:px-8'>
10+
<div className='sm:mx-auto sm:w-full sm:max-w-md'>
11+
<div className='bg-white py-8 px-4 shadow-xl ring-1 ring-gray-900/10 sm:rounded-lg sm:px-10 dark:bg-white dark:text-gray-900'>
12+
<div className='-mt-8'>
13+
{children}
14+
</div>
15+
</div>
16+
</div>
17+
</div>
18+
);
19+
};
20+
21+
interface AuthPageProps {
22+
children: ReactNode;
23+
}
24+
25+
export function AuthPage({ children }: AuthPageProps) {
26+
// const history = useHistory();
27+
const session = useSession();
28+
const router = useRouter();
29+
30+
// useEffect(() => {
31+
// if (session) {
32+
// router.push('/')
33+
// }
34+
// }, [session, history]);
35+
36+
return (
37+
<SupabaseAuthWrapper>
38+
{children}
39+
</SupabaseAuthWrapper>
40+
);
41+
};
42+
43+
export default function LoginPage() {
44+
const supabase = useSupabaseClient();
45+
46+
return (
47+
<AuthPage>
48+
<Auth supabaseClient={supabase} appearance={{ theme: ThemeSupa }} theme='dark' />
49+
<br />
50+
<span className='text-sm font-medium text-gray-900 dark:text-gray-900'>
51+
Don't have an account yet?{' '}
52+
<Link href='/signup' className='underline'>
53+
go to signup
54+
</Link>
55+
.
56+
</span>
57+
<br />
58+
</AuthPage>
59+
);
60+
};
+162
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
import Image from "next/image";
2+
import Link from "next/link";
3+
4+
import { formatDateString } from "../../../lib/threads";
5+
// Import for deleting a post
6+
7+
interface Props {
8+
id: string;
9+
currentUserId: string;
10+
parentId: string | null;
11+
content: string;
12+
author: {
13+
name: string;
14+
image: string;
15+
id: string;
16+
};
17+
community: {
18+
id: string;
19+
name: string;
20+
image: string;
21+
} | null;
22+
createdAt: string;
23+
comments: {
24+
author: {
25+
image: string;
26+
};
27+
}[];
28+
isComment?: boolean;
29+
};
30+
31+
function PostCard({
32+
id,
33+
currentUserId,
34+
parentId,
35+
content,
36+
author,
37+
community,
38+
createdAt,
39+
comments,
40+
isComment,
41+
}: Props) {
42+
return (
43+
<article
44+
className={`flex w-full flex-col rounded-xl ${
45+
isComment ? "px-0 xs:px-7" : "bg-dark-2 p-7"
46+
}`}
47+
>
48+
<div className='flex items-start justify-between'>
49+
<div className='flex w-full flex-1 flex-row gap-4'>
50+
<div className='flex flex-col items-center'>
51+
<Link href={`/profile/${author.id}`} className='relative h-11 w-11'>
52+
<Image
53+
src={author.image}
54+
alt='user_community_image'
55+
fill
56+
className='cursor-pointer rounded-full'
57+
/>
58+
</Link>
59+
60+
<div className='thread-card_bar' />
61+
</div>
62+
63+
<div className='flex w-full flex-col'>
64+
<Link href={`/profile/${author.id}`} className='w-fit'>
65+
<h4 className='cursor-pointer text-base-semibold text-light-1'>
66+
{author.name}
67+
</h4>
68+
</Link>
69+
70+
<p className='mt-2 text-small-regular text-light-2'>{content}</p>
71+
72+
<div className={`${isComment && "mb-10"} mt-5 flex flex-col gap-3`}>
73+
<div className='flex gap-3.5'>
74+
<Image
75+
src='/assets/heart-gray.svg'
76+
alt='heart'
77+
width={24}
78+
height={24}
79+
className='cursor-pointer object-contain'
80+
/>
81+
<Link href={`/thread/${id}`}>
82+
<Image
83+
src='/assets/reply.svg'
84+
alt='heart'
85+
width={24}
86+
height={24}
87+
className='cursor-pointer object-contain'
88+
/>
89+
</Link>
90+
<Image
91+
src='/assets/repost.svg'
92+
alt='heart'
93+
width={24}
94+
height={24}
95+
className='cursor-pointer object-contain'
96+
/>
97+
<Image
98+
src='/assets/share.svg'
99+
alt='heart'
100+
width={24}
101+
height={24}
102+
className='cursor-pointer object-contain'
103+
/>
104+
</div>
105+
106+
{isComment && comments.length > 0 && (
107+
<Link href={`/thread/${id}`}>
108+
<p className='mt-1 text-subtle-medium text-gray-1'>
109+
{comments.length} repl{comments.length > 1 ? "ies" : "y"}
110+
</p>
111+
</Link>
112+
)}
113+
</div>
114+
</div>
115+
</div>
116+
</div>
117+
118+
{!isComment && comments.length > 0 && (
119+
<div className='ml-1 mt-3 flex items-center gap-2'>
120+
{comments.slice(0, 2).map((comment, index) => (
121+
<Image
122+
key={index}
123+
src={comment.author.image}
124+
alt={`user_${index}`}
125+
width={24}
126+
height={24}
127+
className={`${index !== 0 && "-ml-5"} rounded-full object-cover`}
128+
/>
129+
))}
130+
131+
<Link href={`/thread/${id}`}>
132+
<p className='mt-1 text-subtle-medium text-gray-1'>
133+
{comments.length} repl{comments.length > 1 ? "ies" : "y"}
134+
</p>
135+
</Link>
136+
</div>
137+
)}
138+
139+
{!isComment && community && (
140+
<Link
141+
href={`/communities/${community.id}`}
142+
className='mt-5 flex items-center'
143+
>
144+
<p className='text-subtle-medium text-gray-1'>
145+
{formatDateString(createdAt)}
146+
{community && ` - ${community.name} Community`}
147+
</p>
148+
149+
<Image
150+
src={community.image}
151+
alt={community.name}
152+
width={14}
153+
height={14}
154+
className='ml-1 rounded-full object-cover'
155+
/>
156+
</Link>
157+
)}
158+
</article>
159+
);
160+
}
161+
162+
export default PostCard;

components/Public/LandingContent.tsx

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
2+
3+
export const navigation = [
4+
{
5+
name: 'Litepaper', href: '#litepaper'
6+
},
7+
{
8+
name: 'Modules', href: '#modules'
9+
},
10+
{
11+
name: 'Documentation', href: '#documentation'
12+
},
13+
{
14+
name: 'Open Source', href: 'https://github.com/signal-k/'
15+
},
16+
];
17+
18+
export const modules = [
19+
{
20+
name: 'Planet Hunters',
21+
description: 'Employ simple data-science tools to discover real planets and add them to your collection',
22+
icon: '🪐',
23+
href: '/garden', // We should probably provide landing pages for each "module" which leads into the documentation. A good pre-cursor to the onboarding components
24+
},
25+
{
26+
name: 'Desert Exploration', // Need to come up with a more suitable name
27+
description: 'Take photos with the Mars rovers and discuss your findings with your faction',
28+
icon: '📸',
29+
href: '/garden',
30+
},
31+
{
32+
name: 'Planet Huners',
33+
description: 'Employ simple data-science tools to discover real planets and add them to your collection',
34+
icon: '🪐',
35+
href: '/garden',
36+
},
37+
{
38+
name: 'Planet Hters',
39+
description: 'Employ simple data-science tools to discover real planets and add them to your collection',
40+
icon: '🪐',
41+
href: '/garden',
42+
},
43+
];
44+
45+
export const footerNavigation = {
46+
app: [ // Possibly should add icons as well
47+
{
48+
name: 'Documentation', href: '/',
49+
},
50+
{
51+
name: 'Open-source', href: '/',
52+
},
53+
{
54+
name: 'Datasets', href: '/',
55+
},
56+
{
57+
name: 'Knowledge Base', href: '/', // Something like a public deta module of all anytype, etc
58+
},
59+
],
60+
company: [
61+
{
62+
name: 'made by Talonova Aerospace', href: 'https://talonova.space',
63+
},
64+
{
65+
name: 'a subsidiary of Talon Group', href: 'https://group.talonova.space',
66+
},
67+
{
68+
name: 'Designed by Liam Arbuckle', href: 'https://www.linkedin.com/in/liam-arbuckle-8bb257188/',
69+
},
70+
],
71+
};

components/Section/Layout.tsx

+34-8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Sidebar, { DesktopSidebar } from "./Sidebar";
22
import Navbar from "./Navbar";
33
import React, { ReactNode, useEffect, useState } from "react";
4-
import Bottombar, { CreateBar } from "../Core/BottomBar";
4+
import Bottombar from "../Core/BottomBar";
55
import { InventoryMenu } from "../Content/Inventory/ItemGroup";
66

77
interface DashboardLayoutProps {
@@ -10,11 +10,6 @@ interface DashboardLayoutProps {
1010

1111
const Layout: React.FC<DashboardLayoutProps> = ({ children }) => {
1212
const [isMobile, setIsMobile] = useState(false);
13-
const [activeView, setActiveView] = useState('home');
14-
15-
const handleTabClick = (view) => {
16-
setActiveView(view);
17-
};
1813

1914
useEffect(() => { // Check if window is defined before accessing it
2015
if (typeof window !== "undefined") {
@@ -40,7 +35,7 @@ const Layout: React.FC<DashboardLayoutProps> = ({ children }) => {
4035
{isMobile && (
4136
<div className="md:hidden overflow-y-auto h-screen p-4">
4237
<main className="h-max pb-10 grow">{children}</main>
43-
<CreateBar onTabClick={handleTabClick} />
38+
<Bottombar />
4439
</div>
4540
)}
4641
</>
@@ -49,7 +44,38 @@ const Layout: React.FC<DashboardLayoutProps> = ({ children }) => {
4944

5045
export default Layout;
5146

47+
export const LandingLayout: React.FC<DashboardLayoutProps> = ({ children }) => {
48+
const [isMobile, setIsMobile] = useState(false);
49+
50+
useEffect(() => { // Check if window is defined before accessing it
51+
if (typeof window !== "undefined") {
52+
const checkIsMobile = () => {
53+
setIsMobile(window.innerWidth <= 768);
54+
};
55+
checkIsMobile();
56+
window.addEventListener("resize", checkIsMobile);
57+
return () => {
58+
window.removeEventListener("resize", checkIsMobile);
59+
};
60+
}
61+
}, []);
5262

63+
return (
64+
<>
65+
<main className="h-max pb-10 grow pt-6">
66+
<div className="py-12">
67+
{children}
68+
</div>
69+
</main>
70+
{isMobile && (
71+
<div className="md:hidden overflow-y-auto h-screen p-4">
72+
<main className="h-max pb-10 grow">{children}</main>
73+
{/* <Bottombar /> */}
74+
</div>
75+
)}
76+
</>
77+
);
78+
};
5379

5480
export const InventoryLayout: React.FC<DashboardLayoutProps> = ({ children }) => {
5581
const [isMobile, setIsMobile] = useState(false);
@@ -72,7 +98,7 @@ export const InventoryLayout: React.FC<DashboardLayoutProps> = ({ children }) =>
7298
<>
7399
<main className="h-max pb-10 grow pt-6">
74100
<Navbar />
75-
<div className="py-5"><center><div className="py-12"><InventoryMenu setActiveTab={setActiveTab} /></div></center></div>
101+
<div className="py-8"><center><div className="py-12"><InventoryMenu setActiveTab={setActiveTab} /></div></center></div>
76102
<div className="py-12">
77103
{children}
78104
</div>

0 commit comments

Comments
 (0)