Skip to content

Commit

Permalink
Get something working
Browse files Browse the repository at this point in the history
  • Loading branch information
holdercp committed Feb 19, 2025
1 parent 72014eb commit 9032416
Showing 1 changed file with 82 additions and 3 deletions.
85 changes: 82 additions & 3 deletions apps/newsletter/src/index.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,91 @@
/* global __i18n_text_domain__ */
// /* global __i18n_text_domain__ */

import { createRoot } from '@wordpress/element';
import { __ } from '@wordpress/i18n';
// import { __ } from '@wordpress/i18n';

// TODO:
// - Add translations
// - Add styles
// - Determine best way to handle links
// - Automatically open import modal
// - Breakout Footer into separate component
// - Determine best way to retrieve config data

function Newsletter() {
return (
<div>
<h1>{ __( 'This is the placeholder for the newsletter widget', __i18n_text_domain__ ) }</h1>
<div className="newsletter-widget__footer">
<p>
Effortlessly turn posts into emails with our Newsletter feature-expand your reach, engage
readers, and monetize your writing. No coding required.{ ' ' }
<a href="https://wordpress.com/learn/courses/newsletters-101/wordpress-com-newsletter/">
Learn more
</a>
</p>
<div>
<h3>Quick Links</h3>
<ul>
<li>
<a href="edit.php">Publish your next post</a>
</li>
<li>
<a
href={
window.jetpackNewsletterWidgetConfigData.is_jetpack_site
? `?page=#!/stats/subscribers/${ window.jetpackNewsletterWidgetConfigData.hostname }`
: `https://wordpress.com/stats/subscribers/${ window.jetpackNewsletterWidgetConfigData.hostname }`
}
>
View subscriber stats
</a>
</li>
<li>
<a
href={
window.jetpackNewsletterWidgetConfigData.is_jetpack_site
? `https://cloud.jetpack.com/subscribers/${ window.jetpackNewsletterWidgetConfigData.hostname }`
: `https://wordpress.com/subscribers/${ window.jetpackNewsletterWidgetConfigData.hostname }`
}
>
Import subscribers
</a>
</li>
<li>
<a
href={
window.jetpackNewsletterWidgetConfigData.is_jetpack_site
? `https://cloud.jetpack.com/subscribers/${ window.jetpackNewsletterWidgetConfigData.hostname }`
: `https://wordpress.com/subscribers/${ window.jetpackNewsletterWidgetConfigData.hostname }`
}
>
Manage subscribers
</a>
</li>
<li>
<a
href={
window.jetpackNewsletterWidgetConfigData.is_jetpack_site
? `https://cloud.jetpack.com/monetize/${ window.jetpackNewsletterWidgetConfigData.hostname }`
: `https://wordpress.com/earn/${ window.jetpackNewsletterWidgetConfigData.hostname }`
}
>
Monetize
</a>
</li>
<li>
<a
href={
window.jetpackNewsletterWidgetConfigData.is_jetpack_site
? `?page=jetpack#newsletter`
: `https://wordpress.com/settings/newsletter/${ window.jetpackNewsletterWidgetConfigData.hostname }`
}
>
Newsletter settings
</a>
</li>
</ul>
</div>
</div>
</div>
);
}
Expand Down

0 comments on commit 9032416

Please sign in to comment.