diff options
author | Fabio Berger <me@fabioberger.com> | 2018-10-05 20:54:37 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-10-05 20:54:37 +0800 |
commit | 5f2cd33da07a7acc65f2e05acb35755f74af75a4 (patch) | |
tree | 13a3453c5104357568b70f4fec6f124dcbb492b9 /packages/react-shared | |
parent | e0355a2e395fc056fd1d5c5e1780784853546acd (diff) | |
download | dexon-sol-tools-5f2cd33da07a7acc65f2e05acb35755f74af75a4.tar dexon-sol-tools-5f2cd33da07a7acc65f2e05acb35755f74af75a4.tar.gz dexon-sol-tools-5f2cd33da07a7acc65f2e05acb35755f74af75a4.tar.bz2 dexon-sol-tools-5f2cd33da07a7acc65f2e05acb35755f74af75a4.tar.lz dexon-sol-tools-5f2cd33da07a7acc65f2e05acb35755f74af75a4.tar.xz dexon-sol-tools-5f2cd33da07a7acc65f2e05acb35755f74af75a4.tar.zst dexon-sol-tools-5f2cd33da07a7acc65f2e05acb35755f74af75a4.zip |
Remove style prop from Link
Diffstat (limited to 'packages/react-shared')
-rw-r--r-- | packages/react-shared/src/components/link.tsx | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/packages/react-shared/src/components/link.tsx b/packages/react-shared/src/components/link.tsx index 51ffa1e1d..60891dd7a 100644 --- a/packages/react-shared/src/components/link.tsx +++ b/packages/react-shared/src/components/link.tsx @@ -10,11 +10,12 @@ interface LinkProps { to: string; type?: LinkType; shouldOpenInNewTab?: boolean; - style?: React.CSSProperties; className?: string; onMouseOver?: (event: React.MouseEvent<HTMLElement>) => void; onMouseLeave?: (event: React.MouseEvent<HTMLElement>) => void; onMouseEnter?: (event: React.MouseEvent<HTMLElement>) => void; + textDecoration?: string; + fontColor?: string; } export interface LinkState {} @@ -29,11 +30,12 @@ export class Link extends React.Component<LinkProps, LinkState> { public static defaultProps: Partial<LinkProps> = { type: LinkType.ReactRoute, shouldOpenInNewTab: false, - style: {}, className: '', onMouseOver: _.noop.bind(_), onMouseLeave: _.noop.bind(_), onMouseEnter: _.noop.bind(_), + textDecoration: 'none', + fontColor: 'inherit', }; private _outerReactScrollSpan: HTMLSpanElement | null; constructor(props: LinkProps) { @@ -46,11 +48,13 @@ export class Link extends React.Component<LinkProps, LinkState> { } const styleWithDefault = { - textDecoration: 'none', + textDecoration: this.props.textDecoration, cursor: 'pointer', - ...this.props.style, + color: this.props.fontColor, }; + console.log('styleWithDefault', styleWithDefault); + switch (this.props.type) { case LinkType.External: return ( |