Skip to content

Vibesfr/AvatarMedia

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AvatarMedia Tool

Provides Blog avatar for the Editor.js.

Installation

Get the package

yarn add @vibesfr/avatar-media

Include module at your application

import AvatarMedia from "@vibesfr/avatar-media";

It requires TailwindCSS to work properly !

## Usage

Add a new Tool to the `tools` property of the Editor.js initial config.

```javascript
var editor = EditorJS({
  ...

  tools: {
    ...
    avatarMedia: AvatarMedia,
  }

  ...
});

Config Params

config: {
    users: yourUsers,
    currentUser: yourCurrentUser,
}

Tool's settings

  1. Change the read time

  2. Change the user

Output data

Field Type Description
readTime integer read time duration
creationDate string creation date formated
user object user associated to the post
avatar string avatar url for the user
{
  "type": "avatarMedia",
  "data": {
    "readTime": "25",
    "creationDate": "12 mai 2024",
    "user": {
      "id": 2,
      "name": "Jean Dupont"
    },
    "avatar": "https://api.dicebear.com/8.x/initials/svg?seed=Jean%20DUPONT"
  }
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published