Liam B
Liam B
TTCTheo's Typesafe Cult
Created by Liam B on 8/7/2024 in #questions
How are y'all handling custom icons?
I never need them frequently enough to actually set up my own template, but boy everytime I need them i wish I had. Curious how everyone's dealing with custom icons? I just really want SVG optimising, auto component creation, and intellisense to work - or in summary the Lucide repo in it's simplest form.
4 replies
TTCTheo's Typesafe Cult
Created by Liam B on 9/18/2023 in #questions
Detect a change to the session and update accordingly?
I'm trying to integrate Intercom with my create-t3-app and having some difficulty with users logged in vs visitors. I can get Intercom to update when a user logs in or out, but I'm trying to figure out how to connect it to the actual session - if a logged in user returns to my application for example. I also have an issue where Intercom clears the users data when they navigate to a different page when they're not logged in. Wondering if there's a way to call a function only if the session has changed or it's on the first call. Mostly, I'm just a Noob and am having a really hard time integrating Intercom for visitors and logged in users.
1 replies
TTCTheo's Typesafe Cult
Created by Liam B on 4/27/2023 in #questions
How can I make sure two arrays contain the same keys (in seperate files)
I'd like typescript to spit an error if I update one array, but not the other. I'm using T3 stack. So far all I have is:
// pages/generate.tsx
import { type Style } from "~/shared/types";
const styles: Style[] = [
{ id: "outline", label: "Outline", description: "Outline" },
{ id: "solid", label: "Solid", description: "Solid" },
{ id: "duotone", label: "Duotone", description: "Duotone" },
];
// pages/generate.tsx
import { type Style } from "~/shared/types";
const styles: Style[] = [
{ id: "outline", label: "Outline", description: "Outline" },
{ id: "solid", label: "Solid", description: "Solid" },
{ id: "duotone", label: "Duotone", description: "Duotone" },
];
// server/api/generate.ts
import { type StylePrompt } from '~/shared/types';
const styles: StylePrompt[] = [
{ id: "outline", prompt: "outline, vector art, minimalist" }
]
// server/api/generate.ts
import { type StylePrompt } from '~/shared/types';
const styles: StylePrompt[] = [
{ id: "outline", prompt: "outline, vector art, minimalist" }
]
// shared/types.ts
export interface Style {
id: string;
label: string;
description: string;
}

export interface StylePrompt {
id: string;
prompt: string;
}
// shared/types.ts
export interface Style {
id: string;
label: string;
description: string;
}

export interface StylePrompt {
id: string;
prompt: string;
}
This should throw an error because const styles: StylePrompt[] is missing solid and duotone
8 replies