MustBeLogged component + fix sideBar auto open
This commit is contained in:
@@ -36,19 +36,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<v-dialog v-model="loginModal" max-width="400">
|
||||
<v-card>
|
||||
<div class="flex flex-col items-center">
|
||||
<v-img src="/images/usersmedia/HutopyProfile/profilepictures/profileHutopyProfile01.png" class="w-50"></v-img>
|
||||
<LoginForm :onSuccess="handleSuccess" :onFailure="handleFailure"></LoginForm>
|
||||
<v-card-text>Vous devez être connecté pour poster un commentaire.</v-card-text>
|
||||
</div>
|
||||
<v-card-actions>
|
||||
<v-btn color="primary" text @click="closeModal">Fermer</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
<must-be-logged v-model="loginModal" message="Vous devez être connecté pour ajouter un commentaire."></must-be-logged>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
@@ -57,11 +45,7 @@ import {v7} from 'uuid'
|
||||
import {useClient} from '@/plugins/api.js'
|
||||
import {useUserStore} from "@/stores/userStore.js"
|
||||
import {useAuthStore} from "@/stores/authStore.js"
|
||||
import LoginForm from "@/views/main/LoginForm.vue"
|
||||
|
||||
const closeModal = () => {
|
||||
loginModal.value = false;
|
||||
}
|
||||
import MustBeLogged from "@/views/MustBeLogged.vue";
|
||||
|
||||
const props = defineProps({
|
||||
subjectId: {
|
||||
@@ -72,7 +56,6 @@ const props = defineProps({
|
||||
|
||||
const emits = defineEmits(['message-posted'])
|
||||
|
||||
|
||||
const loginModal = ref(false);
|
||||
const client = useClient()
|
||||
const value = ref("")
|
||||
@@ -106,14 +89,6 @@ const publish = async () => {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const handleSuccess = () => {
|
||||
loginModal.value = false;
|
||||
}
|
||||
|
||||
const handleFailure = () => {
|
||||
console.error('Login failed');
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
Reference in New Issue
Block a user