Activity
Mon
Wed
Fri
Sun
Dec
Jan
Feb
Mar
Apr
May
Jun
Jul
Aug
Sep
Oct
Nov
What is this?
Less
More

Memberships

Developer Pro

Public • 140 • Free

54 contributions to Developer Pro
Help with Layout shifts in Crypto App
Hello, I need help with styling issues on the landing page of the crypto app. I've made the charts responsive, but there's a layout shift when the data loads due to the loading indicator size which is smaller than the chart size. I'm seeking assistance to ensure the loading indicator matches the chart size to prevent layout shifts. https://www.loom.com/share/de3e7d917eb04c5b8414586ed3505c6f
3
3
New comment Sep 24
Help with Layout shifts in Crypto App
0 likes • Sep 24
You can use the aspect ratio property in tailwind. Set the width of the containing div and the height will be automatically calculated based on the aspect ratio. This should stop the div collapsing when the chart isn't rendered yet.
VSC next.js question. No console log but the hook happens
edit: I figured it out but leaving the question up anyway. Below is some code I have for the crypto app. Nothing special. I'm just playing around for now to get used to it. I'm getting the bitcoin data here for now. When I fire up "npm run dev" everything happens like it should. The console prints "made it" so I know it's at least firing the getData function. However anytime I try and click the button to console log "test" nothing prints but the "up" hook does increment. So I know the function is getting called. Why does it not console log in my handleClick method but it does call the hook? "use client"; import { useState } from "react"; import { Title, MainWrapper, GraphWrapper, CoinHeaderWrapper, CoinStatsWrapper, } from "./styles"; export default function Home() { const [up, setUp] = useState(0); async function getData() { let data = await fetch( "https://api.coingecko.com/api/v3/coins/bitcoin/market_chart?vs_currency=usd&days=180&interval=daily" ); console.log("made it"); let bitCoinNumbers = await data.json(); } const handleClick = () => { setUp(up + 1); console.log("test"); }; getData(); return ( ... <button className="bg-white" onClick={handleClick}> {up} </button> ... ); }
3
6
New comment Sep 3
2 likes • Sep 1
@Bret Miller It is printing only in the browser because you are using a client component.
Longest noob to dev journey I've seen in my life
here;s the portfolio, what do you think: https://www.catalinsiegling.com/
12
42
New comment Aug 31
Longest noob to dev journey I've seen in my life
1 like • Aug 30
@Trey Delcamp wtf does the Ohio part mean 😂
1 like • Aug 30
@Cristian Florea He is delusional... Not sure exactly how to fix that but cope posting on LinkedIn probably isn't helping Honestly he could probably funnel his rage into a youtube channel complaining about the job market for junior developers and get a lot of subscribers
Counter App
Good warmup for what's to come https://codepen.io/James-R-the-sans/pen/BagxyZX?editors=0011
4
15
New comment Aug 24
5 likes • Aug 24
@James Rinella Here is an interesting article I was reminded of when I looked at your first version: https://andrewkelley.me/post/js-private-methods.html. Mind you this was written before ES6 (aka there was no class keyword in javascript). At its core you've done something like OOP where you've obscured the value and count variables behind closures (similar to having private fields in classes). I provided a cleaned up counter IIFE using arrow functions and a class-based equivalent below. ``` // class version class Counter { #count = 0; // the # means it is a private property getCount() { return this.#count; } increment() { this.#count++; } decrement() { this.#count--; } reset() { this.#count = 0; } } // IIFE version const counter = (() => { let count = 0; return { getCount: () => count, increment: () => count++, decrement: () => count--, reset: () => (count = 0) }; })(); ``` The two above are very close to equivalent. Trying to access count outside of the closure from the IIFE will just result in undefined. Trying to do it for the class version will actually throw an error. Don't mean to dogpile but I'm glad your post sparked a lot of discussion.
need help with currency select
https://github.com/RyanHazlewood0/crypto-app/pull/21 on the individual coin page my currency selector works for changing from usd to nzd, gbp or aud. using the index signature thing for dynamic properties. the data from that data point looks like this: market_data: {current_price: { usd: 5, aud: 7 } } but now im trying to make it the correct currency across the whole app including carousel, table etc but the data point which they use for price is a different one that doesn't have different currencies. it looks like this instead: current_price: 5 (only usd automatically) bit confused about how to approach it, appreciate any advice.
2
2
New comment Aug 21
2 likes • Aug 21
For the endpoints where data isn't listed for separate currencies you will have to make a different API call. I know the one used to render the table is in this category. See the "vs_currency" query string parameter: https://docs.coingecko.com/v3.0.1/reference/coins-markets
1-10 of 54
Aaron Green
5
297points to level up
@aaron-green-5972
Building a peaceful future for myself and my loved ones

Active 5d ago
Joined Dec 22, 2023
INFJ
Houston, TX
powered by