Email

What up! That’s cool that you’re learning Colemak. Very curious to hear how that goes and how you like the keyboard. I’ve gotten enough twinges from time to time that I’m pretty sure that’s in my future.

I have yet another project idea, one that is perfect for Tuesday. The MVP for my friend’s site is coming along nicely, and I notice that I really want to build myself a template for an eCommerce site using Gatsby or Next that hooks up to a headless CMS in a way that makes everything easy for a non-technical user to customize. So in the schemas, the two main building blocks are Item and Modifier:

Item has:

  • An array of Modifiers (for Sanity, I think it will actually need to be an array of NumMods and an array of TextMods, since it barfs when I try to do an array with both numbers and strings, despite what I had hoped for from reading the docs).
  • Standard eCommerce stuff like a name, description, picture, price, SKU, UPC, etc.

Modifier has:

  • Modifier name (example: BraceletOrAnklet)
  • Default value
  • An array of values [Bracelet, Anklet]
  • A description

So a bracelet/anklet might have an array of Modifiers like:
[BraceletOrAnklet, Bead Colors, ThreadType, ThreadLength] for example. Each of those modifiers would itself have an array of values; the first three would be TextMods and the last would be a NumMod.

Then we build out the Gatsby Item template so that it renders all the buttons needed, depending on what’s in the NumMod and TextMod arrays, and sends the appropriate information to the shopping cart API.

The two main things I’m looking for help from you are:

  • How to get the dropdown menus for the modifiers rendering properly. Right now I can get them working for the current MVP when all the state variables are hard-coded, but when I start doing it dynamically by pulling in Modifier arrays from GraphQL I can’t quite get it right. I’m getting weird state bugs. I’m gonna keep working on this and hopefully I’ll figure it out before Tuesday. I’ll keep you posted.

  • Help finding a shopping cart API that works for this. Snipcart has 2 problems that together make this not doable (I believe):

  1. Parts of the BuyButton have to be hard-coded. For example, this works:

<BuyButton

data-item-id={item.id}

But this does not:

const snipCartWorkAround = “data-item-id”
<BuyButton

{snipCartWorkAround}={item.id}

  1. So normally no worries, right? You just call a <BuyButton> function and then build it out in that function. But for some reason BuyButton can’t be built by a function call like most React elements; it has to be built in the main return() call of the page. It’s super weird, and irritating: it jacks up my nice pristine flow of function calls in my main return() statement. So (1) and (2) together mean I can’t dynamically change the BuyButton, and therefore can’t dynamically vary what gets sent to the shopping cart depending on the GraphQL pull. Which means that even if I do figure out what I’m doing wrong and get my nice flexible ItemPageTemplate working, I still need to find a new API (or learn what I’m missing in Snipcart).

If I can get it all working, it would be a great setup for a non-technical user: they just enter in the different modifiers for their different items and they’re good, without a programmer ever having to customize the build for them outside of CSS/layout.

Canada update: the GOP abortion ban in Texas got me pissed off enough that it made me realize I’m not comfortable leaving when other people have to stay. I’ve got no wife and no kids, a law degree, and as much as this stuff drives me crazy I do like a good fight. So for now I’m going to stay, I’ll still get the camper because fuck buying a house in a red state, and I’ll probably spend the winter in Austin and then head out to CO or CA.

But! I did find the former law firm of the Canadian reddit lawyer I was telling you about. He has moved on to a policy job but the law firm seems good. They’re at elgincannon.com. When I emailed them, they asked me to answer these questions:

  • Why do you want to move to Canada?
  • Would you like to work or study in Canada?
  • Have you by any chance set up your express entry profile or have you calculated your CRS score?
  • Can you please provide us your resume?

So those would be the things they’re looking for if you’re still interested. How are you feeling about all that these days?

Also, the ADHD coaching stuff continues. I finally got a 30-minute consultation with Dusty Chipura, “the Henry Rollins of ADHD coaches,” which was awesome. She’s full up but referred me to Liam “Danger”  Park 🤠 I don’t know what their deal is with the WWE-style nicknames but I’m here for it. Liam and I had a good talk and we’ll have our first session Friday. And Dusty has an online community space she’s building out that seems really interesting. I’ll keep you posted. How’s that all been for you? Still looking into the meds? I find myself coming around on them.

Hope all is well in Seattle! Talk to you soon.

Best,

Chris

Notes

Todo

  • [ ]