mirror of
https://github.com/yldio/copilot.git
synced 2024-11-11 05:40:11 +02:00
anchor UI element
This commit is contained in:
parent
3d3b9faa0e
commit
270842db55
26
ui/src/components/anchor/index.js
Normal file
26
ui/src/components/anchor/index.js
Normal file
@ -0,0 +1,26 @@
|
||||
const constants = require('../../shared/constants');
|
||||
const React = require('react');
|
||||
const Styled = require('styled-components');
|
||||
|
||||
const {
|
||||
colors
|
||||
} = constants;
|
||||
|
||||
const {
|
||||
default: styled
|
||||
} = Styled;
|
||||
|
||||
const color = (props) => props.secondary
|
||||
? colors.brandSecondaryLink
|
||||
: colors.brandPrimaryLink;
|
||||
|
||||
const Anchor = styled.a`
|
||||
color: ${color} !important;
|
||||
`;
|
||||
|
||||
module.exports = Anchor;
|
||||
|
||||
module.exports.fn = (element) => (props) => React.cloneElement(element, {
|
||||
...element.props,
|
||||
...props
|
||||
}, element.props.children);
|
@ -1,6 +1,7 @@
|
||||
module.exports = {
|
||||
Base: require('./components/base'),
|
||||
AddMetric: require('./components/add-metric'),
|
||||
Anchor: require('./components/anchor'),
|
||||
Avatar: require('./components/avatar'),
|
||||
Button: require('./components/button'),
|
||||
Checkbox: require('./components/checkbox'),
|
||||
|
Loading…
Reference in New Issue
Block a user