forked from LN-Zap/zap-desktop
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import React from 'react' | ||
import PropTypes from 'prop-types' | ||
import { Text } from 'components/UI' | ||
|
||
/** | ||
* @render react | ||
* @name Link | ||
* @example | ||
* <Link>Some text</Link> | ||
*/ | ||
class Link extends React.PureComponent { | ||
static displayName = 'Link' | ||
|
||
static propTypes = { | ||
children: PropTypes.node | ||
} | ||
|
||
render() { | ||
const { children } = this.props | ||
return ( | ||
<Text as="a" css={{ cursor: 'pointer', 'text-decoration': 'underline' }} {...this.props}> | ||
{children} | ||
</Text> | ||
) | ||
} | ||
} | ||
|
||
export default Link |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import React from 'react' | ||
import renderer from 'react-test-renderer' | ||
import { Link } from 'components/UI' | ||
|
||
describe('component.UI.Link', () => { | ||
it('should render correctly', () => { | ||
const tree = renderer.create(<Link>Link text</Link>).toJSON() | ||
expect(tree).toMatchSnapshot() | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`component.UI.Link should render correctly 1`] = ` | ||
.c0 { | ||
font-size: m; | ||
color: primaryText; | ||
cursor: pointer; | ||
-webkit-text-decoration: underline; | ||
text-decoration: underline; | ||
line-height: 1.4; | ||
} | ||
<a | ||
className="c0" | ||
color="primaryText" | ||
fontSize="m" | ||
> | ||
Link text | ||
</a> | ||
`; |