forstok-ui-lib 8.0.6 → 8.0.7

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": "forstok-ui-lib",
3
- "version": "8.0.6",
3
+ "version": "8.0.7",
4
4
  "description": "Forstok UI Components Library",
5
5
  "path": "dist",
6
6
  "main": "dist/index.js",
@@ -1,10 +1,32 @@
1
1
  import Image from '.'
2
2
 
3
3
  import { InitialContainer, APILabel } from '../../assets/stylesheets/shares.styles'
4
+ import LinkComponent from '../link';
4
5
 
5
6
  import { ImageMode } from './type'
6
7
 
7
- const ImageChannelComponent = ({ data, label, size, isImageOnly, $mode, $isPhone, labelPhone }:{ data?: any, label?: string, size?: string, isImageOnly?: boolean, $mode?: ImageMode, $isPhone?: boolean, labelPhone?: string }) => {
8
+ type TImage = {
9
+ data?: any;
10
+ label?: string;
11
+ size?: string;
12
+ isImageOnly?: boolean;
13
+ $mode?: ImageMode;
14
+ $isPhone?: boolean;
15
+ labelPhone?: string;
16
+ $url?: string;
17
+ }
18
+
19
+ const ImageChannelComponent = (props: TImage) => {
20
+ const {
21
+ data,
22
+ label,
23
+ size,
24
+ isImageOnly,
25
+ $mode,
26
+ $isPhone,
27
+ labelPhone,
28
+ $url } = props;
29
+
8
30
  const fontSize = size ? ((parseInt(size) / 2) > 10 ? (parseInt(size) / 2) : 10) : 10
9
31
  const defSize = size || '20px'
10
32
 
@@ -53,9 +75,13 @@ const ImageChannelComponent = ({ data, label, size, isImageOnly, $mode, $isPhone
53
75
  {!isImageOnly && (
54
76
  $isPhone ? (
55
77
  <div>
56
- <span className='multi-elipsis' title={defName}>
57
- {defName}
58
- </span>
78
+ {$url ? (
79
+ <LinkComponent mode='trans' href={$url}>
80
+ <span className='multi-elipsis' title={defName}>{defName}</span>
81
+ </LinkComponent>
82
+ ) : (
83
+ <span className='multi-elipsis' title={defName}>{defName}</span>
84
+ )}
59
85
  <aside className='multi-elipsis' title={defPhone} style={{ color: '#999999', fontSize: '12px' }}>
60
86
  {defPhone}
61
87
  </aside>