diff --git a/demos/src/Extensions/FontFamily/React/index.html b/demos/src/Extensions/FontFamily/React/index.html new file mode 100644 index 00000000..860ed189 --- /dev/null +++ b/demos/src/Extensions/FontFamily/React/index.html @@ -0,0 +1,15 @@ + + + + + + + +
+ + + diff --git a/demos/src/Extensions/FontFamily/React/index.jsx b/demos/src/Extensions/FontFamily/React/index.jsx new file mode 100644 index 00000000..d6b1f9a8 --- /dev/null +++ b/demos/src/Extensions/FontFamily/React/index.jsx @@ -0,0 +1,68 @@ +import React from 'react' +import { useEditor, EditorContent } from '@tiptap/react' +import Document from '@tiptap/extension-document' +import Paragraph from '@tiptap/extension-paragraph' +import Text from '@tiptap/extension-text' +import TextStyle from '@tiptap/extension-text-style' +import FontFamily from '@tiptap/extension-font-family' + +export default () => { + const editor = useEditor({ + extensions: [Document, Paragraph, Text, TextStyle, FontFamily], + content: ` +

Did you know that Inter is a really nice font for interfaces?

+

It doesn’t look as professional as Comic Sans.

+

Serious people use serif fonts anyway.

+

The cool kids can apply monospace fonts aswell.

+

But hopefully we all can agree, that cursive fonts are the best.

+ `, + }) + + if (!editor) { + return null + } + + return ( +
+ + + + + + + + +
+ ) +} diff --git a/demos/src/Extensions/FontFamily/React/index.spec.js b/demos/src/Extensions/FontFamily/React/index.spec.js new file mode 100644 index 00000000..e9af0672 --- /dev/null +++ b/demos/src/Extensions/FontFamily/React/index.spec.js @@ -0,0 +1,7 @@ +context('/src/Extensions/FontFamily/React/', () => { + before(() => { + cy.visit('/src/Extensions/FontFamily/React/') + }) + + // TODO: Write tests +})