Maximised length of portal button text

no refs.
This commit is contained in:
Peter Zimon 2020-10-14 14:43:48 +02:00
parent 5b7b77a855
commit 548403dc03
4 changed files with 14 additions and 4 deletions

View File

@ -16,7 +16,7 @@ const DEV_MODE_DATA = {
showPopup: true,
site: Fixtures.site,
member: Fixtures.member.paid,
page: 'accountHome'
page: 'signup'
};
export default class App extends React.Component {
constructor(props) {

View File

@ -155,7 +155,7 @@ class TriggerButtonContent extends React.Component {
} = this.context.site;
if (this.hasText()) {
return (
<span style={{padding: '0 8px', color: '#fff'}}> {buttonText} </span>
<span className='gh-portal-triggerbtn-label'> {buttonText} </span>
);
}
return null;
@ -181,7 +181,7 @@ class TriggerButtonContent extends React.Component {
<div className='gh-portal-triggerbtn-wrapper' ref={this.container}>
<div className='gh-portal-triggerbtn-container with-label' onClick={e => this.onToggle(e)}>
{this.renderTriggerIcon()}
{this.renderText()}
{(hasText ? this.renderText() : '')}
</div>
</div>
);

View File

@ -60,6 +60,16 @@ const TriggerButtonStyles = `
padding: 0 12px 0 16px;
}
.gh-portal-triggerbtn-label {
padding: 8px;
color: rgb(255, 255, 255);
display: block;
white-space: nowrap;
max-width: 380px;
overflow: hidden;
text-overflow: ellipsis;
}
.gh-portal-avatar {
margin-bottom: 0px !important;
width: 60px;

View File

@ -17,7 +17,7 @@ export const site = {
portal_name: true,
portal_plans: ['yearly'],
portal_button_icon: 'icon-1',
portal_button_signup_text: 'Subscribe now',
portal_button_signup_text: 'Subscribe now this is a really long text that should not be the default but even though its still possible',
portal_button_style: 'icon-and-text',
members_support_address: 'support@example.com'
};