Skip to content

Commit c931d92

Browse files
committed
PD-242 Minor changes to upgrade dialog and buttons.
1 parent f0b851b commit c931d92

File tree

6 files changed

+61
-45
lines changed

6 files changed

+61
-45
lines changed

assets/icon.svg

Lines changed: 26 additions & 23 deletions
Loading

css/_type-badges.scss

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,16 @@ $badges: (php: $php-active, css: $css-highlight, js: $js-highlight, html: $html-
5656
border-color: #ce0000;
5757
margin-left: 1px;
5858
}
59+
60+
.wp-core-ui .button.nav-tab-button {
61+
margin-left: 0.5em;
62+
float: right;
63+
color: #a7aaad;
64+
background: #f6f7f7;
65+
border-color: #f6f7f7;
66+
67+
&:hover {
68+
background-color: #fff;
69+
color: #3c434a;
70+
}
71+
}

css/edit/_upgrade-dialog.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
grid-template-columns: auto auto;
88
justify-content: center;
99
align-items: center;
10+
color: #3f444b;
1011

1112
img {
1213
height: 50px;
@@ -48,7 +49,7 @@
4849
}
4950

5051
.current-plan-cost {
51-
font-size: 13px;
52+
font-size: 1rem;
5253
}
5354

5455
.button .dashicons,

css/manage.scss

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,6 @@ $inactive-color: #ccc;
77

88
@import 'type-badges';
99

10-
.wp-core-ui .button.nav-tab-button {
11-
margin-left: 0.5em;
12-
float: right;
13-
color: #a7aaad;
14-
background: #f6f7f7;
15-
border-color: #f6f7f7;
16-
17-
&:hover {
18-
background-color: #fff;
19-
color: #3c434a;
20-
}
21-
}
22-
2310
.column-name,
2411
.column-type {
2512
.dashicons {

js/Edit/SnippetEditor/SnippetEditor.tsx

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { __ } from '@wordpress/i18n'
1+
import { __, _x } from '@wordpress/i18n'
22
import { addQueryArgs } from '@wordpress/url'
33
import { Editor, EditorConfiguration } from 'codemirror'
44
import React, { Dispatch, SetStateAction, useEffect } from 'react'
@@ -53,10 +53,6 @@ const SnippetTypeTab: React.FC<SnippetTypeTabProps> = ({
5353
{`${label} `}
5454

5555
<span className="badge">{tabType}</span>
56-
57-
{isProType(tabType) && !isLicensed() ?
58-
<span className="badge go-pro-badge">{__('Pro', 'code-snippets')}</span> :
59-
null}
6056
</a>
6157

6258
export const TYPE_LABELS: Record<SnippetType, string> = {
@@ -107,6 +103,21 @@ const SnippetTypeTabs: React.FC<SnippetTypeTabsProps> = ({
107103
setSnippet={setSnippet}
108104
openUpgradeDialog={openUpgradeDialog}
109105
/>)}
106+
107+
{!isLicensed() ?
108+
<a
109+
className="button button-large nav-tab-button nav-tab-inactive go-pro-button"
110+
href="https://codesnippets.pro/pricing/"
111+
title="Find more about Pro"
112+
onClick={event => {
113+
event.preventDefault()
114+
openUpgradeDialog()
115+
}}
116+
>
117+
{_x('Upgrade to ', 'Upgrade to Pro', 'code-snippets')}
118+
<span className="badge">{_x('Pro', 'Upgrade to Pro', 'code-snippets')}</span>
119+
</a> :
120+
null}
110121
</h2>
111122
)
112123
}

js/Edit/components/UpgradeDialog.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,9 @@ interface UpgradeInfoProps {
6161

6262
const UpgradeInfo: React.FC<UpgradeInfoProps> = ({ nextTab }) =>
6363
<>
64-
<p>{__('You are using the free version of Code Snippets.', 'code-snippets')}</p>
65-
<p>{__('Upgrade to Code Snippets Pro to unleash its full potential:', 'code-snippets')}
64+
<p>
65+
{__('You are using the free version of Code Snippets.', 'code-snippets')}{' '}
66+
{__('Upgrade to Code Snippets Pro to unleash its full potential:', 'code-snippets')}
6667
<ul>
6768
<li>
6869
<strong>{__('CSS stylesheet snippets: ', 'code-snippets')}</strong>
@@ -90,7 +91,7 @@ const UpgradeInfo: React.FC<UpgradeInfoProps> = ({ nextTab }) =>
9091
</li>
9192
</ul>
9293

93-
{__('… and more!', 'code-snippets')}
94+
{__('…and so much more!', 'code-snippets')}
9495
</p>
9596

9697
<p className="action-buttons">

0 commit comments

Comments
 (0)