feat: phase 2
Newfound motivation
This commit is contained in:
@ -2,32 +2,33 @@
|
||||
import Button from 'primevue/button';
|
||||
import ToggleSwitch from 'primevue/toggleswitch';
|
||||
import { open } from '@tauri-apps/plugin-shell';
|
||||
import InstallButton from './InstallButton.vue';
|
||||
import ModTitlecard from './ModTitlecard.vue';
|
||||
import { ModEntry } from '../types';
|
||||
import { usePkgStore } from '../stores';
|
||||
import { Package } from '../types';
|
||||
|
||||
defineProps({
|
||||
mod: Object as () => ModEntry,
|
||||
const store = usePkgStore();
|
||||
|
||||
const props = defineProps({
|
||||
pkg: Object as () => Package,
|
||||
});
|
||||
|
||||
const toggle = (value: boolean) => {
|
||||
store.toggle(props.pkg, value);
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="flex items-center">
|
||||
<ModTitlecard showVersion :localIcon="true" :mod="mod" />
|
||||
<ModTitlecard showVersion :pkg="pkg" />
|
||||
<ToggleSwitch
|
||||
class="scale-[1.33] shrink-0"
|
||||
inputId="switch"
|
||||
:modelValue="mod?.enabled"
|
||||
/>
|
||||
<Button
|
||||
rounded
|
||||
disabled
|
||||
icon="pi pi-trash"
|
||||
severity="danger"
|
||||
aria-label="delete"
|
||||
size="small"
|
||||
class="ml-5 self-center shrink-0"
|
||||
style="width: 2rem; height: 2rem"
|
||||
:disabled="!pkg?.loc"
|
||||
:modelValue="store.isEnabled(pkg)"
|
||||
v-on:value-change="toggle"
|
||||
/>
|
||||
<InstallButton />
|
||||
<Button
|
||||
rounded
|
||||
icon="pi pi-folder"
|
||||
@ -36,7 +37,7 @@ defineProps({
|
||||
size="small"
|
||||
class="ml-2 shrink-0"
|
||||
style="width: 2rem; height: 2rem"
|
||||
v-on:click="open(mod?.path ?? '')"
|
||||
v-on:click="pkg?.loc && open(pkg.loc.path ?? '')"
|
||||
/>
|
||||
<Button
|
||||
rounded
|
||||
@ -46,7 +47,7 @@ defineProps({
|
||||
size="small"
|
||||
class="ml-2 shrink-0"
|
||||
style="width: 2rem; height: 2rem"
|
||||
v-on:click="open(mod?.package_url ?? '')"
|
||||
v-on:click="pkg?.rmt && open(pkg.rmt.package_url ?? '')"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
Reference in New Issue
Block a user