feat: Add more preferences

This commit is contained in:
Jesse Wierzbinski 2024-12-02 22:01:04 +01:00
parent 5203f47409
commit bb5de77bb1
No known key found for this signature in database
6 changed files with 123 additions and 19 deletions

View file

@ -110,6 +110,7 @@ import { SelectTrigger } from "radix-vue";
import { toast } from "vue-sonner";
import Note from "~/components/notes/note.vue";
import { Select, SelectContent, SelectItem } from "~/components/ui/select";
import { SettingIds } from "~/settings";
import { Button } from "../ui/button";
import { Input } from "../ui/input";
import { Textarea } from "../ui/textarea";
@ -117,10 +118,11 @@ import { Toggle } from "../ui/toggle";
import Files from "./files.vue";
const { Control_Enter, Command_Enter } = useMagicKeys();
const ctrlEnterSend = useSetting(SettingIds.CtrlEnterToSend);
const fileInput = ref<HTMLInputElement | null>(null);
watch([Control_Enter, Command_Enter], () => {
if (sending.value) {
if (sending.value || !ctrlEnterSend.value.value) {
return;
}

View file

@ -1,5 +1,5 @@
<script setup lang="ts">
import { Dialog, DialogContent } from "@/components/ui/dialog";
import { Dialog, DialogContent, DialogTitle } from "@/components/ui/dialog";
import type { Status, StatusSource } from "@versia/client/types";
import { toast } from "vue-sonner";
import Composer from "./composer.vue";
@ -58,6 +58,12 @@ const relation = ref(
<template>
<Dialog v-model:open="open" @update:open="o => {if (!o) { relation = null}}">
<DialogContent :hide-close="true" class="sm:max-w-xl max-w-full w-full grid-rows-[minmax(0,1fr)_auto] max-h-[90dvh] p-5 pt-6 top-0 sm:top-1/2 translate-y-0 sm:-translate-y-1/2">
<DialogTitle class="sr-only">
{{ relation?.type === "reply" ? "Reply" : relation?.type === "quote" ? "Quote" : "Compose" }}
</DialogTitle>
<DialogDescription class="sr-only">
{{ relation?.type === "reply" ? "Reply to this status" : relation?.type === "quote" ? "Quote this status" : "Compose a new status" }}
</DialogDescription>
<Composer :relation="relation ?? undefined" />
</DialogContent>
</Dialog>