Fix: OnClick doesn't fire event on SVG icons of Datasource manager modal (#1933)

* Fixed: click event didn't work on svg

* Fixed: list items' height problem

* changed CardIcon component to a function
This commit is contained in:
Muhsin Shah C P 2022-01-26 09:01:52 +05:30 committed by GitHub
parent 046743eab7
commit 34a1aeee2d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View file

@ -184,6 +184,10 @@
border-radius: 4px!important;
background-color: $primary!important;
}
.list-group-item + .list-group-item.active {
margin-top: 0px!important;
}
}
.modal-body-content {

View file

@ -2,7 +2,7 @@ import React from 'react';
import { allSvgs } from '@tooljet/plugins/client';
const Card = ({ title, src, handleClick, height = 50, width = 50, usepluginIcon = false }) => {
const CardIcon = ({ src, height, width }) => {
const displayIcon = (src) => {
if (usepluginIcon) {
const Icon = allSvgs[src];
return <Icon style={{ height, width }} />;
@ -23,7 +23,7 @@ const Card = ({ title, src, handleClick, height = 50, width = 50, usepluginIcon
>
<div className="card-body">
<center>
<CardIcon src={src} height={height} width={width} />
{displayIcon(src)}
<br></br>
<br></br>
<span>{title}</span>