Settings

Settings component used for your plugin settings config

Plugin config

import { Plugin } from '@root'

const {
    GUI
} = Plugin

class Settings extends Plugin.Settings {
    plugin() {
        return(
            <>
                <GUI.ConfigInput    
                    name={'username'}
                    ref={refs => this.handleRefs(refs, 'username')}
                />
                
                <GUI.ConfigPassword
                    name={'password'}
                    ref={refs => this.handleRefs(refs, 'password')}
                />
            </>
        )
    }
}

export {
    Settings
}

You can access your plugin config from Dashboard main components withprops.config.username && props.config.password

Or with Plugin.useConfig() hook

Application config

import { Plugin } from '@root'

const {
    GUI
} = Plugin


class Settings extends Plugin.Settings {
    application() {
        return(
            <GUI.ConfigInput    
                name={'title'}
                ref={refs => this.handleRefs(refs, 'applicationTitle')}
            />
        )
    }
}

export {
    Settings
}

You can access your plugin config from Dashboard main components withprops.config.applicationTitle

Or with Plugin.useApplicationConfig() hook

And of course you can use plugin() and application() together, but make sure you don't use the same ref name in plugin() and application(), because one of em will override the other.

Last updated