[FEAT] Toastr and saving UX improvements
This commit is contained in:
@@ -19,9 +19,13 @@
|
||||
<div v-if="isEditorActive" class="h-8 w-px bg-gray-200 dark:bg-gray-700 mx-1"></div>
|
||||
|
||||
<div class="flex items-center gap-1">
|
||||
<Tooltip v-if="isEditorActive" text="Save project">
|
||||
<button @click="$emit('save-project')" class="w-8 h-8 rounded-lg flex items-center justify-center text-gray-500 hover:text-indigo-600 hover:bg-indigo-50 dark:hover:bg-indigo-900/30 transition-all">
|
||||
<i class="fas fa-save"></i>
|
||||
<Tooltip v-if="isEditorActive" :text="isSaving ? 'Saving...' : 'Save project'">
|
||||
<button @click="$emit('save-project')" class="w-8 h-8 rounded-lg flex items-center justify-center text-gray-500 hover:text-indigo-600 hover:bg-indigo-50 dark:hover:bg-indigo-900/30 transition-all" :disabled="isSaving">
|
||||
<svg v-if="isSaving" class="animate-spin h-4 w-4 text-indigo-600 dark:text-indigo-400" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
|
||||
<circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle>
|
||||
<path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path>
|
||||
</svg>
|
||||
<i v-else class="fas fa-save"></i>
|
||||
</button>
|
||||
</Tooltip>
|
||||
|
||||
@@ -57,5 +61,9 @@
|
||||
const route = useRoute();
|
||||
const projectStore = useProjectStore();
|
||||
|
||||
defineProps<{
|
||||
isSaving?: boolean;
|
||||
}>();
|
||||
|
||||
const isEditorActive = computed(() => route.name === 'editor');
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user