From eee96f01e29ddb8b95e9429c4e584fe6e7e7faec Mon Sep 17 00:00:00 2001 From: Eug-VS Date: Sat, 8 Feb 2020 15:31:14 +0300 Subject: feat: implement initial markdown component --- src/index.tsx | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'src/index.tsx') diff --git a/src/index.tsx b/src/index.tsx index 9d32585..cba71b6 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -10,6 +10,7 @@ import { ContentSection, SmartList, Button, + Markdown, } from './lib'; import icon from './assets/icon.svg'; @@ -27,6 +28,8 @@ const useStyles = makeStyles(theme => ({ })); +const data = "# Getting started\n## Installation \nGo and install it \n# Development\nMore info on dev"; + const Icon = logo const headerContents = { @@ -89,19 +92,7 @@ const App: React.FC = () => { primary - -

- Fusce suscipit, wisi nec facilisis facilisis, est dui fermentum leo, quis tempor ligula erat quis odio. Nunc porta vulputate tellus. Nunc rutrum turpis sed pede. Sed bibendum. Aliquam posuere. -

-

- Link example -

-
- -

- Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec hendrerit tempor tellus. Donec pretium posuere tellus. Proin quam nisl, tincidunt et, mattis eget, convallis nec, purus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla posuere. Donec vitae dolor. Nullam tristique diam non turpis. Cras placerat accumsan nulla. Nullam rutrum. Nam vestibulum accumsan nisl. Pellentesque dapibus suscipit ligula. -

-
+ -- cgit v1.2.3 From a2877c2844825853b8913a07a40f814fc03ac999 Mon Sep 17 00:00:00 2001 From: eug-vs Date: Fri, 3 Apr 2020 03:30:16 +0300 Subject: feat: support Markdown by url --- src/index.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/index.tsx') diff --git a/src/index.tsx b/src/index.tsx index cba71b6..9678beb 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -28,8 +28,6 @@ const useStyles = makeStyles(theme => ({ })); -const data = "# Getting started\n## Installation \nGo and install it \n# Development\nMore info on dev"; - const Icon = logo const headerContents = { @@ -92,7 +90,7 @@ const App: React.FC = () => { primary - + -- cgit v1.2.3 From e491abb55723ab20a36ead83320e40627cca8e06 Mon Sep 17 00:00:00 2001 From: eug-vs Date: Fri, 3 Apr 2020 03:37:31 +0300 Subject: fix: correct linting errors :rotating_light: --- src/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/index.tsx') diff --git a/src/index.tsx b/src/index.tsx index 9678beb..6646cf0 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -90,7 +90,7 @@ const App: React.FC = () => { primary - + -- cgit v1.2.3 From 16cf77f051048fbcca89184462d31bfcb1e6c699 Mon Sep 17 00:00:00 2001 From: eug-vs Date: Sun, 5 Apr 2020 15:26:18 +0300 Subject: feat: update index.tsx :fire: --- src/index.tsx | 82 +++++++++++++++++++++++++---------------------------------- 1 file changed, 34 insertions(+), 48 deletions(-) (limited to 'src/index.tsx') diff --git a/src/index.tsx b/src/index.tsx index 6646cf0..704805c 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -1,15 +1,12 @@ import React, { useState } from 'react'; import ReactDOM from 'react-dom'; -import { makeStyles, Link } from '@material-ui/core'; +import { makeStyles } from '@material-ui/core'; import { BenzinThemeProvider, Header, Window, - ContentSection, - SmartList, - Button, Markdown, } from './lib'; @@ -32,8 +29,16 @@ const Icon = logo const headerContents = { home: null, - page: null, - 'another page': null, + space: null, + 'emoji': null, + 'material-ui': null, +}; + +const pageMap: Record = { + home: "https://raw.githubusercontent.com/eug-vs/react-benzin/develop/README.md", + space: "https://raw.githubusercontent.com/eug-vs/space/master/docs/environment.md", + emoji: "https://raw.githubusercontent.com/muan/emoji/gh-pages/README.md", + 'material-ui': "https://raw.githubusercontent.com/mui-org/material-ui/master/README.md", }; @@ -41,30 +46,24 @@ const App: React.FC = () => { const classes = useStyles(); const [page, setPage] = useState('home'); - const renderItem: React.FC = ({ index, style}) => { - return ( -
- -

- Fusce commodo. Vestibulum convallis, lorem a tempus semper, dui dui euismod elit, vitae placerat urna tortor vitae lacus. Nullam libero mauris, consequat quis, varius et, dictum id, arcu. Mauris mollis tincidunt felis. -

- {(index % 2 === 0)? - ( - - ) - : - ( - - ) - } -
-
- ); - }; + const url = pageMap[page]; + const filename = url.slice(url.lastIndexOf('/') + 1); + const metadata = [ + `## Markdown\n [Markdown file](${url}) that you can see on the left was parsed and processed by **BENZIN**!`, + 'Switch between tabs on the header to explore other markdown templates.', + 'Currently **only core features** of markdown function.', + 'Templates on the left are being loaded from the internet, though this pane is generated from plaintext.', + '## How do I use this feature?', + '```', + 'import Markdown from \'react-benzin\';', + 'const data = \'# Header\\nHello, *world!* \';', + 'ReactDOM.render(, document.getElementById(\'root\'));', + '```', + 'Yep! **Or even simpler**:', + '```', + 'ReactDOM.render(, document.getElementById(\'root\'));', + '```', + ].join('\n'); return ( @@ -79,26 +78,13 @@ const App: React.FC = () => { />
- -

- Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Pellentesque dapibus suscipit ligula. Donec posuere augue in quam. Etiam vel tortor sodales tellus ultricies commodo. Suspendisse potenti. Aenean in sem ac leo mollis blandit. Donec neque quam, dignissim in, mollis nec, sagittis eu, wisi. Phasellus lacus. Etiam laoreet quam sed arcu. Phasellus at dui in ligula mollis ultricies. Integer placerat tristique nisl. Praesent augue. Fusce commodo. -

- - -
- +
- - + +
+ +
); -- cgit v1.2.3 From 63c51e7c3f266534624a4a115fdda21076dce562 Mon Sep 17 00:00:00 2001 From: eug-vs Date: Sun, 5 Apr 2020 17:26:07 +0300 Subject: feat: add emojis and spacevim tab to index --- src/index.tsx | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'src/index.tsx') diff --git a/src/index.tsx b/src/index.tsx index 704805c..0128140 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -30,15 +30,17 @@ const Icon = logo const headerContents = { home: null, space: null, + 'spacevim': null, 'emoji': null, 'material-ui': null, }; const pageMap: Record = { - home: "https://raw.githubusercontent.com/eug-vs/react-benzin/develop/README.md", - space: "https://raw.githubusercontent.com/eug-vs/space/master/docs/environment.md", - emoji: "https://raw.githubusercontent.com/muan/emoji/gh-pages/README.md", - 'material-ui': "https://raw.githubusercontent.com/mui-org/material-ui/master/README.md", + home: 'https://raw.githubusercontent.com/eug-vs/react-benzin/develop/README.md', + space: 'https://raw.githubusercontent.com/eug-vs/space/master/docs/environment.md', + 'spacevim': 'https://raw.githubusercontent.com/spacevim/spacevim/master/README.md', + emoji: 'https://raw.githubusercontent.com/muan/emoji/gh-pages/README.md', + 'material-ui': 'https://raw.githubusercontent.com/mui-org/material-ui/master/README.md', }; @@ -47,16 +49,16 @@ const App: React.FC = () => { const [page, setPage] = useState('home'); const url = pageMap[page]; - const filename = url.slice(url.lastIndexOf('/') + 1); + const fileName = url.slice(url.lastIndexOf('/') + 1); const metadata = [ - `## Markdown\n [Markdown file](${url}) that you can see on the left was parsed and processed by **BENZIN**!`, - 'Switch between tabs on the header to explore other markdown templates.', + `## Markdown\n [Markdown file](${url}) *(...${fileName})* that you can see on the left was parsed and processed by **BENZIN**! :rocket:`, + 'Switch between tabs on the header to explore other markdown templates. :recycle: ', 'Currently **only core features** of markdown function.', - 'Templates on the left are being loaded from the internet, though this pane is generated from plaintext.', + 'Templates on the left are being loaded from the internet, though this pane is generated from plaintext. :pen:', '## How do I use this feature?', '```', 'import Markdown from \'react-benzin\';', - 'const data = \'# Header\\nHello, *world!* \';', + 'const data = \'# Header\\nHello, *world!*\';', 'ReactDOM.render(, document.getElementById(\'root\'));', '```', 'Yep! **Or even simpler**:', -- cgit v1.2.3 From 5e32be8569d93f56266d3bf707a7b099cb88e524 Mon Sep 17 00:00:00 2001 From: eug-vs Date: Sun, 5 Apr 2020 22:37:55 +0300 Subject: docs: tweak text on frontpage --- src/index.tsx | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src/index.tsx') diff --git a/src/index.tsx b/src/index.tsx index 0128140..a9f919f 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -54,17 +54,13 @@ const App: React.FC = () => { `## Markdown\n [Markdown file](${url}) *(...${fileName})* that you can see on the left was parsed and processed by **BENZIN**! :rocket:`, 'Switch between tabs on the header to explore other markdown templates. :recycle: ', 'Currently **only core features** of markdown function.', - 'Templates on the left are being loaded from the internet, though this pane is generated from plaintext. :pen:', + 'Templates on the left are being loaded from the [GitHub](https://github.com), though this pane is generated from plaintext. :pen:', '## How do I use this feature?', '```', 'import Markdown from \'react-benzin\';', 'const data = \'# Header\\nHello, *world!*\';', 'ReactDOM.render(, document.getElementById(\'root\'));', '```', - 'Yep! **Or even simpler**:', - '```', - 'ReactDOM.render(, document.getElementById(\'root\'));', - '```', ].join('\n'); return ( -- cgit v1.2.3