Add onClick event to Other results cards

This commit is contained in:
2020-07-24 01:10:57 +02:00
parent a5ed4f84f6
commit 2b415b5189
3 changed files with 32 additions and 10 deletions
+17 -3
View File
@@ -1,9 +1,23 @@
import React from 'react';
import { Box, Heading, Image } from 'grommet';
import { Box, Heading } from 'grommet';
export const Other = ({ image, name }: { image: string; name: string }) => {
export const Other = ({
image,
name,
handleClick,
}: {
image: string;
name: string;
handleClick: ((...args: any[]) => any) & ((event: MouseEvent) => void);
}) => {
return (
<Box round='xxsmall' overflow='hidden' align='center' pad='small'>
<Box
round='xxsmall'
overflow='hidden'
align='center'
pad='small'
onClick={handleClick}
>
<Heading
level='4'
margin={{ bottom: 'small', top: 'small', left: 'small' }}