Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 5 additions & 14 deletions components/ProjectSettingsModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,11 @@ export const ProjectSettingsModal: React.FC<ProjectSettingsModalProps> = ({
const {
data: projectData,
isLoading,
isError,
refetch
} = useProjectStatuses(projectId);

React.useEffect(() => {
if (isError) {
RNAlert.alert(t('error'), t('projectSettingsLoadError'));
onClose();
}
}, [isError, onClose, t]);

if (isError) {
return null;
}
const areSwitchesDisabled =
isLoading || isSubmitting || !isOwner || !projectData;

const handleToggleStatus = async (statusType: TProjectStatusType) => {
if (!projectData || isSubmitting) return;
Expand Down Expand Up @@ -125,7 +116,7 @@ export const ProjectSettingsModal: React.FC<ProjectSettingsModalProps> = ({
}
value={projectData?.private ?? false}
onChange={() => handleToggleStatus('private')}
disabled={isLoading || !isOwner}
disabled={areSwitchesDisabled}
icon={projectData?.private ? LockIcon : UnlockIcon}
/>

Expand All @@ -138,7 +129,7 @@ export const ProjectSettingsModal: React.FC<ProjectSettingsModalProps> = ({
}
value={projectData?.visible ?? false}
onChange={() => handleToggleStatus('visible')}
disabled={isLoading || !isOwner}
disabled={areSwitchesDisabled}
icon={projectData?.visible ? EyeIcon : EyeOffIcon}
/>

Expand All @@ -151,7 +142,7 @@ export const ProjectSettingsModal: React.FC<ProjectSettingsModalProps> = ({
}
value={projectData?.active ?? false}
onChange={() => handleToggleStatus('active')}
disabled={isLoading || !isOwner}
disabled={areSwitchesDisabled}
icon={projectData?.active ? CheckCircleIcon : XCircleIcon}
/>
</View>
Expand Down
60 changes: 17 additions & 43 deletions components/icons/FiaIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,53 +4,27 @@ import Svg, { Path } from 'react-native-svg';

/**
* Custom FIA icon matching the LucideIcon interface.
* Three overlapping chevrons: up (^), down (V), and right (>),
* arranged to interlock without touching — the FIA logo.
*
* Coordinates derived from the official FIA SVG, scaled to fill 24×24
* with slight horizontal spacing added between each chevron pair.
* Three interlocking chevrons from the official FIA logo.
*/
const FiaIcon: LucideIcon = React.forwardRef<
React.ComponentRef<typeof Svg>,
LucideProps
>(
(
{
color = 'currentColor',
size = 24,
strokeWidth = 2.5,
absoluteStrokeWidth,
...rest
},
ref
) => {
const sw = absoluteStrokeWidth
? (Number(strokeWidth) * 24) / Number(size)
: strokeWidth;

return (
<Svg
ref={ref}
width={size}
height={size}
viewBox="0 0 24 24"
fill="none"
stroke={color}
strokeWidth={sw}
strokeLinecap="round"
strokeLinejoin="round"
{...rest}
>
{/* Chevron UP (^): peak at (7.1, 5.3) */}
<Path d="M 0.1 13.1 L 7.1 5.3 L 13.1 12.7" />
{/* Chevron DOWN (V): peak at (12.8, 18.7) */}
<Path d="M 6.8 11.8 L 12.8 18.7 L 18.5 11.7" />
{/* Chevron RIGHT (>): tip at (23.4, 11.0), arms extended to match UP peak and DOWN tip */}
<Path d="M 18.0 5.3 L 23.4 11.0 L 17.8 18.7" />
</Svg>
);
}
);
>(({ color = 'currentColor', size = 24, ...rest }, ref) => {
return (
<Svg
ref={ref}
width={size}
height={size}
viewBox="0 0 300 167.52"
fill={color}
{...rest}
>
<Path d="M149.39 164.39c-3.47 0-6.93-1.32-9.57-3.97l-68-67.99c-5.29-5.29-5.29-13.86 0-19.15s13.86-5.29 19.15 0l44.46 44.46c7.71 7.71 20.21 7.71 27.92 0l44.46-44.46c5.29-5.29 13.86-5.29 19.15 0s5.29 13.86 0 19.15l-67.99 68a13.5 13.5 0 0 1-9.57 3.97Z" />
<Path d="M81.53 0C85 0 88.46 1.32 91.1 3.97l68 67.99c5.29 5.29 5.29 13.86 0 19.15s-13.86 5.29-19.15 0L95.49 46.65c-7.71-7.71-20.21-7.71-27.92 0L23.11 91.11c-5.29 5.29-13.86 5.29-19.15 0s-5.29-13.86 0-19.15l68-67.99A13.5 13.5 0 0 1 81.53 0" />
<Path d="M300 85.98c0 3.47-1.32 6.93-3.97 9.57l-67.99 67.99c-5.29 5.29-13.86 5.29-19.15 0s-5.29-13.86 0-19.15l44.46-44.46c7.71-7.71 7.71-20.21 0-27.92l-44.46-44.46c-5.29-5.29-5.29-13.86 0-19.15s13.86-5.29 19.15 0l67.99 67.99a13.5 13.5 0 0 1 3.97 9.57Z" />
</Svg>
);
});

FiaIcon.displayName = 'FiaIcon';

Expand Down
22 changes: 11 additions & 11 deletions services/localizations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7034,17 +7034,17 @@ export const localizations = {
mandarin: '更新项目活动状态失败'
},
projectSettingsLoadError: {
english: 'Error loading quest settings.',
french: 'Erreur lors du chargement des paramètres de quête.',
spanish: 'Error al cargar la configuración de quest.',
brazilian_portuguese: 'Erro ao carregar as configurações da quest.',
tok_pisin: 'I no inap load quest settings.',
indonesian: 'Gagal memuat pengaturan quest.',
nepali: 'क्वेस्ट सेटिङहरू लोड गर्दा त्रुटि।',
hindi: 'क्वेस्ट सेटिंग लोड करने में त्रुटि।',
burmese: 'စွမ်းဆောင်ရည် ဆက်တင်များကို ဖွင့်ရာတွင် အမှားအယွင်း။',
thai: 'เกิดข้อผิดพลาดในการโหลดการตั้งค่าเควสต์',
mandarin: '加载任务设置时出错。'
english: 'Error loading project settings.',
french: 'Erreur lors du chargement des paramètres du projet.',
spanish: 'Error al cargar la configuración del proyecto.',
brazilian_portuguese: 'Erro ao carregar as configurações do projeto.',
tok_pisin: 'I no inap load project settings.',
indonesian: 'Gagal memuat pengaturan proyek.',
nepali: 'प्रोजेक्ट सेटिङहरू लोड गर्दा त्रुटि।',
hindi: 'प्रोजेक्ट सेटिंग लोड करने में त्रुटि।',
burmese: 'ပရောဂျက် ဆက်တင်များကို ဖွင့်ရာတွင် အမှားအယွင်း။',
thai: 'เกิดข้อผิดพลาดในการโหลดการตั้งค่าโปรเจกต์',
mandarin: '加载项目设置时出错。'
},
projectSettings: {
english: 'Project Settings',
Expand Down
Loading