Handle already chosen Oculus as default download platform

This commit is contained in:
MathieuG-P
2023-12-17 13:39:48 +01:00
parent 01bc0e13e3
commit 14036b9269
3 changed files with 9 additions and 3 deletions
@@ -18,10 +18,15 @@ export function SettingRadioArray<T>({ id, items, selectedItemId, selectedItemVa
return item.id === selectedItemId || item.value === selectedItemValue;
}
const selectItem = (item: RadioItem<T>) => {
if(item.disabled){ return; }
onItemSelected?.(item);
}
return (
<div id={id} className="w-full flex gap-1.5" style={{flexDirection: direction}}>
{items.map(i => (
<div onClick={() => onItemSelected(i)} key={i.id} className={`py-3 w-full flex cursor-pointer justify-between items-center rounded-md px-2 transition-colors duration-200 ${isSelected(i) ? "bg-light-main-color-3 dark:bg-main-color-3" : "bg-light-main-color-1 dark:bg-main-color-1"} ${i.className}`}>
<div onClick={() => selectItem(i)} key={i.id} className={`py-3 w-full flex ${i.disabled ? "cursor-not-allowed" : "cursor-pointer"} ${i.disabled && "brightness-75"} justify-between items-center rounded-md px-2 transition-colors duration-200 ${isSelected(i) ? "bg-light-main-color-3 dark:bg-main-color-3" : "bg-light-main-color-1 dark:bg-main-color-1"} ${i.className}`}>
<div className="flex items-center">
<div className="h-5 rounded-full aspect-square border-2 border-gray-800 dark:border-white p-[3px] mr-2">
<motion.span initial={{ scale: 0 }} animate={{ scale: isSelected(i) ? 1 : 0 }} className="h-full w-full block bg-gray-800 dark:bg-white rounded-full" />
@@ -47,4 +52,5 @@ export interface RadioItem<T> {
textIcon?: string;
className?: string;
value?: T;
disabled?: boolean;
}