From f7db2ec2f2d2f1e6339518b37df2c9927356af8c Mon Sep 17 00:00:00 2001 From: mgabdev <> Date: Wed, 18 Sep 2019 19:45:59 -0400 Subject: [PATCH] Updated promo panel to include button for upgrading to pro --- .../features/ui/components/promo_panel.js | 31 +++++++++++++++++-- .../styles/gabsocial/components.scss | 21 ++++++++++++- 2 files changed, 49 insertions(+), 3 deletions(-) diff --git a/app/javascript/gabsocial/features/ui/components/promo_panel.js b/app/javascript/gabsocial/features/ui/components/promo_panel.js index 96c5d7b6..15d5ef53 100644 --- a/app/javascript/gabsocial/features/ui/components/promo_panel.js +++ b/app/javascript/gabsocial/features/ui/components/promo_panel.js @@ -1,13 +1,40 @@ import React from 'react'; +import PropTypes from 'prop-types'; import { FormattedMessage } from 'react-intl'; import Icon from 'gabsocial/components/icon'; +import { connect } from 'react-redux'; +import { me } from '../../../initial_state'; + +const mapStateToProps = state => { + return { + isPro: state.getIn(['accounts', me, 'is_pro']), + }; +}; + +export default +@connect(mapStateToProps) +class PromoPanel extends React.PureComponent { + static propTypes = { + isPro: PropTypes.bool, + }; -export default class PromoPanel extends React.PureComponent { render() { + const { isPro } = this.props; + return (
-
+ { + !isPro && +
+ + + + +
+ } + +
diff --git a/app/javascript/styles/gabsocial/components.scss b/app/javascript/styles/gabsocial/components.scss index d523001a..07b082ad 100644 --- a/app/javascript/styles/gabsocial/components.scss +++ b/app/javascript/styles/gabsocial/components.scss @@ -1649,7 +1649,9 @@ a.account__display-name { } .promo-panel { - margin-top: 10px; + margin-top: 10px; + background-color: transparent !important; + overflow: hidden; } .promo-panel-item { @@ -1657,6 +1659,23 @@ a.account__display-name { height: 42px; line-height: 42px; border-bottom: 1px solid lighten($ui-base-color, 8%); + background: $gab-background-container; + body.theme-gabsocial-light & { + @include light-theme-shadow(); + background: $gab-background-container-light; + } + + &--highlighted { + background-color: #30CE7D; + border-radius: 10px; + font-weight: 600; + margin-bottom: 10px; + } + + &--top-rounded { + border-top-right-radius: 10px; + border-top-left-radius: 10px; + } &:last-of-type { border-bottom: none;