#learning them while building the app

1 messages Β· Page 1 of 1 (latest)

daring flume
#

@west ether it's the best to start an own project first, but you should also learn the fundamentals with it

#

It's like building a house. You can stack stone above each other and hope that you can make the roof and maybe it works, but that's not how to build a house πŸ˜‰

west ether
daring flume
#

not bad for the start. Do you use parallel and intercepting routes?

west ether
#

i build everything just in the main page.tsx file.

daring flume
#

ah ok. And let me guess, most of your components are client components, right?

west ether
#

this is what the UI looks like, I can't access it at the moment, sorry

#

everything was on "use client" πŸ˜…

#

wasn't working without use client, so I just used it for the whole page.tsx

daring flume
daring flume
west ether
#

Thanks, atm I need to set up these global variables and break it down to componenets

daring flume
#

global variables for..?

west ether
#

planning to do that later on, let me check my git why i started using the "use client"

#

bcs of the checkbox in the todo item

daring flume
#

ah you are right. I forgot that point. Yeah this one also needs to be an client component

#

what else is interactive in your app?

west ether
west ether
daring flume
#

do you already have a backend where you load and save the todos?

west ether
#

I'm before that point πŸ˜„

#

I learned variables and statehook with the change color theme function basically

daring flume
#

would it be helpful if I share my solution for data saving? πŸ€”

daring flume
west ether
daring flume
west ether
#

I can share my github too

daring flume
west ether
daring flume
west ether
#

πŸ₯Ή

#

wrong emoji πŸ˜…

#

sorry

daring flume
#

it's animated on the website... xD

west ether
daring flume
west ether
#

this is an older version, but it might help you with the idea

daring flume
#

your github is public?

west ether
daring flume
#

haha ah ok xD

#

when you added graphql to your project you can controll everything about the task via the data you change

west ether
daring flume
#

localstorage for an nextjs project? I think that's a little out of case. Of course you can use that, but it's like: #1162443972929667184 message

west ether
#

I am currently startijg to work with arrays and breaking down the project into components

#

for which I need global variables

#

basically taking it step by step

daring flume
#

I would not recommend it. I tried it myself and now I have everywhere stale data... and I am dying.. and my project too.. because I don't know where I have which data...

daring flume
west ether
#

I’m using NextUI

daring flume
#

do you like NextUI? I just heard about it, but never used it πŸ€”

#

what do you think about it? What do you hate and what do you love?

west ether
#

it’s still in development so thete are a couple of things that are missing, but it helped me greatly with learning how to use react etc

#

the components look bisually great there

#

visually”

#

but sometimes it’s lacking some critical functions for them

daring flume
west ether
#

will you be here in 30m @daring flume

west ether
#

I'm here. Here's the latest version @daring flume
https://github.com/jacobfreedom/first-todo-app/blob/main/src/app/ColorContext.tsx

The ColorContext file is slightly messy. I was trying a couple of ways to create it.

I tried to create it by chatgpt which wasn't working, then I tried to adjust the code myself without understanding it properly. Then I tried to create the purest and basic way of creating global state.

The last one which I'm currently using was generated by chatGPT again. I'm understanding the code now and don't think that there are any issues in it.

#

The <Nav> component is setting up the setSelectedColor.

I have wrapped my page.tsx in <ColorProvider>
then <Nav> is used.

Since I am using the "selectedColor" in page.tsx already I had to use 'useColor' there -> this might be causing the error and I thought about creating another component for rest of the code to utilize 'useColor' in another component. Not sure if this is what's causing the error.

I tried consolelogging the render and I already get the useColor must be used within a ColorProvider, before it even starts rendering the <Nav>

west ether
#

For me it would basically be using <Button> from some library without knowing how to build it myself using CSS if it makes sense

daring flume
west ether
#

ye it's private give me a second

daring flume
daring flume
west ether
#

publuc now @daring flume

daring flume
#

let quick look thought it

west ether
#

I still believe that the main issue is that the rest of the code in main.tsx is not a componenet and I'm utilising the useColor in there, but ChatGPT told me that it's not the issue

#

but majority of the times I got very bad non working suggestions from it πŸ˜…

daring flume
daring flume
west ether
#

if so I'm open to it

#

my development got completly on hold thanks to it

#

just troubleshooting

daring flume
# west ether how come?

