signal-k / client Goto Github PK
View Code? Open in Web Editor NEWFrontend for viewing citizen science proposals on Lens Protocol
Home Page: https://starsailors.space
Frontend for viewing citizen science proposals on Lens Protocol
Home Page: https://starsailors.space
Currently, if the user's connected and on the Polygon -> Mumbai network, their profile picture shows. However, all Lens interactions require the user to be on Polygon -> Mainnet (at least for now, in the future we'll build on top of the Lens Mumbai network as well). I've taken a look through the constants scripts and can't find anything (this could be related to the Supabase issue where the [...thirdweb].js
supabase interaction wasn't working because it was forcefully connecting to the Rinkeby network: Signal-K/sytizen#16).
Firstly, comments shouldn't show up on the post feed -> they should show up below posts.
This is a rendering issue where the individual lines in the codesnippet are quite long and stretch out further than the width of the screen (let alone the container they're supposed to be contained in). Likely will need to edit components/PostFeed.tsx
Another issue that has come up here is that now the sidebar isn't able to be interacted with on my profile page, which houses the large comment. At first I thought this could be the result of some dependency mixups (I'm adding some new features, see commit below) but the sidebar works fine on the index page and on other profiles without this overlap error. So let's try and figure out a way to filter out/minimise large posts
Page:
Index (starprotocol.vercel.app)
Problem:
At least half of the first post in the feed is cut off, possibly more are hidden
Likely cause:
Feed items hidden behind heading
Notes:
Feed is still very much a WIP, as when released it will show posts from users that are being followed by the logged-in user
(maybe we could have two modes, where it shows all posts (from all appId
s) in a user's feed, and then only posts/publications that are proposals).
Also, the content in #5 needs to be moved into a separate folder/directory called "final
" so that the existing work-in-progress status is not removed.
Extend the "Post" component/table to allow for full length journal articles
See in pages/planets/[id].tsx
:
const [isMobile, setIsMobile] = useState(false);
useEffect(() => {
if (typeof window !== "undefined") {
const checkIsMobile = () => {
setIsMobile(window.innerWidth <= 768);
};
checkIsMobile();
window.addEventListener("resize", checkIsMobile);
return () => {
window.removeEventListener("resize", checkIsMobile);
};
}
}, []);
if (!id) {
return null;
};
if (isMobile) {
return (
<LayoutNoNav>
<IndividualBasePlanet id={id as string} />
</LayoutNoNav>
);
};
While in the main <Layout>
component in components/Section/Layout.tsx
:
const Layout: React.FC<DashboardLayoutProps> = ({ children }) => {
const [isMobile, setIsMobile] = useState(false);
useEffect(() => { // Check if window is defined before accessing it
if (typeof window !== "undefined") {
const checkIsMobile = () => {
setIsMobile(window.innerWidth <= 768);
};
checkIsMobile();
window.addEventListener("resize", checkIsMobile);
return () => {
window.removeEventListener("resize", checkIsMobile);
};
}
}, []);
return (
<>
<main className="h-max pb-10 grow pt-6">
<Navbar />
<div className="py-12">
{children}
</div>
</main>
{isMobile && (
<div className="md:hidden overflow-y-auto h-screen p-4">
<main className="h-max pb-10 grow">{children}</main>
<Bottombar />
</div>
)}
</>
);
};
export default Layout;
This could cause problems, I just noticed this when I was creating the route for individual sectors. We need to define a coherent syntax for mobile configuration before this new repo gets messy.
<awaiting jira/plane linked issue tag>
Used in the sidebar
Currently creating a new test next template to see if this issue persists. If it does, it's something to do with the version/package management (likely) and I'll ignore it before merging it back in with wb3-10
. Will keep this issue updated.
First up, we've got an issue that I'm assuming is related to our database.types.ts
or potentially with our Lens client (however I'm doubting that is the case because when using the Lens client as a standalone NextJs app we're not getting that error AFAIK).
error - unhandledRejection: {
code: '22P02',
details: null,
hint: null,
message: 'invalid input syntax for type uuid: "undefined"'
}```
We just need to look through the `profiles`, `planets`, `posts`, & `articles` tables to find any references in the current codebase to `uuid` type entries and see if we've got any calls to those Supabase/postgres fields that are causing this issue.
Second issue:
https://user-images.githubusercontent.com/31812229/221401121-d3d2cf16-3a27-4248-9075-a23699598fbd.mov
What's going on here?
1. For some reason, clicking on some of the tabs on a planet results in an "undefined" tag replacing the `id` slug from the `planets` table. This might be related to the above issue
2. Clicking on the tabs on a planet doesn't change what data/contents is shown. This could again be because of the invalid input syntax issue. I'll create a copy of this section, but again for the `profiles` table with the same behaviour as the pages in `/posts/profile` to see what's going on.
Third issue:
Upserting data isn't working -> see `function claimPlanet` in `pages/planets/planet.tsx` (this should be moved into one of the tabs once we fix the second issue
```ts
function claimPlanet () {
supabase.from('planets').upsert({
'id': planetId,
//'userId': 'profile?.username',
'ownerId': session?.user?.id,
})
}
For now, I'm just working around this by setting up certain content/div tags/elements to show only if the user owns the anomaly/object they're viewing, and will add the XP section next.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.