I have a .svg which looks like this:
So those are a few rectangles with border radius that have image as a background. That .svg was exported from Figma and I used react-svgr.com to convert it to a React component which looks like this:
import Svg, {
SvgProps,
Rect,
Path,
Defs,
Pattern,
Use,
Image,
} from "react-native-svg"
function SvgComponent(props: SvgProps) {
return (
<Svg
width={375}
height={451}
viewBox="0 0 375 451"
fill="none"
xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
{...props}
>
<Rect
x={141}
y={24}
width={45}
height={45}
rx={22.5}
fill="url(#pattern0)"
/>
<Rect
x={103}
y={1}
width={27}
height={27}
rx={13.5}
fill="url(#pattern1)"
fillOpacity={0.2}
/>
<Rect
x={37}
y={43}
width={52}
height={52}
rx={26}
fill="url(#pattern2)"
/>
<Rect
x={20}
y={119}
width={77}
height={77}
rx={38.5}
fill="url(#pattern3)"
/>
<Rect
x={109}
y={75}
width={36}
height={36}
rx={18}
fill="url(#pattern4)"
fillOpacity={0.5}
/>
<Rect
x={181}
y={105}
width={70}
height={70}
rx={35}
fill="url(#pattern5)"
/>
<Rect
x={286}
y={49}
width={70}
height={70}
rx={35}
fill="url(#pattern6)"
/>
<Rect
opacity={0.1}
x={283}
y={13}
width={24}
height={24}
rx={12}
fill="url(#pattern7)"
/>
<Rect
x={263}
y={140}
width={101}
height={101}
rx={50.5}
fill="url(#pattern8)"
/>
<Rect
x={221}
y={36}
width={48}
height={48}
rx={24}
fill="url(#pattern9)"
fillOpacity={0.5}
/>
<Rect
x={208}
width={15}
height={15}
rx={7.5}
fill="url(#pattern10)"
fillOpacity={0.5}
/>
<Path
fillRule="evenodd"
clipRule="evenodd"
d="M190 95.5C190 100.194 186.194 104 181.5 104C176.805 104 173 100.194 173 95.5C173 90.8056 176.805 87 181.5 87C186.194 87 190 90.8056 190 95.5ZM159 122.5C159 139.345 145.344 153 128.5 153C111.655 153 97.9998 139.345 97.9998 122.5C97.9998 105.655 111.655 92 128.5 92C145.344 92 159 105.655 159 122.5ZM90.2745 308.718C78.681 329.187 56.7037 343 31.5 343C-5.77922 343 -36 312.779 -36 275.5C-36 257.443 -28.9096 241.042 -17.3612 228.929C-19.0572 225.133 -20.0002 220.927 -20.0002 216.5C-20.0002 199.655 -6.34493 186 10.4998 186C20.055 186 28.5839 190.394 34.1762 197.272C45.6154 176.26 67.8924 162 93.5 162C108.072 162 121.565 166.617 132.596 174.469C135.396 160.513 147.72 150 162.5 150C175.81 150 187.129 158.526 191.293 170.414C194.198 169.496 197.291 169 200.5 169C205.309 169 209.859 170.113 213.905 172.096C217.213 158.829 229.209 149 243.5 149C260.345 149 274 162.655 274 179.5C274 185.335 272.361 190.788 269.519 195.423C272.975 195.143 276.471 195 280 195C301.742 195 322.218 200.421 340.15 209.985C345.133 199.92 355.508 193 367.5 193C384.344 193 398 206.655 398 223.5C398 234.1 392.592 243.437 384.385 248.903C399.256 269.815 408 295.386 408 323C408 393.692 350.692 451 280 451C260.867 451 242.714 446.802 226.413 439.277C222.008 439.755 217.532 440 213 440C145.069 440 90 384.931 90 317C90 314.217 90.0925 311.455 90.2745 308.718ZM194 156C202.836 156 210 148.837 210 140C210 131.163 202.836 124 194 124C185.163 124 178 131.163 178 140C178 148.837 185.163 156 194 156Z"
fill="#335EEA"
/>
<Defs>
<Pattern
id="pattern0"
patternContentUnits="objectBoundingBox"
width={1}
height={1}
>
<Use
xlinkHref="#image0"
transform="translate(0 -0.521277) scale(0.00425532)"
/>
</Pattern>
<Pattern
id="pattern1"
patternContentUnits="objectBoundingBox"
width={1}
height={1}
>
<Use
xlinkHref="#image1"
transform="translate(-0.25) scale(0.003125)"
/>
</Pattern>
<Pattern
id="pattern2"
patternContentUnits="objectBoundingBox"
width={1}
height={1}
>
<Use
xlinkHref="#image2"
transform="translate(0 -0.25) scale(0.003125)"
/>
</Pattern>
<Pattern
id="pattern3"
patternContentUnits="objectBoundingBox"
width={1}
height={1}
>
<Use
xlinkHref="#image3"
transform="translate(0 -0.181818) scale(0.00284091)"
/>
</Pattern>
<Pattern
id="pattern4"
patternContentUnits="objectBoundingBox"
width={1}
height={1}
>
<Use
xlinkHref="#image4"
transform="translate(0 -0.121762) scale(0.00259067)"
/>
</Pattern>
<Pattern
id="pattern5"
patternContentUnits="objectBoundingBox"
width={1}
height={1}
>
<Use
xlinkHref="#image5"
transform="translate(0 -0.25) scale(0.003125)"
/>
</Pattern>
<Pattern
id="pattern6"
patternContentUnits="objectBoundingBox"
width={1}
height={1}
>
<Use
xlinkHref="#image6"
transform="translate(0 -0.25) scale(0.003125)"
/>
</Pattern>
<Pattern
id="pattern7"
patternContentUnits="objectBoundingBox"
width={1}
height={1}
>
<Use
xlinkHref="#image7"
transform="translate(-0.0783133) scale(0.00240964)"
/>
</Pattern>
<Pattern
id="pattern8"
patternContentUnits="objectBoundingBox"
width={1}
height={1}
>
<Use
xlinkHref="#image8"
transform="translate(0 -0.25) scale(0.003125)"
/>
</Pattern>
<Pattern
id="pattern9"
patternContentUnits="objectBoundingBox"
width={1}
height={1}
>
<Use
xlinkHref="#image9"
transform="translate(-0.25) scale(0.003125)"
/>
</Pattern>
<Pattern
id="pattern10"
patternContentUnits="objectBoundingBox"
width={1}
height={1}
>
<Use
xlinkHref="#image10"
transform="translate(-0.25) scale(0.003125)"
/>
</Pattern>
<Image
id="image0"
width={235}
height={480}
xlinkHref="data..."
/>
<Image
id="image1"
width={480}
height={320}
xlinkHref="data..."
/>
<Image
id="image3"
width={352}
height={480}
xlinkHref="data..."
/>
<Image
id="image4"
width={386}
height={480}
xlinkHref="data..."
/>
<Image
id="image5"
width={320}
height={480}
xlinkHref="data..."
/>
<Image
id="image6"
width={320}
height={480}
xlinkHref="data..."
/>
<Image
id="image7"
width={480}
height={415}
xlinkHref="data..."
/>
<Image
id="image8"
width={320}
height={480}
xlinkHref="data..."
/>
<Image
id="image9"
width={480}
height={320}
xlinkHref="data..."
/>
<Image
id="image10"
width={480}
height={320}
xlinkHref="data.."
/>
</Defs>
</Svg>
)
}
export default SvgComponent
The problem I am experiencing is that the rendered svg component looks like that:
So the images for the rectangles that are defined as Patterns have wrong coordinates/do not match the position of those rectangles. I am not sure why this is the case and have tried reformating my .svg but nothing seemed to solve the issue. Can somebody please point me into the right direction?
Related
I am relatively new to coding and helping a project upload an image to their website banner. I know how to do it when the image is directly placed into the files, but I cant seem to figure out where these images are being sourced from. How would I go about uploading a new image?
const Coinsquare: React.FC<SVGProps<SVGSVGElement>> = ({ width = '252', height = '51', ...props }) => (
<svg
width={width}
height={height}
viewBox="0 0 252 51"
fill="none"
xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
{...props}
>
<rect x="0.991934" y="-0.50179932" width="251" height="50" fill="url(#coinsquare_logo)" />
<defs>
<pattern id="coinsquare_logo" patternContentUnits="objectBoundingBox" width="1" height="1">
<use xlinkHref="#image0_207_6382" transform="translate(-0.002843) scale(0.000967006 0.00485437)" />
</pattern>
<image
id="image0_207_6382"
width="1040"
height="206"
xlinkHref="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABBAAAADOCAYAAACHHvG8AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAEEKADA....."
/>
</defs>
</svg>
)
export default Coinsquare
I have in ToggleButtonGroup five SVG icons rendered, 4 of them are highlighted once are selected as it should be, they have the same color as describing text.
But 1 icon don't change, don't react once it's selected.
It's about
<StyledSideNavigationWrapper>
<StyledToggleButtonGroup
color="warning"
value={alignment}
exclusive
onChange={handleAlignment}
>
<StyledToggleButton
aria-label={TrainDetailsTranslation}
onClick={() => handleGoToDetails()}
value={`/trains/${idTrain}`}
>
<StyledDetailsIcon />
<StyledText>{TrainDetailsTranslation}</StyledText>
</StyledToggleButton>
<StyledToggleButton
aria-label={LinesTranslation}
onClick={() => handleGoToLines()}
value={`/lines`}
>
<StyledLinesIcon />
<StyledText>{LinesTranslation}</StyledText>
</StyledToggleButton>
<StyledToggleButton
aria-label={WheelsTranslation}
onClick={() => handleGoToWheels()}
value={`/trains/${idTrain}/wheels`}
>
<StyledWheelIcon />
<StyledText>{WheelsTranslation}</StyledText>
</StyledToggleButton>
<StyledToggleButton
aria-label={ServiceTranslation}
onClick={() => handleGoToService()}
value={`/trains/${idTrain}/service`}
>
<StyledServiceIcon />
<StyledText>{ServiceTranslation}</StyledText>
</StyledToggleButton>
<StyledToggleButton
aria-label={AlertsTranslation}
onClick={() => handleGoToAlerts()}
value={`/trains/${idTrain}/alerts`}
>
<StyledErrorIcon />
<StyledText>{AlertsTranslation}</StyledText>
</StyledToggleButton>
</StyledToggleButtonGroup>
</StyledSideNavigationWrapper>
Marked icon should be in orange color.
I guess it's connected to SVG file.
In one working icone code is like:
<svg width="21" height="20" viewBox="0 0 21 20" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
<path d="M12.28 13.3L18.28 19.3L20.39 17.14L14.39 11.14L12.28 13.3ZM16 8.1C15.61 8.1 15.19 8.05 14.86 7.91L3.46999 19.25L1.35999 17.14L8.76999 9.74L6.99999 7.96L6.27999 8.66L4.82999 7.25V10.11L4.12999 10.81L0.609985 7.25L1.30999 6.55H4.11999L2.71999 5.14L6.27999 1.58C6.55654 1.30195 6.88532 1.08131 7.24743 0.93075C7.60953 0.78019 7.99783 0.702682 8.38999 0.702682C8.78215 0.702682 9.17044 0.78019 9.53255 0.93075C9.89465 1.08131 10.2234 1.30195 10.5 1.58L8.38999 3.74L9.79999 5.14L9.08999 5.85L10.88 7.63L12.7 5.75C12.56 5.42 12.5 5 12.5 4.63C12.496 4.16832 12.5837 3.71045 12.7579 3.2829C12.9322 2.85535 13.1895 2.46662 13.515 2.13922C13.8406 1.81183 14.2278 1.55228 14.6544 1.37561C15.0809 1.19894 15.5383 1.10866 16 1.11C16.59 1.11 17.11 1.25 17.58 1.53L14.91 4.2L16.41 5.7L19.08 3.03C19.36 3.5 19.5 4 19.5 4.63C19.5 6.55 17.95 8.1 16 8.1Z" fill="currentColor"/>
</svg>
But one which is not working looks totally different. What should be changed there to make it work ?
<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<rect width="40" height="40" fill="url(#pattern0)"/>
<defs>
<pattern id="pattern0" patternContentUnits="objectBoundingBox" width="1" height="1">
<use xlink:href="#image0_4495_107104" transform="scale(0.00195312)"/>
</pattern>
<image id="image0_4495_107104" width="512" height="512" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAYAAAD0eNT6AAAABHNCSVQICAgIfAhkiAAAAAl
And here is very long code
Vk9uMQYN4uX4N7+d+df91BOg9f79e7XX6cDLwSt+GFUGz/Dwx76y6f1K6jAAAAAElFTkSuQmCC"/>
</defs>
</svg>
thanks a lot
I want to use JavaScript SVG as an icon. However, I keep getting this error. I fixed one error by changing xmls:xlink into xmlsXlink. However, it did not work same for xml:space.
SVG code
<svg
className="icon"
xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
version="1.1"
id="Layer_1"
x="0px"
y="0px"
viewBox="0 0 85 85"
style="enable-background:new 0 0 85 85;"
xml:space="preserve"
>
<polygon
class="st0"
points="6.3,1.2 13,75.4 42.4,83.8 72.1,75.4 78.9,1.2"
fill="#FFF"
/>
<g>
<g transform="translate(4.988 -113.385)">
<path
d="M7.1,189.8l-6.9-76.4H75l-7,76.4l-30.6,8.6L7.1,189.8z M62.4,185.6l5.8-65.5H37.6l0.2,72.2 L62.4,185.6z M34.7,129.8h-7.4L27.2,169l-14.5-4v9l21.9,5.9L34.7,129.8L34.7,129.8z"
fill="#D4B830"
/>
<path
d="M32.3,179.2c-1-0.3-5.7-1.6-10.6-2.9l-8.8-2.4v-4.4c0-4.3,0-4.4,0.4-4.3 c0.2,0.1,3.4,1,7.1,2l6.7,1.8l0.1-19.5l0.1-19.5h7.3v24.9c0,19.7-0.1,24.9-0.3,24.9C34.2,179.7,33.2,179.4,32.3,179.2L32.3,179.2z"
fill="#EBEBEB"
opacity="0.986"
fill-opacity="0"
enable-background="new"
/>
<path
d="M12.8,174v-9c0,0,9.2,2.6,14.4,3.9l0.1-39.1h7.4v50.1L12.8,174L12.8,174z"
fill="#EBEBEB"
opacity="0.986"
fill-opacity="0.9216"
enable-background="new"
/>
<path
d="M37.6,120.2h30.6l-5.8,65.5l-24.8,6.7V120.2z M60.8,174.6l2-24.5L48,151.8v-13.1l15.9-0.1 l0.6-8.9l-23.9,0.1l0.3,32.5l14.5-2.5l-0.2,7.2l-14.7,4l0.1,8.9L60.8,174.6L60.8,174.6z"
fill="#FDD83C"
/>
</g>
</g>
</svg>
You've no text in the file so just remove the xml:space attribute altogether.
So In React I'm trying to display the userQuizes but when I iterate the array object, the values are not printed and show as blank, and nothing is printed.
Here is the Array-Object:
Here is the array with one object only, that I want to iterate
And here is the code:
{
userQuizes === null ? 'loading' :
userQuizes.map(current => {
<div className={styles.your_quiz}>
<div className={styles.your_quiz_wrapper}>
<img src={your1} alt="Blog" className={styles.your_quiz_thumb} />
<div className={styles.your_quiz_info}>
<p className={styles.quiz_title}>
{current.title}
</p>
<p className={styles.quiz_description}>
{current.description}
</p>
</div>
</div>
<div>
<div className={styles.edit}>
<svg className={styles.edit_icon} viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M9.44781 14.0001C9.44781 16.489 11.4852 18.514 14.0007 18.514C16.5047 18.514 18.5421 16.489 18.5421 14.0001C18.5421 11.4999 16.5047 9.47483 14.0007 9.47483C11.4852 9.47483 9.44781 11.4999 9.44781 14.0001ZM20.6933 7.05382C22.6852 8.5924 24.3811 10.8437 25.599 13.6607C25.6901 13.8756 25.6901 14.1245 25.599 14.3282C23.1633 19.9621 18.8267 23.3334 14.0007 23.3334H13.9893C9.17464 23.3334 4.83805 19.9621 2.40228 14.3282C2.31122 14.1245 2.31122 13.8756 2.40228 13.6607C4.83805 8.02675 9.17464 4.66675 13.9893 4.66675H14.0007C16.4137 4.66675 18.7015 5.50392 20.6933 7.05382ZM14.002 16.8146C15.5614 16.8146 16.8362 15.5475 16.8362 13.9976C16.8362 12.4364 15.5614 11.1693 14.002 11.1693C13.8654 11.1693 13.7288 11.1806 13.6036 11.2032C13.5581 12.4477 12.5337 13.4432 11.2703 13.4432H11.2134C11.1793 13.6243 11.1565 13.8053 11.1565 13.9976C11.1565 15.5475 12.4313 16.8146 14.002 16.8146Z" fill="#5928E5" />
</svg>
<svg className={styles.edit_icon} viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M10.9391 23.3659L21.1899 10.1097C21.747 9.39482 21.9451 8.56835 21.7594 7.72682C21.5985 6.9618 21.128 6.2344 20.4223 5.68258L18.7015 4.31557C17.2035 3.12415 15.3465 3.24956 14.2818 4.61657L13.1304 6.11024C12.9819 6.29711 13.019 6.57302 13.2047 6.72351C13.2047 6.72351 16.114 9.0562 16.1759 9.10637C16.374 9.29449 16.5226 9.54532 16.5597 9.84631C16.6216 10.4358 16.2131 10.9876 15.6065 11.0628C15.3217 11.1004 15.0493 11.0127 14.8513 10.8496L11.7934 8.4166C11.6448 8.30498 11.422 8.32881 11.2982 8.4793L4.03099 17.8853C3.56055 18.4748 3.39961 19.2398 3.56055 19.9797L4.48906 24.0055C4.53858 24.2187 4.72428 24.3692 4.94713 24.3692L9.03258 24.319C9.77539 24.3065 10.4687 23.9679 10.9391 23.3659ZM16.6596 22.1121H23.3214C23.9714 22.1121 24.5 22.6476 24.5 23.3061C24.5 23.9657 23.9714 24.5 23.3214 24.5H16.6596C16.0097 24.5 15.481 23.9657 15.481 23.3061C15.481 22.6476 16.0097 22.1121 16.6596 22.1121Z" fill="#5928E5" />
</svg>
<svg className={styles.edit_icon} viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M23.6683 6.11671C24.1222 6.11671 24.5 6.49354 24.5 6.97304V7.41637C24.5 7.8842 24.1222 8.27269 23.6683 8.27269H4.33283C3.87784 8.27269 3.5 7.8842 3.5 7.41637V6.97304C3.5 6.49354 3.87784 6.11671 4.33283 6.11671H7.73449C8.42549 6.11671 9.02685 5.62555 9.1823 4.93256L9.36044 4.1369C9.63729 3.05308 10.5484 2.33325 11.5911 2.33325H16.4088C17.4402 2.33325 18.3616 3.05308 18.6282 4.07973L18.8188 4.93139C18.9731 5.62555 19.5745 6.11671 20.2666 6.11671H23.6683ZM21.9401 22.323C22.2953 19.0132 22.9171 11.1499 22.9171 11.0706C22.9398 10.8302 22.8615 10.6027 22.706 10.4196C22.5392 10.2481 22.3282 10.1466 22.0956 10.1466H5.91328C5.67954 10.1466 5.45715 10.2481 5.30284 10.4196C5.14626 10.6027 5.0691 10.8302 5.08045 11.0706C5.08253 11.0851 5.10484 11.3621 5.14214 11.8252C5.30785 13.8823 5.76936 19.6118 6.06759 22.323C6.27863 24.3203 7.58915 25.5756 9.48741 25.6211C10.9522 25.6549 12.4613 25.6666 14.0044 25.6666C15.4579 25.6666 16.9341 25.6549 18.4443 25.6211C20.4084 25.5873 21.7177 24.3541 21.9401 22.323Z" fill="#5928E5" />
</svg>
</div>
</div>
</div>
}
)
}
And here is the page that is not showing anything:
here is blank
Use return statement
{
userQuizes === null ? 'loading' :
userQuizes.map(current => {
return <div className={styles.your_quiz}>
<div className={styles.your_quiz_wrapper}>
<img src={your1} alt="Blog" className={styles.your_quiz_thumb} />
<div className={styles.your_quiz_info}>
<p className={styles.quiz_title}>
{current.title}
</p>
<p className={styles.quiz_description}>
{current.description}
</p>
</div>
</div>
<div>
<div className={styles.edit}>
<svg className={styles.edit_icon} viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M9.44781 14.0001C9.44781 16.489 11.4852 18.514 14.0007 18.514C16.5047 18.514 18.5421 16.489 18.5421 14.0001C18.5421 11.4999 16.5047 9.47483 14.0007 9.47483C11.4852 9.47483 9.44781 11.4999 9.44781 14.0001ZM20.6933 7.05382C22.6852 8.5924 24.3811 10.8437 25.599 13.6607C25.6901 13.8756 25.6901 14.1245 25.599 14.3282C23.1633 19.9621 18.8267 23.3334 14.0007 23.3334H13.9893C9.17464 23.3334 4.83805 19.9621 2.40228 14.3282C2.31122 14.1245 2.31122 13.8756 2.40228 13.6607C4.83805 8.02675 9.17464 4.66675 13.9893 4.66675H14.0007C16.4137 4.66675 18.7015 5.50392 20.6933 7.05382ZM14.002 16.8146C15.5614 16.8146 16.8362 15.5475 16.8362 13.9976C16.8362 12.4364 15.5614 11.1693 14.002 11.1693C13.8654 11.1693 13.7288 11.1806 13.6036 11.2032C13.5581 12.4477 12.5337 13.4432 11.2703 13.4432H11.2134C11.1793 13.6243 11.1565 13.8053 11.1565 13.9976C11.1565 15.5475 12.4313 16.8146 14.002 16.8146Z" fill="#5928E5" />
</svg>
<svg className={styles.edit_icon} viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M10.9391 23.3659L21.1899 10.1097C21.747 9.39482 21.9451 8.56835 21.7594 7.72682C21.5985 6.9618 21.128 6.2344 20.4223 5.68258L18.7015 4.31557C17.2035 3.12415 15.3465 3.24956 14.2818 4.61657L13.1304 6.11024C12.9819 6.29711 13.019 6.57302 13.2047 6.72351C13.2047 6.72351 16.114 9.0562 16.1759 9.10637C16.374 9.29449 16.5226 9.54532 16.5597 9.84631C16.6216 10.4358 16.2131 10.9876 15.6065 11.0628C15.3217 11.1004 15.0493 11.0127 14.8513 10.8496L11.7934 8.4166C11.6448 8.30498 11.422 8.32881 11.2982 8.4793L4.03099 17.8853C3.56055 18.4748 3.39961 19.2398 3.56055 19.9797L4.48906 24.0055C4.53858 24.2187 4.72428 24.3692 4.94713 24.3692L9.03258 24.319C9.77539 24.3065 10.4687 23.9679 10.9391 23.3659ZM16.6596 22.1121H23.3214C23.9714 22.1121 24.5 22.6476 24.5 23.3061C24.5 23.9657 23.9714 24.5 23.3214 24.5H16.6596C16.0097 24.5 15.481 23.9657 15.481 23.3061C15.481 22.6476 16.0097 22.1121 16.6596 22.1121Z" fill="#5928E5" />
</svg>
<svg className={styles.edit_icon} viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M23.6683 6.11671C24.1222 6.11671 24.5 6.49354 24.5 6.97304V7.41637C24.5 7.8842 24.1222 8.27269 23.6683 8.27269H4.33283C3.87784 8.27269 3.5 7.8842 3.5 7.41637V6.97304C3.5 6.49354 3.87784 6.11671 4.33283 6.11671H7.73449C8.42549 6.11671 9.02685 5.62555 9.1823 4.93256L9.36044 4.1369C9.63729 3.05308 10.5484 2.33325 11.5911 2.33325H16.4088C17.4402 2.33325 18.3616 3.05308 18.6282 4.07973L18.8188 4.93139C18.9731 5.62555 19.5745 6.11671 20.2666 6.11671H23.6683ZM21.9401 22.323C22.2953 19.0132 22.9171 11.1499 22.9171 11.0706C22.9398 10.8302 22.8615 10.6027 22.706 10.4196C22.5392 10.2481 22.3282 10.1466 22.0956 10.1466H5.91328C5.67954 10.1466 5.45715 10.2481 5.30284 10.4196C5.14626 10.6027 5.0691 10.8302 5.08045 11.0706C5.08253 11.0851 5.10484 11.3621 5.14214 11.8252C5.30785 13.8823 5.76936 19.6118 6.06759 22.323C6.27863 24.3203 7.58915 25.5756 9.48741 25.6211C10.9522 25.6549 12.4613 25.6666 14.0044 25.6666C15.4579 25.6666 16.9341 25.6549 18.4443 25.6211C20.4084 25.5873 21.7177 24.3541 21.9401 22.323Z" fill="#5928E5" />
</svg>
</div>
</div>
</div>
}
)
}
I am trying to use react-dropzone-component in reactjs, Everything works fine but after image is uploaded i want to add the onclick events to preview Template
Below is the config
const djsConfig = { addRemoveLinks: true, params: {
userId: this.props.userId }, previewTemplate:
<div class="dz-preview dz-file-preview" >
<div class="dz-image"><img data-dz-thumbnail /></div>
<div class="dz-details">
<div class="dz-size"><span data-dz-size></span></div>
<div class="dz-filename"><span data-dz-name></span></div>
</div>
<div class="dz-progress"><span class="dz-upload" data-dz-uploadprogress></span></div>
<div class="dz-error-message"><span data-dz-errormessage></span></div>
<div class="dz-success-mark">
<svg width="54px" height="54px" viewBox="0 0 54 54" version="1.1" xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">
<title>Check</title>
<defs></defs>
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">
<path d="M23.5,31.8431458 L17.5852419,25.9283877 C16.0248253,24.3679711 13.4910294,24.366835
11.9289322,25.9289322 C10.3700136,27.4878508 10.3665912,30.0234455 11.9283877,31.5852419 L20.4147581,40.0716123 C20.5133999,40.1702541 20.6159315,40.2626649 20.7218615,40.3488435 C22.2835669,41.8725651 24.794234,41.8626202 26.3461564,40.3106978 L43.3106978,23.3461564 C44.8771021,21.7797521 44.8758057,19.2483887 43.3137085,17.6862915
C41.7547899,16.1273729 39.2176035,16.1255422 37.6538436,17.6893022
L23.5,31.8431458 Z M27,53 C41.3594035,53 53,41.3594035 53,27
C53,12.6405965 41.3594035,1 27,1 C12.6405965,1 1,12.6405965 1,27
C1,41.3594035 12.6405965,53 27,53 Z" id="Oval-2"
stroke-opacity="0.198794158" stroke="#747474"
fill-opacity="0.816519475" fill="#FFFFFF"
sketch:type="MSShapeGroup"></path>
</g>
</svg>
</div>
<div class="dz-error-mark">
<svg width="54px" height="54px" viewBox="0 0 54 54" version="1.1" xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">
<title>Error</title>
<defs></defs>
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">
<g id="Check-+-Oval-2" sketch:type="MSLayerGroup" stroke="#747474"
stroke-opacity="0.198794158" fill="#FFFFFF"
fill-opacity="0.816519475">
<path d="M32.6568542,29 L38.3106978,23.3461564 C39.8771021,21.7797521 39.8758057,19.2483887
38.3137085,17.6862915 C36.7547899,16.1273729 34.2176035,16.1255422 32.6538436,17.6893022 L27,23.3431458 L21.3461564,17.6893022 C19.7823965,16.1255422 17.2452101,16.1273729 15.6862915,17.6862915
C14.1241943,19.2483887 14.1228979,21.7797521 15.6893022,23.3461564
L21.3431458,29 L15.6893022,34.6538436 C14.1228979,36.2202479
14.1241943,38.7516113 15.6862915,40.3137085 C17.2452101,41.8726271 19.7823965,41.8744578 21.3461564,40.3106978 L27,34.6568542 L32.6538436,40.3106978 C34.2176035,41.8744578 36.7547899,41.8726271
38.3137085,40.3137085 C39.8758057,38.7516113 39.8771021,36.2202479 38.3106978,34.6538436 L32.6568542,29 Z M27,53 C41.3594035,53 53,41.3594035 53,27 C53,12.6405965 41.3594035,1 27,1 C12.6405965,1
1,12.6405965 1,27 C1,41.3594035 12.6405965,53 27,53 Z" id="Oval-2"
sketch:type="MSShapeGroup"></path>
</g>
</g>
</svg>
</div>
</div> };
is there any way i can do it?