mirror of
https://github.com/yldio/copilot.git
synced 2024-12-29 05:10:05 +02:00
Merge pull request #330 from yldio/fix/ui-button-link
Fix/ui button link
This commit is contained in:
commit
63dec8741f
@ -33,7 +33,7 @@ const Projects = ({
|
||||
{empty}
|
||||
<Row>
|
||||
<Column xs={12}>
|
||||
<Button href={`/${org.id}/new-project`}>
|
||||
<Button to={`/${org.id}/new-project`}>
|
||||
<FormattedMessage id='create-new' />
|
||||
</Button>
|
||||
</Column>
|
||||
|
@ -125,7 +125,7 @@ const StyledButton = styled.button`
|
||||
}
|
||||
`;
|
||||
|
||||
const StyledAnchor = styled.a`
|
||||
const StyledAnchor = styled(Link)`
|
||||
display: inline-block;
|
||||
${style}
|
||||
`;
|
||||
@ -147,11 +147,12 @@ const Button = (props) => {
|
||||
|
||||
const {
|
||||
href = '',
|
||||
to = '',
|
||||
rr = false
|
||||
} = props;
|
||||
|
||||
const Views = [
|
||||
() => !href ? StyledButton : null,
|
||||
() => !to || !href ? StyledButton : null,
|
||||
() => !rr ? StyledAnchor : null,
|
||||
() => StyledLink
|
||||
];
|
||||
@ -165,7 +166,8 @@ const Button = (props) => {
|
||||
|
||||
Button.propTypes = {
|
||||
href: React.PropTypes.string,
|
||||
rr: React.PropTypes.bool
|
||||
rr: React.PropTypes.bool,
|
||||
to: React.PropTypes.string
|
||||
};
|
||||
|
||||
export default Baseline(
|
||||
|
Loading…
Reference in New Issue
Block a user