mirror of
https://github.com/yldio/copilot.git
synced 2024-11-28 22:20:06 +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 = {
|
module.exports = {
|
||||||
Base: require('./components/base'),
|
Base: require('./components/base'),
|
||||||
AddMetric: require('./components/add-metric'),
|
AddMetric: require('./components/add-metric'),
|
||||||
|
Anchor: require('./components/anchor'),
|
||||||
Avatar: require('./components/avatar'),
|
Avatar: require('./components/avatar'),
|
||||||
Button: require('./components/button'),
|
Button: require('./components/button'),
|
||||||
Checkbox: require('./components/checkbox'),
|
Checkbox: require('./components/checkbox'),
|
||||||
|
Loading…
Reference in New Issue
Block a user