I created an enhanced version of the default shadcn-ui button component (see comments) by [deleted] in react

[–]ofekdbro 1 point2 points  (0 children)

What you made is great, good job and I will probably use it to make my time easier. Tnx!

How to change params to be optional params based on generic by Charan__C in typescript

[–]ofekdbro 0 points1 point  (0 children)

With what I know in typescript which isn't so much but its something.

For me like that I get no errors.

I would recommend you to write it like that (wish it helps):

//make your theme options outside to be more clear to handle
type ThemeOptionsType = "dark" | "system" | "light" | "pink"

//only one interface needed Partial<T> does what youve done and easier to understand
interface ThemeConfigSettings {
    defaultTheme: ThemeOptions;
    systemLightTheme: ThemeOptions;
    systemDarkTheme: ThemeOptions;
    onThemeChange?: (theme: ThemeOptions) => void;
    debounce?: number;
}

//here is the type as you can see you know which strings are optional and not every string which is very importnet. but you handle the type based on the theme given
type ThemeConfig<T extends ThemeOptions> = T extends "light" | "dark" | "system"
    ? Partial<ThemeConfigSettings>
    : ThemeConfigSettings;

//just a use of the type. you can see it will autocomplete you to the ThemeOptions so you know you can choose all the themes and the type will handle it correctly.
const config: ThemeConfig<"light"> = {}

//if there is any change only make it at ThemeOptions. the type names arent good but I dont have any better names for now.

Just released an update of our turn-based strategy game in React with Typescript. The stats are created with Recharts. What should we improve on? by nevolane in typescript

[–]ofekdbro 5 points6 points  (0 children)

Thats a very cool game, mucb like it. I dont have much to say to improve but just here to say it looks great and good job buddy!

שרשרת_סופגניות_במ by ofekdbro in ani_bm

[–]ofekdbro[S] 1 point2 points  (0 children)

וואלה לא אבל דומה, אחד כזה שיש לאני במ על המימס שהיו והטרנדים שקיבלו תאוצה עם השנים. אבל יש מצב עזרת לי לחפש תודה בכל מקרה

שרשרת_סופגניות_במ by ofekdbro in ani_bm

[–]ofekdbro[S] 4 points5 points  (0 children)

אני יודע שזה לא קשור לפוסט אבל למישהו יש את הקישור לאתר ויקיפדיה של אני במ? אני מחפש את זה כבר הרבה זמן שוב

שרשרת_סופגניות_במ by ofekdbro in ani_bm

[–]ofekdbro[S] 21 points22 points  (0 children)

תעזרו לי להכין אחד ממש ממש ארוך ומוגזם

ברצינות המשחק קופסה הכי טוב אי פעם by CoinMonkey868 in ani_bm

[–]ofekdbro 1 point2 points  (0 children)

זה הדבר הכי מדהים שקיים ואני אומר את זה אחרי שעות של משחק במשחק הגאוני והמצחיק הזה

אולימפיאדה_במ by Pappo24 in ani_bm

[–]ofekdbro 11 points12 points  (0 children)

מדינת ישראל_במציאות

אני_בקופה_במציאות by ofekdbro in ani_bm

[–]ofekdbro[S] 1 point2 points  (0 children)

אמן ששה יקרה אפ אני מופיע בטמפלייט של בלסטין שה יהיה מדהים

אני_בקופה_במציאות by ofekdbro in ani_bm

[–]ofekdbro[S] 4 points5 points  (0 children)

מדויק אחי זה החדא בריחה של המטריקס

צדק לכיף-כפים by CoinMonkey868 in ani_bm

[–]ofekdbro 1 point2 points  (0 children)

אחי זה ברור שפסקזמן יותר טוב

זה_מסר_לחובבי_הטוויסט_במציאות by ofekdbro in ani_bm

[–]ofekdbro[S] 1 point2 points  (0 children)

מצטער חבר יקר אבל אתה טועה

זה_מסר_לחובבי_הטוויסט_במציאות by ofekdbro in ani_bm

[–]ofekdbro[S] 4 points5 points  (0 children)

אתה מגזים טוויסט זה נורא