Update Settings.tsx
This commit is contained in:
parent
e87aff3801
commit
1e381e4940
1 changed files with 11 additions and 22 deletions
|
|
@ -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>
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue