Skip to content

Instantly share code, notes, and snippets.

@jeremyvial
Created December 9, 2020 21:19
Show Gist options
  • Save jeremyvial/1abdc62b8208e22d6b4d5ca95d00a2a8 to your computer and use it in GitHub Desktop.
Save jeremyvial/1abdc62b8208e22d6b4d5ca95d00a2a8 to your computer and use it in GitHub Desktop.
LWC Challenge Component1
<template>
<lightning-card
title="Welcome"
icon-name="standard:contact"
>
<h1>Hi thank you for participating in our challenge </h1>
<template if:true={isUserConnected}>
<h1> Congrats !! your key is : bdxcfvjgyjM2020 </h1>
</template>
</lightning-card>
</template>
import { LightningElement, api, track } from 'lwc';
import Id from '@salesforce/user/Id';
export default class Component1 extends LightningElement {
@api recordId;
@track areDetailsVisible = false;
get isUserConnected(){
if(Id != undefined && Id != null){return true}
else{ return false;}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment