Dialog.vue 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <!-- Boite de dialogue "soumettre une candidature" -->
  2. <template>
  3. <v-dialog
  4. :model-value="modelValue"
  5. max-width="600px"
  6. :persistent="!jobApplicationSent"
  7. no-click-animation
  8. :retain-focus="false"
  9. >
  10. <div v-if="!jobApplicationSent">
  11. <JoinUsForm :job-posting-id="jobPostingId" @submit="onFormSubmit" />
  12. <v-btn @click="close()"> Annuler </v-btn>
  13. </div>
  14. <div v-else>
  15. <v-card class="pa-6 text-center">
  16. Votre candidature a bien été envoyée, merci de votre intérêt.<br />
  17. Nous vous recontacterons dès que possible.
  18. </v-card>
  19. <v-btn @click="close()"> Fermer </v-btn>
  20. </div>
  21. </v-dialog>
  22. </template>
  23. <script setup lang="ts">
  24. import type { PropType } from 'vue'
  25. defineProps({
  26. modelValue: Boolean,
  27. jobPostingId: {
  28. type: Number as PropType<number | null>,
  29. required: false,
  30. default: null,
  31. },
  32. })
  33. const jobApplicationSent: Ref<boolean> = ref(false)
  34. const emit = defineEmits(['update:modelValue'])
  35. const onFormSubmit = () => {
  36. jobApplicationSent.value = true
  37. }
  38. const close = () => {
  39. emit('update:modelValue', false)
  40. }
  41. </script>
  42. <style scoped lang="scss">
  43. .v-dialog {
  44. :deep(.v-overlay__content) {
  45. overflow: auto !important;
  46. }
  47. :deep(.v-card) {
  48. border-bottom-left-radius: 0;
  49. border-bottom-right-radius: 0;
  50. }
  51. .v-btn {
  52. width: 100%;
  53. border-top-left-radius: 0;
  54. border-top-right-radius: 0;
  55. }
  56. }
  57. </style>