Skip to content

Commit

Permalink
No more Home on navbar
Browse files Browse the repository at this point in the history
  • Loading branch information
victorrgouvea committed Sep 24, 2024
1 parent baf99c0 commit aa940ee
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 16 deletions.
7 changes: 2 additions & 5 deletions components/Donation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
Quero ajudar!
</button>

<!-- Aviso de erro -->
<p v-if="errorMessage" class="text-red-500 mt-4">{{ errorMessage }}</p>
</aside>
</template>
Expand All @@ -34,20 +33,18 @@
import { ref } from 'vue'
const amount = ref<number | null>(null)
const customAmount = ref<number | null>(null)
const errorMessage = ref<string | null>(null)
const presets = [500, 1000, 5000, 10000]
const selectAmount = (preset: number) => {
amount.value = preset
customAmount.value = null
errorMessage.value = null
}
const generatePaymentLink = async () => {
const selectedAmount = customAmount.value ? customAmount.value * 100 : amount.value
const selectedAmount = amount.value
if (!selectedAmount || selectedAmount <= 0) {
if (!selectedAmount) {
errorMessage.value = 'Por favor, insira ou selecione um valor válido.'
return
}
Expand Down
16 changes: 5 additions & 11 deletions components/Navbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,34 +19,28 @@ type Item = {
command: () => void;
};
const HOME: Item = {
label: "Home",
icon: "pi pi-home",
command: () => router.push("/"),
};
const LOGIN: Item = {
label: "Login",
label: "Entrar",
icon: "pi pi-sign-in",
command: () => signIn("auth0"),
};
const PROFILE: Item = {
label: "Profile",
label: "Perfil",
icon: "pi pi-user",
command: () => router.push("/me"),
};
const LOGOUT: Item = {
label: "Logout",
label: "Sair",
icon: "pi pi-sign-out",
command: () => signOut({ callbackUrl: "/" }),
};
const { status } = useAuth();
const items = ref<Item[]>([HOME, LOGIN]);
const items = ref<Item[]>([LOGIN]);
if (status.value === "authenticated") {
items.value = [HOME, PROFILE, LOGOUT];
items.value = [PROFILE, LOGOUT];
}
</script>

Expand Down

0 comments on commit aa940ee

Please sign in to comment.