Skip to content
Open
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
2 changes: 1 addition & 1 deletion .github/workflows/eas-release-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: EAS Release Android (Weekly)

on:
schedule:
- cron: '0 8 * * 0'
- cron: "0 8 * * 0"
workflow_dispatch:

jobs:
Expand Down
10 changes: 6 additions & 4 deletions app/(help)/help.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import {
} from 'react-native';
import { SafeAreaView } from 'react-native-safe-area-context';


type FAQItem = {
id: number;
title: string;
Expand All @@ -33,7 +32,6 @@ const HelpScreen: React.FC = () => {
{ id: 4, title: 'Formas de pagamento', icon: 'credit-card' },
];


const handleSendEmail = async () => {
const email = 'suporte@mandaca.com.br';
const subject = encodeURIComponent('Suporte - Central de Ajuda Mandacá');
Expand All @@ -53,7 +51,8 @@ const HelpScreen: React.FC = () => {

// Handle phone call
const handleCallSupport = async () => {
const phoneNumber = Platform.OS === 'ios' ? 'telprompt:08001234567' : 'tel:08001234567';
const phoneNumber =
Platform.OS === 'ios' ? 'telprompt:08001234567' : 'tel:08001234567';

try {
const canOpen = await Linking.canOpenURL(phoneNumber);
Expand All @@ -79,7 +78,10 @@ const HelpScreen: React.FC = () => {
/>
</View>

<ScrollView showsVerticalScrollIndicator={false} contentContainerStyle={styles.scrollContent}>
<ScrollView
showsVerticalScrollIndicator={false}
contentContainerStyle={styles.scrollContent}
>
{/* FAQ Section */}
<View style={styles.section}>
<Text style={styles.sectionTitle}>Perguntas Frequentes</Text>
Expand Down
54 changes: 26 additions & 28 deletions app/(help)/helpDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,7 @@ import Ionicons from '@expo/vector-icons/Ionicons';
import MaterialIcons from '@expo/vector-icons/MaterialIcons';
import { useRouter } from 'expo-router';
import React from 'react';
import {
Platform,
ScrollView,
StyleSheet,
Text,
View,
} from 'react-native';
import { Platform, ScrollView, StyleSheet, Text, View } from 'react-native';
import { SafeAreaView } from 'react-native-safe-area-context';

/**
Expand All @@ -23,16 +17,16 @@ const FaqDetailScreen: React.FC = () => {
<SafeAreaView style={styles.container}>
{/* Standard Header with standard back button logic */}
<View style={styles.headerWrapper}>
<Header
title="Dúvida"
showBackButton
<Header
title="Dúvida"
showBackButton
showNotificationButton={false}
onBackPress={() => router.back()}
/>
</View>

<ScrollView
showsVerticalScrollIndicator={false}
<ScrollView
showsVerticalScrollIndicator={false}
contentContainerStyle={styles.scrollContent}
>
{/* Visual Hierarchy: Icon and Centered Title */}
Expand All @@ -46,20 +40,24 @@ const FaqDetailScreen: React.FC = () => {
{/* Content Section: Focused on Readability (lineHeight: 26) */}
<View style={styles.contentSection}>
<Text style={styles.bodyText}>
Para cadastrar seu negócio no Mandacá e começar a atrair turistas da região,
siga este guia passo a passo:{'\n\n'}
1. Na sua tela inicial, navegue até a seção de ferramentas e clique no card{' '}
<Text style={styles.boldText}>&quot;Minha Empresa&quot;</Text>.{'\n\n'}
2. Toque no botão de adição ou editar. Preencha todas as informações básicas:
nome do local, descrição detalhada e o tipo de serviço que você oferece
(ex: Gastronomia, Artesanato).{'\n\n'}
3. <Text style={styles.boldText}>Fotos são fundamentais!</Text> Adicione imagens
bem iluminadas da fachada e do interior para gerar confiança nos visitantes.{'\n\n'}
4. Localização: Verifique se o ponto no mapa está correto para que o GPS leve
os turistas exatamente até a sua porta.{'\n\n'}
5. Finalize clicando em <Text style={styles.boldText}>&quot;Salvar&quot;</Text>.
Nossa equipe analisará os dados em no máximo 24 horas para garantir
a qualidade da plataforma.
Para cadastrar seu negócio no Mandacá e começar a atrair turistas da
região, siga este guia passo a passo:{'\n\n'}
1. Na sua tela inicial, navegue até a seção de ferramentas e clique
no card{' '}
<Text style={styles.boldText}>&quot;Minha Empresa&quot;</Text>.
{'\n\n'}
2. Toque no botão de adição ou editar. Preencha todas as informações
básicas: nome do local, descrição detalhada e o tipo de serviço que
você oferece (ex: Gastronomia, Artesanato).{'\n\n'}
3. <Text style={styles.boldText}>Fotos são fundamentais!</Text>{' '}
Adicione imagens bem iluminadas da fachada e do interior para gerar
confiança nos visitantes.{'\n\n'}
4. Localização: Verifique se o ponto no mapa está correto para que o
GPS leve os turistas exatamente até a sua porta.{'\n\n'}
5. Finalize clicando em{' '}
<Text style={styles.boldText}>&quot;Salvar&quot;</Text>. Nossa
equipe analisará os dados em no máximo 24 horas para garantir a
qualidade da plataforma.
</Text>
</View>

Expand All @@ -70,8 +68,8 @@ const FaqDetailScreen: React.FC = () => {
<Text style={styles.tipTitle}>Dica de Especialista</Text>
</View>
<Text style={styles.tipText}>
Negócios com descrições ricas em detalhes e que respondem rápido
às avaliações tendem a aparecer no topo das buscas dos turistas!
Negócios com descrições ricas em detalhes e que respondem rápido às
avaliações tendem a aparecer no topo das buscas dos turistas!
</Text>
</View>
</ScrollView>
Expand Down
95 changes: 45 additions & 50 deletions app/(mybusiness)/businessOverview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,54 +13,49 @@
const ENTERPRISE_ID = 'caa68f64-b68e-4327-90f0-264ca1bb73e2';

export default function Overview() {
const [story, setStory] = useState('');
const [address, setAddress] = useState('');
const [loading, setLoading] = useState(false);

const loadOverview = useCallback(async () => {
try {
setLoading(true);

const response = await axios.get(
`${API_URL}/enterprises/overview`,
{
params: { enterprise_id: ENTERPRISE_ID },
},
);

setStory(response.data.historia ?? '');
setAddress(response.data.endereco ?? '');

} catch (error) {
console.error('Erro ao buscar visão geral:', error);
Alert.alert('Erro', 'Não foi possível carregar os dados.');
} finally {
setLoading(false);
}
}, []);

useFocusEffect(
useCallback(() => {
loadOverview();
}, [loadOverview]),
);

return (
<Container>
<Header title="Visão geral" showBackButton showNotificationButton />

{loading ? (
<View className="flex-1 justify-center items-center">
<ActivityIndicator color={'#C34342'} />
</View>
) : (
<>
<Journey story={story} />
<Address address={address} />
<EditButton />
</>
)}

</Container>
);
const [story, setStory] = useState('');
const [address, setAddress] = useState('');
const [loading, setLoading] = useState(false);

const loadOverview = useCallback(async () => {
try {
setLoading(true);

const response = await axios.get(`${API_URL}/enterprises/overview`, {
params: { enterprise_id: ENTERPRISE_ID },
});

setStory(response.data.historia ?? '');
setAddress(response.data.endereco ?? '');
} catch (error) {
console.error('Erro ao buscar visão geral:', error);

Check warning on line 31 in app/(mybusiness)/businessOverview.tsx

View workflow job for this annotation

GitHub Actions / Lint (Style Check)

Unexpected console statement
Alert.alert('Erro', 'Não foi possível carregar os dados.');
} finally {
setLoading(false);
}
}, []);

useFocusEffect(
useCallback(() => {
loadOverview();
}, [loadOverview]),
);

return (
<Container>
<Header title="Visão geral" showBackButton showNotificationButton />

{loading ? (
<View className="flex-1 justify-center items-center">
<ActivityIndicator color={'#C34342'} />
</View>
) : (
<>
<Journey story={story} />
<Address address={address} />
<EditButton />
</>
)}
</Container>
);
}
145 changes: 74 additions & 71 deletions app/(mybusiness)/editStory.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,74 +14,77 @@
const ENTERPRISE_ID = 'caa68f64-b68e-4327-90f0-264ca1bb73e2';

export default function EditStory() {
const [toggle, setToggle] = useState<'WRITE' | 'AUDIO'>('WRITE');
const [text, setText] = useState('');
const [audio, setAudio] = useState('');
const [saving, setSaving] = useState(false);

const handlePress = async () => {
try {
if (toggle === 'WRITE' && !text.trim()) {
Alert.alert('Atenção', 'Digite uma história antes de continuar.');
return;
}

if (toggle === 'AUDIO' && !audio) {
Alert.alert('Atenção', 'Grave um áudio antes de continuar.');
return;
}

setSaving(true);

await axios.put(`${API_URL}/enterprises/${ENTERPRISE_ID}`, {
historia: toggle === 'WRITE' ? text.trim() : audio,
});

setText('');
setAudio('');

router.navigate('/(mybusiness)/manageImages');

} catch (error) {
console.error(error);
Alert.alert('Erro', 'Não foi possível salvar a história. Tente novamente.');
} finally {
setSaving(false);
}
};

return (
<Container>
<View className='gap-6'>
<Header title="Editar História" showBackButton showNotificationButton />

<Text className='pt-8 text-center text-lg font-semibold'>
Conte história do seu restaurante.
</Text>

<ToggleWrite toggle={toggle} setToggle={setToggle} />

{toggle === 'WRITE' && (
<InputBox text={text} setText={setText} />
)}

{toggle === 'AUDIO' && (
<AudioBox
audio={audio}
setAudio={setAudio}
setText={setText}
setToggle={setToggle}
/>
)}

<Checklist />

<GeneralButton
text={saving ? 'Salvando...' : 'Salvar'}
handlePress={handlePress}
disabled={saving}
/>
</View>
</Container>
);
}
const [toggle, setToggle] = useState<'WRITE' | 'AUDIO'>('WRITE');
const [text, setText] = useState('');
const [audio, setAudio] = useState('');
const [detectedTopics, setDetectedTopics] = useState<string[]>([]);
const [isSaving, setIsSaving] = useState(false);

const handleSave = async () => {
try {
if (toggle === 'WRITE' && !text.trim()) {
Alert.alert('Atenção', 'Digite uma história antes de continuar.');
return;
}

if (toggle === 'AUDIO' && !audio) {
Alert.alert('Atenção', 'Grave um áudio antes de continuar.');
return;
}

setIsSaving(true);

await axios.put(`${API_URL}/enterprises/${ENTERPRISE_ID}`, {
historia: toggle === 'WRITE' ? text.trim() : audio,
});

setText('');
setAudio('');
setDetectedTopics([]);

router.navigate('/(mybusiness)/manageImages');
} catch (error) {
console.error(error);

Check warning on line 47 in app/(mybusiness)/editStory.tsx

View workflow job for this annotation

GitHub Actions / Lint (Style Check)

Unexpected console statement
Alert.alert(
'Erro',
'Não foi possível salvar a história. Tente novamente.',
);
} finally {
setIsSaving(false);
}
};

return (
<Container>
<View className="gap-6">
<Header title="Editar História" showBackButton showNotificationButton />

<Text className="pt-8 text-center text-lg font-semibold">
Conte a história do seu restaurante.
</Text>

<ToggleWrite toggle={toggle} setToggle={setToggle} />

{toggle === 'WRITE' && <InputBox text={text} setText={setText} />}

{toggle === 'AUDIO' && (
<AudioBox
audio={audio}
setAudio={setAudio}
setText={setText}
setToggle={setToggle}
setDetectedTopics={setDetectedTopics}
/>
)}

<Checklist detectedTopics={detectedTopics} />

<GeneralButton
text={isSaving ? 'Salvando...' : 'Salvar'}
handlePress={handleSave}
disabled={isSaving}
/>
</View>
</Container>
);
}
Loading
Loading