-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added textfile block * Create soft-jeans-listen.md * Added package to textfile-block * added package-lock --------- Co-authored-by: Malavika Koppula <[email protected]>
- Loading branch information
1 parent
8e5e2b9
commit 2b4eb36
Showing
7 changed files
with
123 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
|
||
--- | ||
|
||
Added textfile block |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Change Log | ||
|
||
All notable changes to this project will be documented in this file. | ||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import PropTypes from 'fusion:prop-types' | ||
import Consumer from 'fusion:consumer' | ||
|
||
export function Textfile({ customFields }){ | ||
const { Text = "" } = customFields || {}; | ||
return Text; | ||
}; | ||
|
||
Textfile.label = "Text File – Arc Block"; | ||
|
||
Textfile.icon = "notes-paper-text"; | ||
|
||
Textfile.propTypes = { | ||
customFields: PropTypes.shape({ | ||
// eslint-disable-next-line react/no-typos | ||
Text: PropTypes.richtext, | ||
}), | ||
} | ||
export default Consumer(Textfile) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import TextFile from "./text"; | ||
|
||
const simple = "User-agent: *\nAllow: /\n\nSitemap: http://www.example.com/sitemap.xml"; | ||
|
||
it('should render the simple text', () => { | ||
const textFile = TextFile({ | ||
customFields: { | ||
Text: simple | ||
}, | ||
}) | ||
expect(textFile).toMatchSnapshot() | ||
}) | ||
|
||
it('should not render anything when no data is given', () => { | ||
const textFile = TextFile({}) | ||
expect(textFile).toMatchSnapshot() | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
const base = require("../../jest/jest.config.base"); | ||
|
||
module.exports = { | ||
...base, | ||
}; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"name": "@wpmedia/textfile-block", | ||
"version": "0.0.1", | ||
"description": "Fusion News Theme text file block", | ||
"license": "CC-BY-NC-ND-4.0", | ||
"main": "index.js", | ||
"files": [ | ||
"features" | ||
], | ||
"publishConfig": { | ||
"registry": "https://npm.pkg.github.com/", | ||
"access": "public" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "ssh://[email protected]/WPMedia/feed-components.git", | ||
"directory": "blocks/textfile-block" | ||
}, | ||
"scripts": { | ||
"test": "echo \"Error: run tests from root\" && exit 1", | ||
"lint": "eslint --ext js --ext jsx features" | ||
}, | ||
"devDependencies": { | ||
"prop-types": "^15.7.2" | ||
}, | ||
"gitHead": "83fb8d6685958d85ddbfcfbf01d9a5c864cd6c95" | ||
} |