when I try to design a button that they look like shit after I styled them... and the same is with other "easy" things

daring flume
daring flume
west ether
daring flume
#

I like your idea with the icons. Maybe I introduce it for me as well ^^

west ether
daring flume
west ether
daring flume
# west ether what's the way? πŸ˜…

I would also use a context (when it's not supported in my ui library) and then just provide and consume it. Not everything around it, what you know introduced πŸ˜„

daring flume
west ether
#

playing around with a variable that has a couple of strings in it was a great way to hop into it

west ether
#

NextUI provides me only with the FE UI componenets, so the rest is up to me

daring flume
daring flume
west ether
#

it doesn't enter backend, if it did I'd be completly lost

#

I can't even set up context properly πŸ˜‚

daring flume
daring flume
west ether
daring flume
# west ether are there any other ways? πŸ˜…

for me it currently looks like that:

                    <Link href={userDomain + page.url} target={"_blank"}>
                        <Icon height={"25px"} width={"25px"}>
                            <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 text-black">
                                <path strokeLinecap="round" strokeLinejoin="round"
                                      d="M13.5 6H5.25A2.25 2.25 0 003 8.25v10.5A2.25 2.25 0 005.25 21h10.5A2.25 2.25 0 0018 18.75V10.5m-10.5 6L21 3m0 0h-5.25M21 3v5.25"/>
                            </svg>
                        </Icon>
                    </Link>

So just the svg directly inside my component and it looks soooo messy and no one knows what kind of icon that is...

west ether
#

/objects πŸ˜„

daring flume
west ether
daring flume
west ether
daring flume
west ether
daring flume
west ether
#

basically I know what to do next, but I have no idea how to write it down

#

in a way to make it work

#

same thing as with the setcolor

west ether
#

not an expert tho πŸ˜…

daring flume
west ether
#

Do any of these things make sense?

I already know the the error occurs during rendering of the page.tsx and doesn't even reach the Nav component

daring flume
west ether
daring flume
daring flume
west ether
daring flume
west ether
west ether
#

using typescript is also making it even bigger mess for me tbh

daring flume
west ether
#

I spent too much time on it to quite now tbh

#

quit"

daring flume
west ether
#

same issue

#

I don't see any reason to start again atm, maybe only typescript πŸ˜‚

#

to get rid of all the unecesary complications for me

daring flume
west ether
#

I've got plenty of them, I'll share one with you

daring flume
west ether
west ether
daring flume
west ether
daring flume
west ether
#

I'm pretty much a newbie with github, do I have to download it and install it?

daring flume
west ether
daring flume
west ether
#

I'd like to see what it looks like in a browser

west ether
daring flume
daring flume
west ether
#

isn't your todo list mostly backend?

#

I can't find any frotned in it

daring flume
#

I just tried it myself and I get

Error: Request failed with status code 401
So unauthorized. I don't think it's possible to access the backend. And because of that the project is unusable when you don't have any backend xD

west ether
#

components

daring flume
#

and now you may see how much the backend do ^^

west ether
# daring flume but you need to switch it. From (now): first solution then I know the issue To ...

I basically did it in thhis way.

Built the whole UI, a couple of inputs, assinged the outputs to a variable, I have all the outputs and need to store them -> thing I need to learn

During this process I already faced many issues that I solved on my own, by understanding the issue and finding the solution

Then I started breaking it down in componenets where I need to utilize the context, where I already faced the first issue with not having a global state, so I found the solution on how to build it, then gained a basic understanding of it, but now it's still not working and I can't understand what the issue is.

#

I kinda understand the issue, it's with the useColor, but I don't understand what precisely is causing the error.

#

It's already happening on the page.tsx, so I have a couple of assumptions, but a confirmation of someone would be really helpful.

daring flume
#

Maybe you want to first try to ask #1089389297548931182 then you get a nearly solution and then you just refine it with your new situation. Some of my problems are already solved with that

west ether
#

found the solution, hopped on a call with one guy, was just a matter of putting my provider in the provider file πŸ˜‚

#

just placing it here, matter of 3 min πŸ˜…

daring flume
#

Haha nice, good job. You might think that the provider class is there for the providers πŸ˜‚πŸ˜œ

#

Maybe see you somewhere again. Wish you a wonderful day πŸ”₯

west ether