@campxdev/shared 1.11.7-1.alpha.12 → 1.11.7-1.alpha.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@campxdev/shared",
3
- "version": "1.11.7-1.alpha.12",
3
+ "version": "1.11.7-1.alpha.13",
4
4
  "main": "./exports.ts",
5
5
  "scripts": {
6
6
  "start": "react-scripts start",
@@ -1,8 +1,9 @@
1
1
  import { Box } from '@mui/material'
2
+ import { ReactElement } from 'react'
2
3
  const brokenImage = require('./broken-image.png')
3
4
 
4
5
  interface ImageProps {
5
- src: string
6
+ src: string | ReactElement
6
7
  alt: string
7
8
  height: string | number
8
9
  width: string | number
@@ -35,17 +36,13 @@ export default function Image({
35
36
  },
36
37
  }}
37
38
  >
38
- {svg ? (
39
- src
40
- ) : (
41
- <img
42
- src={src || defaultImage}
43
- alt={alt}
44
- onError={(e: any) => {
45
- e.target.src = defaultImage ? defaultImage : brokenImage
46
- }}
47
- />
48
- )}
39
+ <img
40
+ src={src || defaultImage}
41
+ alt={alt}
42
+ onError={(e: any) => {
43
+ e.target.src = defaultImage ? defaultImage : brokenImage
44
+ }}
45
+ />
49
46
  </Box>
50
47
  )
51
48
  }
@@ -1,9 +1,9 @@
1
1
  import { Box, Typography, styled } from '@mui/material'
2
- import { ReactNode } from 'react'
2
+ import { ReactElement, ReactNode } from 'react'
3
3
  import Image from './Image'
4
4
 
5
5
  interface Props {
6
- imageSrc: string
6
+ imageSrc: string | ReactElement
7
7
  height?: string
8
8
  message?: string | ReactNode
9
9
  svg?: boolean