Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
drawAllText(textLayer, courseName, achievement, dateObj) {
textLayer.destroyChildren()// clear first
const textpath = new Konva.TextPath({
x: 0,
y: 0,
fill: '#7D9EC0',
fontSize: 14,
fontFamily: 'Arial',
text: 'ULTRONELE',
data: 'M280 40 C 290 22, 340 22, 360 40'
})
const userName = this.state.userFullName
const userTxt = new Konva.Text({
x: 280, y: 196,
fontFamily: 'Bitter Bold',
fontSize: 24,
fontStyle: 'bold',
text: userName,
fill: 'black',
fontFamily: 'Bitter Bold',
fontSize: 14,
text: dateStr,
fill: '#333',
})
// const courseName = 'Business Essence'
const courseTxt = new Konva.Text({
x: 320, y: 264,
fontFamily: 'Bitter Bold',
fontSize: courseName.length>40?16:22,
text: courseName?courseName:'NO COURSE COMPLETED',
fill: 'black',
})
courseTxt.offsetX(courseTxt.width() / 2)
const achievemTxt = new Konva.TextPath({
x: 10, y: 306,
fill: '#EEE',
fontSize: 14,
fontStyle: 'bold',
fontFamily: 'Arial',
text: achievement,
// text: 'qualified',
data: 'M288 44 C 284 72, 342 72, 340 30'
})
const qore = new Konva.Text({
x: 310, y: 324,
fontFamily: 'Bitter Bold',
fontSize: 30,
text: achievement?achievement[0]:'-',
fill: 'white',