• shajakk kkaj
  • NEWBIE
  • 0 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 0
    Replies
I've done all the steps recommended in the following documentation but my fields on pre chat are not in lightning style. Is there something that I need to do to make my fields in lightning style?

User-added image
https://developer.salesforce.com/docs/component-library/bundle/lightningsnapin-base-prechat
I'm kinda newbie on js and lightning but i was trying to figure out what this code below is doing. In js a map method runs a function for each item on array but I dont understand why the code is running with a const and getting the field to fillup. 
I also need verify baseprechat's interface to check the method and atributes available but i havent found even though i retrieve all the code to my vscode.
 
import BasePrechat from 'lightningsnapin/basePrechat';
import { api, track } from 'lwc';
import startChatLabel from '@salesforce/label/c.StartChat';

export default class Prechat extends BasePrechat {
    @api prechatFields;
    @api backgroundImgURL;
    @track fields;
    @track namelist;
    startChatLabel;

    /**
     * Set the button label and prepare the prechat fields to be shown in the form.
     */
    connectedCallback() {
        this.startChatLabel = startChatLabel;
        this.fields = this.prechatFields.map(field => {
            const { label, name, value, required, maxLength } = field;

            return { label, value, name, required, maxLength };
        });
        this.namelist = this.fields.map(field => field.name);
    }
}