From d4d56e5dc8334694184cc683b41d5963d10614b2 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Tue, 21 Apr 2020 19:44:55 -0500 Subject: [PATCH] Add "Edit profile" button --- app/gabsocial/components/button.js | 17 ++++++++- .../features/account/components/header.js | 2 + app/styles/gabsocial/components/buttons.scss | 37 ++++++++++--------- 3 files changed, 37 insertions(+), 19 deletions(-) diff --git a/app/gabsocial/components/button.js b/app/gabsocial/components/button.js index 2e8cf1cc1..00aeeeae9 100644 --- a/app/gabsocial/components/button.js +++ b/app/gabsocial/components/button.js @@ -1,18 +1,22 @@ import React from 'react'; import PropTypes from 'prop-types'; import classNames from 'classnames'; +import { Link } from 'react-router-dom'; +import Icon from './icon'; export default class Button extends React.PureComponent { static propTypes = { text: PropTypes.node, onClick: PropTypes.func, + to: PropTypes.string, disabled: PropTypes.bool, block: PropTypes.bool, secondary: PropTypes.bool, size: PropTypes.number, className: PropTypes.string, style: PropTypes.object, + icon: PropTypes.string, children: PropTypes.node, }; @@ -47,7 +51,7 @@ export default class Button extends React.PureComponent { 'button--block': this.props.block, }); - return ( + const btn = ( ); + + if (this.props.to) { + return ( + + {btn} + + ); + } else { + return btn; + } } } diff --git a/app/gabsocial/features/account/components/header.js b/app/gabsocial/features/account/components/header.js index 78b880dfa..4cbd371f1 100644 --- a/app/gabsocial/features/account/components/header.js +++ b/app/gabsocial/features/account/components/header.js @@ -213,6 +213,8 @@ class Header extends ImmutablePureComponent { } else if (account.getIn(['relationship', 'blocking'])) { actionBtn =