feat(plugins/settings): add donate UI
This commit is contained in:
parent
c16dcaa654
commit
fc41d45f2a
4 changed files with 135 additions and 33 deletions
|
|
@ -79,7 +79,8 @@ export default async function build(dev = Dev, log = true) {
|
||||||
.trim(),
|
.trim(),
|
||||||
),
|
),
|
||||||
__DEV__: String(dev),
|
__DEV__: String(dev),
|
||||||
// __BUILD_DEFAULT_PLUGIN_REPOSITORY_URL__: ...,
|
__BUILD_DEFAULT_PLUGIN_REPOSITORY_URL__: 'undefined',
|
||||||
|
__BUILD_DONATE_URL__: 'undefined',
|
||||||
|
|
||||||
// See types/build.d.ts for what these flags do
|
// See types/build.d.ts for what these flags do
|
||||||
__BUILD_FLAG_DEBUG_MODULE_LOOKUPS__: String(dev),
|
__BUILD_FLAG_DEBUG_MODULE_LOOKUPS__: String(dev),
|
||||||
|
|
|
||||||
BIN
src/assets/RevengeDonate.webp
Normal file
BIN
src/assets/RevengeDonate.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 14 KiB |
|
|
@ -1,39 +1,139 @@
|
||||||
|
import { getAssetIdByName } from '@revenge-mod/assets'
|
||||||
|
import { styles } from '@revenge-mod/components/_'
|
||||||
|
import { Design } from '@revenge-mod/discord/design'
|
||||||
import { SettingListRenderer } from '@revenge-mod/discord/modules/settings/renderer'
|
import { SettingListRenderer } from '@revenge-mod/discord/modules/settings/renderer'
|
||||||
|
import { Image, Linking, ScrollView, StyleSheet, View } from 'react-native'
|
||||||
|
import RevengeDonate from '~assets/RevengeDonate'
|
||||||
import { Setting } from '../constants'
|
import { Setting } from '../constants'
|
||||||
|
|
||||||
|
const { Button, Card, Stack, Text } = Design
|
||||||
|
|
||||||
export default function RevengeSettingScreen() {
|
export default function RevengeSettingScreen() {
|
||||||
return (
|
return (
|
||||||
<SettingListRenderer.SettingsList
|
<ScrollView style={{ flex: 1 }}>
|
||||||
node={{
|
<Stack spacing={0}>
|
||||||
type: 'list',
|
<View style={{ padding: 16, paddingBottom: 0 }}>
|
||||||
sections: [
|
<DonateCard />
|
||||||
{
|
</View>
|
||||||
label: 'Revenge',
|
<View>
|
||||||
settings: [
|
<SettingListRenderer.SettingsList
|
||||||
Setting.RevengeVersion,
|
node={{
|
||||||
Setting.LoaderVersion,
|
type: 'list',
|
||||||
Setting.RevengeDiscord,
|
sections: [
|
||||||
Setting.RevengeSourceRepository,
|
{
|
||||||
Setting.RevengeLicense,
|
label: 'Revenge',
|
||||||
],
|
settings: [
|
||||||
},
|
Setting.RevengeVersion,
|
||||||
{
|
Setting.LoaderVersion,
|
||||||
label: 'Versions',
|
Setting.RevengeDiscord,
|
||||||
settings: [
|
Setting.RevengeSourceRepository,
|
||||||
Setting.ReactVersion,
|
Setting.RevengeLicense,
|
||||||
Setting.ReactNativeVersion,
|
],
|
||||||
Setting.HermesVersion,
|
},
|
||||||
],
|
{
|
||||||
},
|
label: 'Versions',
|
||||||
{
|
settings: [
|
||||||
label: 'Actions',
|
Setting.ReactVersion,
|
||||||
settings: [
|
Setting.ReactNativeVersion,
|
||||||
Setting.Reload,
|
Setting.HermesVersion,
|
||||||
Setting.RevengeEnterRecoveryMode,
|
],
|
||||||
],
|
},
|
||||||
},
|
{
|
||||||
],
|
label: 'Actions',
|
||||||
}}
|
settings: [
|
||||||
/>
|
Setting.Reload,
|
||||||
|
Setting.RevengeEnterRecoveryMode,
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
</Stack>
|
||||||
|
</ScrollView>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
const cardStyles = StyleSheet.create({
|
||||||
|
background: {
|
||||||
|
position: 'absolute',
|
||||||
|
top: 0,
|
||||||
|
left: 0,
|
||||||
|
width: '100%',
|
||||||
|
height: '100%',
|
||||||
|
},
|
||||||
|
illustration: {
|
||||||
|
width: 96,
|
||||||
|
height: 96,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
function DonateCard() {
|
||||||
|
return (
|
||||||
|
<Card
|
||||||
|
style={{
|
||||||
|
position: 'relative',
|
||||||
|
padding: 0,
|
||||||
|
overflow: 'hidden',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<View
|
||||||
|
style={[
|
||||||
|
cardStyles.background,
|
||||||
|
{
|
||||||
|
opacity: 0.5,
|
||||||
|
experimental_backgroundImage:
|
||||||
|
'linear-gradient(166deg, rgba(255, 131, 29, 0.33), rgba(145, 47, 47, 0)), ' +
|
||||||
|
'linear-gradient(45deg, rgba(145, 47, 47, 0), rgba(255, 22, 22, 0.5))',
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
<View style={{ padding: 16 }}>
|
||||||
|
<Stack style={styles.grow} direction="horizontal" spacing={16}>
|
||||||
|
<Stack spacing={16} style={styles.flex}>
|
||||||
|
<Stack spacing={6} style={styles.flex}>
|
||||||
|
<Text
|
||||||
|
variant="heading-lg/semibold"
|
||||||
|
color="text-strong"
|
||||||
|
>
|
||||||
|
Support Revenge
|
||||||
|
</Text>
|
||||||
|
<Text variant="text-md/medium">
|
||||||
|
You can support the development of Revenge by
|
||||||
|
donating or contributing!
|
||||||
|
</Text>
|
||||||
|
</Stack>
|
||||||
|
<Stack spacing={12} direction="horizontal">
|
||||||
|
{__BUILD_DONATE_URL__ && (
|
||||||
|
<Button
|
||||||
|
size="sm"
|
||||||
|
icon={getAssetIdByName('HeartIcon')}
|
||||||
|
text="Donate"
|
||||||
|
variant="expressive"
|
||||||
|
onPress={() => {
|
||||||
|
Linking.openURL(__BUILD_DONATE_URL__)
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
<Button
|
||||||
|
size="sm"
|
||||||
|
icon={getAssetIdByName('HandRequestSpeakIcon')}
|
||||||
|
text="Contribute"
|
||||||
|
variant="primary-overlay"
|
||||||
|
onPress={() => {
|
||||||
|
Linking.openURL(
|
||||||
|
__BUILD_SOURCE_REPOSITORY_URL__,
|
||||||
|
)
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Stack>
|
||||||
|
</Stack>
|
||||||
|
<Image
|
||||||
|
source={RevengeDonate}
|
||||||
|
style={cardStyles.illustration}
|
||||||
|
/>
|
||||||
|
</Stack>
|
||||||
|
</View>
|
||||||
|
</Card>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
1
types/build.d.ts
vendored
1
types/build.d.ts
vendored
|
|
@ -3,6 +3,7 @@
|
||||||
declare global {
|
declare global {
|
||||||
const __DEV__: boolean
|
const __DEV__: boolean
|
||||||
const __BUILD_DISCORD_SERVER_URL__: string
|
const __BUILD_DISCORD_SERVER_URL__: string
|
||||||
|
const __BUILD_DONATE_URL__: string | undefined
|
||||||
const __BUILD_SOURCE_REPOSITORY_URL__: string
|
const __BUILD_SOURCE_REPOSITORY_URL__: string
|
||||||
const __BUILD_DEFAULT_PLUGIN_REPOSITORY_URL__: string | undefined
|
const __BUILD_DEFAULT_PLUGIN_REPOSITORY_URL__: string | undefined
|
||||||
const __BUILD_LICENSE_URL__: string
|
const __BUILD_LICENSE_URL__: string
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue