1916Eco
1916Eco
TTCTheo's Typesafe Cult
Created by Crim on 1/14/2024 in #questions
Progress not working
The progress bar for somereason doesnt take a max val even though the types are defined for it if you go to where the progress.tsx is most likely components/ui/progress.tsx you can make a slight change that worked for me.
const Progress = React.forwardRef<
React.ElementRef<typeof ProgressPrimitive.Root>,
React.ComponentPropsWithoutRef<typeof ProgressPrimitive.Root>
>(({ className, value, max, ...props }, ref) => (
<ProgressPrimitive.Root
ref={ref}
className={cn(
"relative h-4 w-full overflow-hidden rounded-full bg-secondary",
className,
)}
{...props}
>
<ProgressPrimitive.Indicator
className="h-full w-full flex-1 bg-primary transition-all"
style={{ transform: `translateX(-${(max || 100) - (value || 0)}%)` }}
/>
</ProgressPrimitive.Root>
));
Progress.displayName = ProgressPrimitive.Root.displayName;

export { Progress };
const Progress = React.forwardRef<
React.ElementRef<typeof ProgressPrimitive.Root>,
React.ComponentPropsWithoutRef<typeof ProgressPrimitive.Root>
>(({ className, value, max, ...props }, ref) => (
<ProgressPrimitive.Root
ref={ref}
className={cn(
"relative h-4 w-full overflow-hidden rounded-full bg-secondary",
className,
)}
{...props}
>
<ProgressPrimitive.Indicator
className="h-full w-full flex-1 bg-primary transition-all"
style={{ transform: `translateX(-${(max || 100) - (value || 0)}%)` }}
/>
</ProgressPrimitive.Root>
));
Progress.displayName = ProgressPrimitive.Root.displayName;

export { Progress };
this is the main part of the code I only changed max being passed through with className, value... and in the style I added (max || 100)
3 replies
TTCTheo's Typesafe Cult
Created by 1916Eco on 1/14/2024 in #questions
React and ShadcnUI how to make a whole card clickable to change a radioGroup
const CarCards: FC = () => {
return (
<div className="flex flex-col">
<RadioGroup defaultValue="taxi-one" className="flex flex-row">
<div className="flex items-center space-x-2">
<CarCardIndividual
cardTitle="Small Taxi"
value="taxi-one"
id="taxi-one"
/>
</div>
<div className="flex items-center space-x-2">
<CarCardIndividual
cardTitle="Medium Taxi"
value="taxi-two"
id="taxi-two"
/>
</div>
</RadioGroup>
</div>
);
};

export default CarCards;
const CarCards: FC = () => {
return (
<div className="flex flex-col">
<RadioGroup defaultValue="taxi-one" className="flex flex-row">
<div className="flex items-center space-x-2">
<CarCardIndividual
cardTitle="Small Taxi"
value="taxi-one"
id="taxi-one"
/>
</div>
<div className="flex items-center space-x-2">
<CarCardIndividual
cardTitle="Medium Taxi"
value="taxi-two"
id="taxi-two"
/>
</div>
</RadioGroup>
</div>
);
};

export default CarCards;
2 replies
TTCTheo's Typesafe Cult
Created by 1916Eco on 11/22/2022 in #questions
NextAuth Google Provider not working
Yep that worked Thank YOU
11 replies
TTCTheo's Typesafe Cult
Created by 1916Eco on 11/22/2022 in #questions
NextAuth Google Provider not working
yea
11 replies
TTCTheo's Typesafe Cult
Created by 1916Eco on 11/22/2022 in #questions
NextAuth Google Provider not working
Right
11 replies
TTCTheo's Typesafe Cult
Created by 1916Eco on 11/22/2022 in #questions
NextAuth Google Provider not working
Oh
11 replies
TTCTheo's Typesafe Cult
Created by 1916Eco on 11/22/2022 in #questions
NextAuth Google Provider not working
11 replies