Create Settings.tsx
This commit is contained in:
parent
ad9963ade2
commit
3914eb8e11
1 changed files with 33 additions and 0 deletions
33
src/core/plugins/CustomBackgroundMusic/Settings.tsx
Normal file
33
src/core/plugins/CustomBackgroundMusic/Settings.tsx
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
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, playFromUrl } from ".";
|
||||
|
||||
const { FormSection, FormRow, FormIcon, FormInput } = Forms;
|
||||
|
||||
export default function Settings() {
|
||||
useProxy(storage);
|
||||
|
||||
return (
|
||||
<General.ScrollView style={{ flex: 1 }}>
|
||||
<FormSection title="Background Music">
|
||||
<FormRow
|
||||
label="Music URL"
|
||||
leading={<FormIcon source={getAssetIDByName("ic_link")} />}
|
||||
/>
|
||||
<FormInput
|
||||
title=""
|
||||
keyboardType="url"
|
||||
placeholder="https://link.to/music.mp3"
|
||||
value={settings.url}
|
||||
onChange={(x: string) => {
|
||||
settings.url = x;
|
||||
if (x) playFromUrl(x);
|
||||
}}
|
||||
style={{ marginTop: -25, marginHorizontal: 12 }}
|
||||
/>
|
||||
</FormSection>
|
||||
</General.ScrollView>
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue