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
16 changes: 6 additions & 10 deletions .agents/skills/git-workflow/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,24 +43,20 @@ git commit -m "feat(auth): adicionar suporte a login biométrico com expo-local-

---

## 2. Gerenciamento de Branches
## 2. Gerenciamento de Branches & Restrições de Envio

- Crie branches a partir da branch base atualizada (`main` / `develop`):
```bash
git checkout -b <tipo>/<nome-da-feature-ou-fix>
```
Exemplos:
- `feat/biometric-auth`
- `fix/camera-permission-crash`
- `refactor/navigation-flow`
- **Restrição de Push Remoto**: **NUNCA** envie (`git push`) branches do tipo `feat/*`, `fix/*`, `chore/*`, `refactor/*` para o repositório remoto.
- **Branches Remotas Permitidas**: O envio (`git push`) para o repositório remoto é restrito **exclusivamente a `development` e `main`**.
- Branches auxiliares (`feat/...`, `fix/...`) devem ser usadas apenas localmente e mescladas na `development` antes de enviar ao repositório remoto.

---

## 3. Criação de Pull Requests (usando GitHub CLI `gh`)

Ao finalizar uma tarefa e ter os commits organizados:

1. **Enviar as alterações para o repositório remoto**:
1. **Garantir a branch correta e enviar ao remoto**:
- Certifique-se de estar na branch `development` (ou `main`).

```bash
git push -u origin HEAD
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,7 @@ app-example
# generated native folders
/ios
/android

# IDE
.idea/
.env
13 changes: 11 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ Read the exact versioned docs at https://docs.expo.dev/versions/v54.0.0/ before

---

# Local Git & Remote Push Rules

- **Restrição de Push Remoto**: **NUNCA** faça push para o repositório remoto de branches como `feat/*`, `fix/*`, `chore/*`, `refactor/*`, etc.
- **Branches permitidas para o remoto**: O envio (`git push`) é **estritamente permitido apenas para as branches `development` e `main`**.
- Se o trabalho for desenvolvido em uma branch local auxiliar, integre-a à `development` antes de enviar ao repositório remoto.

---

# Custom Agent Commands & Shortcuts

Whenever the user starts a prompt with any of the following shortcuts, immediately activate the `.agents/skills/git-workflow/SKILL.md` skill and execute the workflow:
Expand All @@ -15,8 +23,9 @@ Whenever the user starts a prompt with any of the following shortcuts, immediate

- `/pr [título/descrição opcional]`:
1. Verificar status atual da branch (`git status`, `git log`).
2. Fazer push para a branch remota (`git push -u origin HEAD`).
3. Criar o Pull Request utilizando `gh pr create` estruturado com descrição, lista de alterações, instruções de teste e labels adequadas (`--label "enhancement"`, `--label "bug"`, etc.).
2. Garantir que a branch atual é `development` ou `main` antes do push (nunca fazer push de branches `feat/`, `fix/`, `chore/`).
3. Fazer push para a branch remota (`git push -u origin HEAD`).
4. Criar o Pull Request utilizando `gh pr create` estruturado com descrição, lista de alterações, instruções de teste e labels adequadas (`--label "enhancement"`, `--label "bug"`, etc.).

- `/commit-pr [mensagem/instrução opcional]`:
1. Realizar o fluxo do `/commit` seguido imediatamente pelo fluxo do `/pr`.
7 changes: 5 additions & 2 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@
"userInterfaceStyle": "automatic",
"newArchEnabled": true,
"ios": {
"supportsTablet": true
"supportsTablet": true,
"bundleIdentifier": "com.sentinel.subscriptionmanager"
},
"android": {
"package": "com.sentinel.subscriptionmanager",
"adaptiveIcon": {
"backgroundColor": "#E6F4FE",
"foregroundImage": "./assets/images/android-icon-foreground.png",
Expand Down Expand Up @@ -51,7 +53,8 @@
"./assets/fonts/PlusJakartaSans-Light.ttf"
]
}
]
],
"expo-secure-store"
],
"experiments": {
"typedRoutes": true,
Expand Down
10 changes: 8 additions & 2 deletions app/(auth)/_layout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import { Stack } from "expo-router";
import { useAuth } from "@clerk/expo";
import { Redirect, Stack } from "expo-router";

export default function AuthLayout() {
const { isSignedIn, isLoaded } = useAuth();

if (!isLoaded) return null;
if (isSignedIn) return <Redirect href="/(tabs)" />;

export default function RootLayout() {
return <Stack screenOptions={{ headerShown: false }} />;
}
149 changes: 140 additions & 9 deletions app/(auth)/sign-in.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,143 @@
import React from "react";
import { Text, View } from "react-native";
import React, { useState } from "react";
import {
ActivityIndicator,
KeyboardAvoidingView,
Platform,
ScrollView,
Text,
TextInput,
TouchableOpacity,
View,
} from "react-native";
import { Link } from "expo-router";
import { styled } from "nativewind";
import { SafeAreaView as RNSafeAreaView } from "react-native-safe-area-context";
import SocialAuthButtons from "@/components/SocialAuthButtons";

import { useAuthFlow } from "@/hooks/useAuthFlow";

const SafeAreaView = styled(RNSafeAreaView);

export default function SignInScreen() {
const [emailAddress, setEmailAddress] = useState("");
const [password, setPassword] = useState("");
const {
loginWithPassword,
errorMessage,
setErrorMessage,
isSignInSubmitting,
signInErrors,
} = useAuthFlow();

const handleSignIn = async () => {
await loginWithPassword(emailAddress, password);
};

const hasIdentifierError = Boolean(signInErrors?.fields?.identifier);
const hasPasswordError = Boolean(signInErrors?.fields?.password);

const SignIn = () => {
return (
<View className="flex-1 items-center justify-center bg-background">
<Text className="font-bold text-success">Entrar</Text>
</View>
);
};
<SafeAreaView className="auth-safe-area">
<KeyboardAvoidingView
behavior={Platform.OS === "ios" ? "padding" : "height"}
className="auth-screen"
>
<ScrollView
className="auth-scroll"
contentContainerClassName="auth-content"
keyboardShouldPersistTaps="handled"
>
<View className="auth-brand-block">
<View className="auth-logo-wrap">
<View className="auth-logo-mark">
<Text className="auth-logo-mark-text">S</Text>
</View>
<View>
<Text className="auth-wordmark">Sentinel</Text>
<Text className="auth-wordmark-sub">Subscription Manager</Text>
</View>
</View>
<Text className="auth-title">Bem-vindo de volta</Text>
<Text className="auth-subtitle">
Acesse sua conta para gerenciar suas assinaturas
</Text>
</View>

export default SignIn;
<View className="auth-card">
{errorMessage ? (
<View className="mb-4 rounded-2xl border border-destructive/20 bg-destructive/10 p-3.5">
<Text className="auth-error text-sm">{errorMessage}</Text>
</View>
) : null}

{/* Social Sign-In Buttons */}
<SocialAuthButtons
mode="signIn"
onError={setErrorMessage}
disabled={isSignInSubmitting}
/>

<View className="auth-form">
<View className="auth-field">
<Text className="auth-label">E-mail</Text>
<TextInput
autoCapitalize="none"
keyboardType="email-address"
placeholder="seu@email.com"
placeholderTextColor="rgba(0, 0, 0, 0.4)"
value={emailAddress}
onChangeText={setEmailAddress}
className={`auth-input ${hasIdentifierError ? "auth-input-error" : ""}`}
/>
{signInErrors?.fields?.identifier ? (
<Text className="auth-error">
{signInErrors.fields.identifier.message}
</Text>
) : null}
</View>

<View className="auth-field">
<Text className="auth-label">Senha</Text>
<TextInput
secureTextEntry
placeholder="••••••••"
placeholderTextColor="rgba(0, 0, 0, 0.4)"
value={password}
onChangeText={setPassword}
className={`auth-input ${hasPasswordError ? "auth-input-error" : ""}`}
/>
{signInErrors?.fields?.password ? (
<Text className="auth-error">
{signInErrors.fields.password.message}
</Text>
) : null}
</View>

<TouchableOpacity
onPress={handleSignIn}
disabled={isSignInSubmitting}
activeOpacity={0.8}
className={`auth-button ${isSignInSubmitting ? "auth-button-disabled" : ""}`}
>
{isSignInSubmitting ? (
<ActivityIndicator color="#081126" />
) : (
<Text className="auth-button-text">Entrar</Text>
)}
</TouchableOpacity>
</View>
</View>

<View className="auth-link-row">
<Text className="auth-link-copy">Não tem uma conta?</Text>
<Link href="/(auth)/sign-up" asChild>
<TouchableOpacity>
<Text className="auth-link">Criar conta</Text>
</TouchableOpacity>
</Link>
</View>
</ScrollView>
</KeyboardAvoidingView>
</SafeAreaView>
);
}
Loading