Giuliopime
Explore posts from serversTTCTheo's Typesafe Cult
•Created by Giuliopime on 6/17/2024 in #questions
Dialog shadcn not showing up as a dialog but just as content
6 replies
TTCTheo's Typesafe Cult
•Created by Giuliopime on 6/9/2024 in #questions
nextjs api route request.query is undefined
logs:
I followed the docs and req.query should be
{}
by default but here is undefined
, why?4 replies
TTCTheo's Typesafe Cult
•Created by Giuliopime on 4/22/2024 in #questions
how to properly compare enums and interface unions?
I have the following function in my api client:
I now need to use it in my react component:
Here
query.value
will be a union of IxUser | IxApiException
How can I check for the type and conditionally render something in react?
I can't use instanceOf either on IxUser (because it's an interface) or IxApiException
'cause it's an enum:
Am I approaching this whole typing thing wrongly in typescript? Coming from different languages this is how I would usually structure things but here it seems really hard to use those types2 replies
TTCTheo's Typesafe Cult
•Created by Giuliopime on 4/16/2024 in #questions
Animating a background moving between grid elements
I made this simple switch but I wanna animate the background moving from left to right instead of having it disappear and reappear.
Right now the background is just a css class applied when the item is active, but I was thinking of creating a grid item that overlaps the other two with the same width to achieve this. Couldn't get it working though, any tips on how I can do this?
This is my current component
8 replies
How to get previous route from inside a page?
I have a login page and I need to save the previous route before the user navigated to
/login
so I can then redirect him there after logging in. It's a simple thing but I looked everywhere and can't see to find the navigation stack data anywhere. Can anyone delucidate me on this? thxxx9 replies
TTCTheo's Typesafe Cult
•Created by Giuliopime on 10/20/2023 in #questions
Guide on how to make such a css effect
I'm looking for a generic guide on which css features to use to make something like this?
Can this all be made via a simple background or does it require multiple html elements?
Anyone did something like this before?
7 replies
TTCTheo's Typesafe Cult
•Created by Giuliopime on 10/17/2023 in #questions
Border that transitions trough row of elements
How do I animate a border between a row of items? I provided a sample from the JetBrains website.
I know how to do this with js by manually calculating padding via button sizes, but I was wondering if there was a more "sleek" way of doing this with html and css directly (or react / svelte whatevs)
10 replies