Skip to content
This repository has been archived by the owner on Mar 25, 2020. It is now read-only.

Settings

Hamzah Al Hariri edited this page Apr 2, 2019 · 4 revisions

Dashboard.Settings


INFO

Deprecated: ref={STRING}:

    <GUI.ConfigInput ref='username'/>

use callback refs instead:

    <GUI.ConfigInput ref={refs => this.handleRefs(refs, 'username')}/>

see: https://reactjs.org/docs/refs-and-the-dom.html for more info.

this.handleRefs() is a dashboard api will handle your refs and pass them as a config object


Getting started

Settings component used for your plugin settings config

Simple Settings

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

You can access your config from Dashboard components with props.config.username && props.config.password

Clone this wiki locally