Onboarding (#132)

* Initial onboarding

* Update OnboardingModal.vue

* Add finish

* Animation

* Automatic opening

* Move onboarding icon to outside of main appbar

* Run lint

* run fmt

* mostly finish

* Finish onboarding

* fix onboarding bug + linux build

* fix build again

* Add back window shadows

---------

Co-authored-by: Geometrically <18202329+Geometrically@users.noreply.github.com>
Co-authored-by: Jai A <jaiagr+gpg@pm.me>
Co-authored-by: Jai A <jai@modrinth.com>
This commit is contained in:
Adrian O.V
2023-06-20 22:03:59 -04:00
committed by GitHub
parent bd697a02f5
commit 8e5a0b8ae2
27 changed files with 635 additions and 248 deletions

View File

@@ -1,6 +1,6 @@
<template>
<JavaDetectionModal ref="detectJavaModal" @submit="(val) => emit('update:modelValue', val)" />
<div class="toggle-setting">
<div class="toggle-setting" :class="{ compact }">
<input
autocomplete="off"
:disabled="props.disabled"
@@ -18,10 +18,7 @@
"
/>
<span class="installation-buttons">
<Button
:disabled="props.disabled"
@click="$refs.detectJavaModal.show(props.version, props.modelValue)"
>
<Button :disabled="props.disabled" @click="autoDetect">
<SearchIcon />
Auto detect
</Button>
@@ -48,11 +45,12 @@
<script setup>
import { Button, SearchIcon, PlayIcon, CheckIcon, XIcon, FolderSearchIcon } from 'omorphia'
import { get_jre } from '@/helpers/jre.js'
import { find_jre_17_jres, get_jre } from '@/helpers/jre.js'
import { ref } from 'vue'
import { open } from '@tauri-apps/api/dialog'
import JavaDetectionModal from '@/components/ui/JavaDetectionModal.vue'
import mixpanel from 'mixpanel-browser'
import { handleError } from '@/store/state.js'
const props = defineProps({
version: {
@@ -74,6 +72,10 @@ const props = defineProps({
required: false,
default: null,
},
compact: {
type: Boolean,
default: false,
},
})
const emit = defineEmits(['update:modelValue'])
@@ -117,6 +119,18 @@ async function handleJavaFileInput() {
emit('update:modelValue', result)
}
}
const detectJavaModal = ref(null)
async function autoDetect() {
if (!props.compact) {
detectJavaModal.value.show(props.version, props.modelValue)
} else {
let versions = await find_jre_17_jres().catch(handleError)
if (versions.length > 0) {
emit('update:modelValue', versions[0])
}
}
}
</script>
<style lang="scss" scoped>
@@ -131,12 +145,15 @@ async function handleJavaFileInput() {
justify-content: space-between;
align-items: center;
gap: 0.5rem;
&.compact {
flex-wrap: wrap;
}
}
.installation-buttons {
display: flex;
flex-direction: row;
flex-wrap: wrap;
align-items: center;
gap: 0.5rem;
margin: 0;