Skip to content

Commit

Permalink
🧊🎨 ↝ Fixed build errors & default export in build for #26
Browse files Browse the repository at this point in the history
  • Loading branch information
Gizmotronn committed Feb 28, 2023
1 parent ab6b6db commit 0ed59d1
Show file tree
Hide file tree
Showing 8 changed files with 198 additions and 13 deletions.
6 changes: 3 additions & 3 deletions components/PostCard.tsx β†’ components/PostCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ import TimeAgo from "javascript-time-ago";
TimeAgo.addDefaultLocale(en);
import ReactTimeAgo from "react-time-ago";

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

export default function PostCard ( { content, created_at, media, profiles:authorProfile } ) {
const [loading, setLoading] = useState(false);
const [avatar_url, setAvatarUrl] = useState<Profiles['avatar_url']>();
//const [avatar_url, setAvatarUrl] = useState<Profiles['avatar_url']>();
const { profile: myProfile } = useContext(UserContext);
const [profiles, setProfiles] = useState();
const supabase = useSupabaseClient();
Expand Down Expand Up @@ -136,7 +136,7 @@ export default function PostCard ( { content, created_at, media, profiles:author
<UtterancesComments />
<div className="flex mt-4 gap-3">
<div className="mt-1">
<AccountAvatar uid={session?.user!.id}
<AccountAvatar uid={session?.user?.id}
url={authorProfile?.avatar_url}
size={45} />
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Database } from "../utils/database.types";
import { UserContext } from "../context/UserContext";
import { ClimbingBoxLoader } from "react-spinners";

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

export default function PostFormCard ( { onPost } ) {
const supabase = useSupabaseClient();
Expand All @@ -16,7 +16,8 @@ export default function PostFormCard ( { onPost } ) {

const [uploads, setUploads] = useState([]);
const [isUploading, setIsUploading] = useState(false);
const [avatar_url, setAvatarUrl] = useState<Profiles['avatar_url']>();
//const [avatar_url, setAvatarUrl] = useState<Profiles['avatar_url']>();
const [avatar_url, setAvatarUrl] = useState(null);

function createPost () {
supabase.from('posts').insert({
Expand Down Expand Up @@ -45,7 +46,7 @@ export default function PostFormCard ( { onPost } ) {
})
}, []);

async function addMedia (e: { target: { files: any; }; }) {
async function addMedia (e) {
const files = e.target.files;
if (files.length > 0) {
setIsUploading(true);
Expand Down Expand Up @@ -73,7 +74,7 @@ export default function PostFormCard ( { onPost } ) {
<Card noPadding={false}>
<div className="flex gap-2">
<div>
<AccountAvatar uid={session.user!.id}
<AccountAvatar uid={session?.user?.id}
url={avatar_url}
size={60}/>
</div> { profile && (
Expand Down
6 changes: 5 additions & 1 deletion pages/posts/lens/create.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,8 @@ import { useCreatePost } from '../../../lib/useCreatePost';
import { LENS_CONTRACT_ABI, LENS_CONTRACT_ADDRESS } from '../../../constants/contracts';

// Base imports || Method to import/fork from Supabase handler
import React, { useState } from 'react';
import React, { useState } from 'react';

export default function LensCreate () {
return <div>Hello</div>;
}
2 changes: 1 addition & 1 deletion pages/posts/profile/[id].tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import ProfilePage from "../profile";
import ProfilePage from "../Profile";
import React from "react";
import { useRouter } from "next/router";

Expand Down
2 changes: 1 addition & 1 deletion pages/posts/profile/[id]/[...tab].tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import ProfilePage from "../../profile";
import ProfilePage from "../../Profile";

export default function ProfileTab () {
return <ProfilePage />;
Expand Down
4 changes: 2 additions & 2 deletions pages/posts/saved.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ export default function SavedPostsPage() {
return (
<Layout hideNavigation={false}>
<h1 className="text-6xl mb-4 text-gray-300">Saved posts</h1>
<PostCard />
<PostCard />
{/*<PostCard />
<PostCard />*/}
</Layout>
);
}
180 changes: 180 additions & 0 deletions styles/Staking-P2E/Home.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
.container {
margin-top: 96px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
width: 100%;
position: absolute;
padding: 0 24px;
}

.h1 {
margin-bottom: 0px;
}

.explain {
font-size: 1.125rem;
max-width: 1200px;
}

.divider {
width: 50%;
border-color: grey;
opacity: 0.25;
}

.smallDivider {
width: 25%;
border-color: grey;
margin-top: 64px;
opacity: 0.25;
}

.nftBoxGrid {
width: 1200px;
max-width: 95vw;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
gap: 2%;
margin-top: 28px;
flex-wrap: wrap;
}

.nftBox {
border-radius: 16px;
border: 1px solid #ccc;
width: 19%;
min-height: 200px;
padding: 16px;
}

.optionSelectBox {
border-radius: 16px;
border: 1px solid #ccc;
width: 48%;
min-height: 200px;
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding-left: 12px;
padding-right: 12px;
cursor: pointer;
}

.selectBoxTitle {
font-size: 1.75rem;
margin-top: 8px;
margin-bottom: 8px;
}

.selectBoxDescription {
color: rgba(255, 255, 255, 0.9);
margin-top: 0px;
}

/* Between 1200 and 800 */
@media only screen and (min-width: 800px) and (max-width: 1200px) {
.nftBox {
width: 49%;
margin-top: 16px;
}
}

/* beneath 800
*/
@media only screen and (max-width: 800px) {
.nftBoxGrid {
justify-content: center;
}
.nftBox {
width: 90%;
margin-top: 16px;
}
.optionSelectBox {
width: 90%;
margin-top: 16px;
}
}

.tokenGrid {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
gap: 1%;
width: 1600px;
max-width: 95vw;
flex-wrap: wrap;
margin: 16px 0;
}

.tokenItem {
width: 35%;
height: 120px;
border-radius: 16px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
border: 1px solid rgba(255, 255, 255, 0.4);
gap: 16px;
}

.tokenLabel {
margin-top: 0px;
margin-bottom: 0px;
font-weight: 600;
color: rgba(255, 255, 255, 0.7);
}

/* Second tokenLabel item */

.tokenValue {
font-size: 1.3rem;
margin-top: 8px;
margin-bottom: 0px;
font-weight: 500;
}

/* On Mobile, make tokenGrid 100% width */
@media only screen and (max-width: 850px) {
.tokenItem {
width: 90%;
margin-top: 12px;
}
}

/* Screen less than 630, then hide .center */
@media only screen and (max-width: 630px) {
.center {
display: none;
}
}

.spacerTop {
margin-top: 16px;
}

.bigSpacerTop {
margin-top: 32px;
}

.spacerBottom {
margin-bottom: 16px;
}

.detailPageHr {
margin-top: 0px;
margin-bottom: 32px;
}

.nftMedia {
width: 100%;
max-height: 300px;
border-radius: 15px;
}
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@
"incremental": true
},
"exclude": ["node_modules"],
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", "components/PostFormCard.tsx", "constants/contracts.ts", "pages/posts/index.jsx", "pages/generator/planet-editor.jsx", "pages/generator/planet-editor.jsx", "components/Lens/Utterances.jsx", "components/Lens/Utterances.jsx", "components/Posts/ProfileCard.tsx", "components/Posts/ProfileCard.tsx", "context/UserContext.js", "context/UserContext.js", "components/PostCard.jsx", "components/PostCard.jsx" ]
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", "components/PostFormCard.jsx", "constants/contracts.ts", "pages/posts/index.jsx", "pages/generator/planet-editor.jsx", "pages/generator/planet-editor.jsx", "components/Lens/Utterances.jsx", "components/Lens/Utterances.jsx", "components/Posts/ProfileCard.tsx", "components/Posts/ProfileCard.tsx", "context/UserContext.js", "context/UserContext.js", "components/PostCard.jsx", "components/PostCard.jsx" ]
}

0 comments on commit 0ed59d1

Please sign in to comment.