Skip to content
Snippets Groups Projects
Commit 0a5327de authored by Valdemar Åstorp Beere's avatar Valdemar Åstorp Beere
Browse files

refactor(component):

Add routing options to the ButtonAddGoalOrChallenge
parent 44373427
No related branches found
No related tags found
3 merge requests!66Final merge,!32refactor(component):,!4Pipeline fix
<template>
<button
class="w-full max-w-60 max-h-12 font-bold py-2 rounded-full flex items-center justify-start pl-4 space-x-2 focus:outline-none focus:ring-2 focus:ring-green-700 focus:ring-opacity-50 shadow-md transition duration-300 ease-in-out text-xs md:text-sm lg:text-base"
<button
class="w-full max-w-60 max-h-12 font-bold py-2 rounded-full flex items-center justify-start pl-4 space-x-2 focus:outline-none focus:ring-2 focus:ring-green-700 focus:ring-opacity-50 shadow-md transition duration-300 ease-in-out text-xs md:text-sm lg:text-base"
@click="routeToGoalOrChallenge"
>
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
class="w-6 h-6"
>
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
class="w-6 h-6"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M12 4v16m8-8H4"
/>
</svg>
<span class="truncate">{{ btnText }}</span>
</button>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M12 4v16m8-8H4"
/>
</svg>
<span class="truncate">{{ btnText }}</span>
</button>
</template>
<script setup lang="ts">
import { defineProps, ref } from 'vue'
import {useRouter} from "vue-router";
interface Props {
buttonText: string
buttonText: string
type: 'goal' | 'challenge'
}
const router = useRouter()
const props = defineProps<Props>()
const btnText = ref(props.buttonText)
const routeToGoalOrChallenge = () => {
if (props.type === 'goal') {
router.push('/sparemaal')
} else {
router.push('/spareutfordringer')
}
}
</script>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment