From 34d4fb6033b6353a1d418d3adb60dc677dc799da Mon Sep 17 00:00:00 2001 From: 230417 <230417@epvc.pt> Date: Tue, 5 May 2026 17:03:24 +0100 Subject: [PATCH] refactor: update module resolution, fix Stepper layout, improve Button prop typing, and update database diagnostic script --- src/components/ui/Button.tsx | 6 +++--- src/components/ui/Stepper.tsx | 2 -- tsconfig.json | 2 +- web/check_db.js | 21 ++++++++++++++++----- 4 files changed, 20 insertions(+), 11 deletions(-) diff --git a/src/components/ui/Button.tsx b/src/components/ui/Button.tsx index ab0ac49..e72e011 100644 --- a/src/components/ui/Button.tsx +++ b/src/components/ui/Button.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { TouchableOpacity, Text, StyleSheet, ActivityIndicator, ViewStyle, TextStyle } from 'react-native'; +import { TouchableOpacity, Text, StyleSheet, ActivityIndicator, ViewStyle, TextStyle, StyleProp } from 'react-native'; type Props = { children: React.ReactNode; @@ -8,8 +8,8 @@ type Props = { size?: 'sm' | 'md' | 'lg'; disabled?: boolean; loading?: boolean; - style?: ViewStyle; - textStyle?: TextStyle; + style?: StyleProp; + textStyle?: StyleProp; }; export const Button = ({ children, onPress, variant = 'solid', size = 'md', disabled, loading, style, textStyle }: Props) => { diff --git a/src/components/ui/Stepper.tsx b/src/components/ui/Stepper.tsx index 580c005..6b4b7aa 100644 --- a/src/components/ui/Stepper.tsx +++ b/src/components/ui/Stepper.tsx @@ -136,8 +136,6 @@ const styles = StyleSheet.create({ lineBackground: { position: 'absolute', top: 15, // Half of circle height (30/2) - left: 40, // Center of first circle (20 horizontal padding + 30 step container width / 2) -> wait - // Let's use a more robust calculation left: 50, // approx center of first circle (20 padding + 60/2) right: 50, // approx center of last circle height: 2, diff --git a/tsconfig.json b/tsconfig.json index 43603fa..2dfb9dc 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -5,6 +5,6 @@ "jsx": "react-native", "esModuleInterop": true, "skipLibCheck": true, - "moduleResolution": "node" + "moduleResolution": "bundler" } } diff --git a/web/check_db.js b/web/check_db.js index da462f8..335b693 100644 --- a/web/check_db.js +++ b/web/check_db.js @@ -1,4 +1,4 @@ -const { createClient } = require('@supabase/supabase-js'); +import { createClient } from '@supabase/supabase-js'; const supabaseUrl = 'https://jqklhhpyykzrktikjnmb.supabase.co'; const supabaseAnonKey = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Impxa2xoaHB5eWt6cmt0aWtqbm1iIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NjgzODQ0MDgsImV4cCI6MjA4Mzk2MDQwOH0.QsPuBnyUtRPSavlqKj3IGR9c8juT02LY_hSi-j3c6M0'; @@ -6,11 +6,22 @@ const supabaseAnonKey = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYm const supabase = createClient(supabaseUrl, supabaseAnonKey); async function check() { - const { data, error } = await supabase.from('shops').select('*').limit(1); - if (error) { - console.log("DB ERROR:", error); + const { data, error } = await supabase.from('profiles').select('*').limit(0); + const { data: cols, error: colError } = await supabase.rpc('get_table_columns', { table_name: 'profiles' }); + + // If RPC doesn't exist, try a different way + if (colError) { + console.log("RPC Error (likely doesn't exist):", colError.message); + // Try to insert a row with a wrong column to see what columns exist in the error message? No. + // Let's just try to select one of each suspected column. + const { data: testData, error: testError } = await supabase.from('shops').select('*').limit(1); + if (testError) { + console.log("SELECT ERROR:", testError.message); + } else { + console.log("COLUMNS EXIST IN SHOPS:", testData && testData.length > 0 ? Object.keys(testData[0]) : "No rows"); + } } else { - console.log("COLUMNS:", data && data.length > 0 ? Object.keys(data[0]) : "No rows returned"); + console.log("COLUMNS:", cols); } process.exit(0); }