helloasso.vue 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <template>
  2. <LayoutContainer>
  3. <v-card>
  4. <v-row>
  5. <v-col cols="12" md="4" class="d-flex justify-center">
  6. <v-img src="/images/logos/Logo-HelloAsso.svg" class="logo" />
  7. </v-col>
  8. <v-col cols="12" md="8" class="presentation">
  9. {{ $t('helloasso_presentation') }}
  10. </v-col>
  11. </v-row>
  12. <v-row>
  13. <v-col cols="12" class="d-flex justify-center align-center w-100 mt-6">
  14. <UiButtonHelloAssoConnect
  15. :disabled="status !== 'success'"
  16. @click="onHelloAssoConnectClicked"
  17. />
  18. </v-col>
  19. </v-row>
  20. </v-card>
  21. <!-- <v-dialog-->
  22. <!-- v-model="showDialog"-->
  23. <!-- :width="900"-->
  24. <!-- class="authDialog"-->
  25. <!-- >-->
  26. <!-- <v-card>-->
  27. <!-- <iframe-->
  28. <!-- :src="authUrl!.authUrl"-->
  29. <!-- height="600"-->
  30. <!-- frameborder="0"-->
  31. <!-- />-->
  32. <!-- </v-card>-->
  33. <!-- </v-dialog>-->
  34. </LayoutContainer>
  35. </template>
  36. <script setup lang="ts">
  37. import { useEntityFetch } from '~/composables/data/useEntityFetch'
  38. import AuthUrl from '~/models/Custom/HelloAsso/AuthUrl'
  39. const route: RouteLocationNormalizedLoaded = useRoute()
  40. const { fetch } = useEntityFetch()
  41. const { data: authUrl, status } = fetch(AuthUrl)
  42. const showDialog: Ref<boolean> = ref(true)
  43. const onHelloAssoConnectClicked = () => {
  44. if (status.value !== 'success') {
  45. console.log('still pending')
  46. } else {
  47. showDialog.value = true
  48. navigateTo(authUrl.value!.authUrl, { external: true })
  49. }
  50. }
  51. const authorizationCode: Ref<string | null> = ref(null)
  52. if (route.query.code) {
  53. authorizationCode.value = route.query.code as string
  54. }
  55. </script>
  56. <style scoped lang="scss">
  57. .v-card {
  58. padding: 48px;
  59. max-width: 70%;
  60. margin: 36px auto;
  61. @media (max-width: 600px) {
  62. max-width: 90%;
  63. }
  64. }
  65. .logo {
  66. max-width: 80%;
  67. }
  68. .presentation {
  69. border-left: 3px solid rgb(var(--v-theme-info));
  70. padding: 0 24px;
  71. color: rgb(var(--v-theme-on-neutral));
  72. }
  73. .authDialog {
  74. max-width: 90%;
  75. }
  76. </style>