Update Settings.tsx

This commit is contained in:
OTKUSteyler 2026-09-11 07:38:52 +02:00 • committed by GitHub
parent e87aff3801
commit 1e381e4940
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2,42 +2,31 @@ import { storage } from "@vendetta/plugin";
import { useProxy } from "@vendetta/storage";
import { getAssetIDByName } from "@vendetta/ui/assets";
import { Forms, General } from "@vendetta/ui/components";
import { settings } from ".";
import { settings, playFromUrl } from ".";
const { FormSection, FormRow, FormIcon, FormInput, FormSliderRow } = Forms;
const { FormSection, FormRow, FormIcon, FormInput } = Forms;
export default function Settings() {
useProxy(storage);
return (
<General.ScrollView style={{ flex: 1 }}>
<FormSection title="Background">
<FormSection title="Background Music">
<FormRow
label="Image URL"
leading={<FormIcon source={getAssetIDByName("ic_image")} />}
label="Music URL"
leading={<FormIcon source={getAssetIDByName("ic_link")} />}
/>
<FormInput
title=""
keyboardType="url"
placeholder="https://link.to/background.png"
value={settings.backgroundUrl}
onChange={(x: string) => (settings.backgroundUrl = x)}
placeholder="https://link.to/music.mp3"
value={settings.url}
onChange={(x: string) => {
settings.url = x;
if (x) playFromUrl(x);
}}
style={{ marginTop: -25, marginHorizontal: 12 }}
/>
<FormSliderRow
label="Opacity"
value={settings.opacity ?? 0.3}
minimumValue={0}
maximumValue={1}
onValueChange={(v: number) => (settings.opacity = v)}
/>
<FormSliderRow
label="Blur"
value={settings.blur ?? 0}
minimumValue={0}
maximumValue={25}
onValueChange={(v: number) => (settings.blur = v)}
/>
</FormSection>
</General.ScrollView>
);