Skip to content

Commit

Permalink
🚀 v2.0.0 for strapi v4 - first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
alexzaganelli committed Feb 7, 2022
1 parent 46d06f6 commit 530cca1
Show file tree
Hide file tree
Showing 39 changed files with 1,579 additions and 1,288 deletions.
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Strapi email designer plugin 💅
# Strapi Email Designer plugin 💅

<p align="left">
<a href="https://www.npmjs.org/package/strapi-plugin-email-designer">
Expand Down Expand Up @@ -28,6 +28,13 @@ _Visual composer provided by [Unlayer](https://unlayer.com/)_

&nbsp;

## ⚙️ Versions

- **Strapi v4** - (current) - [v2.x](https://github.com/alexzaganelli/strapi-plugin-email-designer)
- **Strapi v3** - [v1.x](https://github.com/alexzaganelli/strapi-plugin-email-designer/tree/strapi-v3)

&nbsp;

## ⏳ Installation

Install Strapi with this **Quickstart** command to create a Strapi project instantly:
Expand Down Expand Up @@ -107,7 +114,7 @@ Tips: in the template's body is possible to iterate array like this:
},
{
templateId: 1, // required - you can get the template id from the admin panel (can change on import)
sourceCodeToTemplateId: 55, // ID that can be defined in the template designer (won't change on import)
templateReferenceId: 55, // ID that can be defined in the template designer (won't change on import)
subject: `Thank you for your order`, // If provided here will override the template's subject. Can include variables like `Thank you for your order {{= user.firstName }}!`
},
{
Expand Down Expand Up @@ -320,3 +327,9 @@ This project follows the [all-contributors](https://github.com/all-contributors/
## Forkers ✨
[![Forkers repo roster for @alexzaganelli/strapi-plugin-email-designer](https://reporoster.com/forks/alexzaganelli/strapi-plugin-email-designer)](https://github.com/alexzaganelli/strapi-plugin-email-designer/network/members)
## Support Me ✨
If you like this plugin I'd like to drink a virtual beer w/ u. Thank you in advance!
[!["Buy Me A Beer"](https://img.buymeacoffee.com/button-api/?text=Buy+me+a+beer&emoji=🍺&slug=alexzaganelli&button_colour=FFDD00&font_colour=000000&font_family=Cookie&outline_colour=000000&coffee_colour=ffffff)](https://www.buymeacoffee.com/alexzaganelli)
26 changes: 26 additions & 0 deletions admin/src/components/Initializer/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/**
*
* Initializer
*
*/

import { useEffect, useRef } from 'react';
import PropTypes from 'prop-types';
import pluginId from '../../pluginId';

const Initializer = ({ setPlugin }) => {
const ref = useRef();
ref.current = setPlugin;

useEffect(() => {
ref.current(pluginId);
}, []);

return null;
};

Initializer.propTypes = {
setPlugin: PropTypes.func.isRequired,
};

export default Initializer;
6 changes: 3 additions & 3 deletions admin/src/components/MediaLibrary/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useEffect, useState } from 'react';
import { useStrapi, prefixFileUrlWithBackendUrl } from 'strapi-helper-plugin';
import { useStrapi, prefixFileUrlWithBackendUrl } from '@strapi/helper-plugin';

const MediaLibrary = ({ isOpen, onChange, onToggle, filesToUpload }) => {
const {
Expand All @@ -18,7 +18,7 @@ const MediaLibrary = ({ isOpen, onChange, onToggle, filesToUpload }) => {

const Component = getComponent('media-library').Component;

const handleInputChange = data => {
const handleInputChange = (data) => {
if (data) {
const { url } = data;

Expand Down Expand Up @@ -51,4 +51,4 @@ const MediaLibrary = ({ isOpen, onChange, onToggle, filesToUpload }) => {
return null;
};

export default MediaLibrary;
export default MediaLibrary;
12 changes: 12 additions & 0 deletions admin/src/components/PluginIcon/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
*
* PluginIcon
*
*/

import React from 'react';
import Puzzle from '@strapi/icons/Puzzle';

const PluginIcon = () => <Puzzle />;

export default PluginIcon;
3 changes: 0 additions & 3 deletions admin/src/components/Tabs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

import React from 'react';
import { FormattedMessage } from 'react-intl';
import { darken } from 'strapi-helper-plugin';
import { map } from 'lodash';

import PropTypes from 'prop-types';
Expand All @@ -18,8 +17,6 @@ function TabsNav({ links, style }) {
return (
<Wrapper style={style}>
{map(links, (link) => {
linkColor = darken(linkColor, 1.5);

return (
<button
key={link.name}
Expand Down
Loading

0 comments on commit 530cca1

Please sign in to comment.