File tree 6 files changed +111
-3
lines changed
tailwind_components/buttons
6 files changed +111
-3
lines changed Original file line number Diff line number Diff line change
1
+ /* eslint-disable react-hooks/rules-of-hooks */
2
+ import {
3
+ PrefillEmbed ,
4
+ PrefillLang ,
5
+ useCodePenEmbed ,
6
+ stripIndent ,
7
+ } from "react-codepen-prefill-embed" ;
8
+
9
+ const Codepen = ( { htmlText} ) => {
10
+ useCodePenEmbed ( ) ;
11
+ return (
12
+ < PrefillEmbed
13
+ className = "codepen"
14
+ penTitle = "My sweet demo"
15
+ embedHeight = "400"
16
+ themeId = "319"
17
+ editable
18
+ description = "Renders a barebones React component"
19
+ tags = { [ "tailwind" , "html" , "tailwindcss" ] }
20
+ htmlClasses = { [ "loading" , "no-js" ] }
21
+ preview
22
+ defaultTabs = { [ "result" , "HTML" ] }
23
+ head = {
24
+ < meta name = "viewport" content = "width=device-width, initial-scale=1" />
25
+ }
26
+ scripts = { [ "https://cdn.tailwindcss.com" ] }
27
+ stylesheets = { [ "https://cdn.tailwindcss.com" ] } >
28
+ < PrefillLang lang = "html" > { htmlText } </ PrefillLang >
29
+ </ PrefillEmbed >
30
+ ) ;
31
+ } ;
32
+
33
+ export default Codepen ;
Original file line number Diff line number Diff line change 1
- import Image from ' next/image' ;
2
- import Link from ' next/link' ;
1
+ import Image from " next/image" ;
2
+ import Link from " next/link" ;
3
3
4
4
const Navbar = ( ) => {
5
5
return (
@@ -8,7 +8,7 @@ const Navbar = () => {
8
8
< Image src = "/nav_logo.png" alt = "logo" width = { 240 } height = { 36 } />
9
9
< div className = "right_contents" >
10
10
< div className = "nav_links" >
11
- < Link href = "/" > Components</ Link >
11
+ < Link href = "/components " > Components</ Link >
12
12
</ div >
13
13
< div className = "nav_links" >
14
14
< Link href = "/" > Documentation</ Link >
Original file line number Diff line number Diff line change 9
9
"lint" : " next lint"
10
10
},
11
11
"dependencies" : {
12
+ "html-to-text" : " ^8.2.1" ,
12
13
"next" : " 12.3.1" ,
13
14
"react" : " 18.2.0" ,
15
+ "react-codepen-prefill-embed" : " 0.0.2" ,
14
16
"react-dom" : " 18.2.0"
15
17
},
16
18
"devDependencies" : {
17
19
"autoprefixer" : " ^10.4.12" ,
18
20
"eslint" : " 8.25.0" ,
19
21
"eslint-config-next" : " 12.3.1" ,
22
+ "file-loader" : " ^6.2.0" ,
20
23
"postcss" : " ^8.4.18" ,
21
24
"tailwindcss" : " ^3.1.8"
22
25
}
Original file line number Diff line number Diff line change
1
+ import Head from "next/head" ;
2
+ import Navbar from "../components/navbar" ;
3
+ import Codepen from "../components/codepen" ;
4
+ import { useEffect , useState } from "react" ;
5
+ import { htmlToText } from "html-to-text" ;
6
+
7
+ import test from "../tailwind_components/buttons/test_file.jsx" ;
8
+ // const htmlText = htmlToText(test_component);
9
+ console . log ( htmlToText ( test ) ) ;
10
+
11
+ const Components = ( ) => {
12
+ return (
13
+ < div >
14
+ < Head >
15
+ < title > Tailwind Bootstrap</ title >
16
+ < meta name = "description" content = "TailwindCSS ui component bootstrap" />
17
+ < link rel = "icon" href = "/favicon.ico" />
18
+ </ Head >
19
+
20
+ < div className = " bg-slate-100 min-h-screen" >
21
+ < Navbar />
22
+ < Codepen htmlText = { test } />
23
+ </ div >
24
+ </ div >
25
+ ) ;
26
+ } ;
27
+
28
+ export default Components ;
Original file line number Diff line number Diff line change
1
+ const test = (
2
+ < div class = "bg-gray-50" >
3
+ < div class = "mx-auto max-w-7xl py-12 px-4 sm:px-6 lg:flex lg:items-center lg:justify-between lg:py-16 lg:px-8" >
4
+ < h2 class = "text-3xl font-bold tracking-tight text-gray-900 sm:text-4xl" >
5
+ < span class = "block" > Ready to dive in?</ span >
6
+ < span class = "block text-indigo-600" > Start your free trial today.</ span >
7
+ </ h2 >
8
+ < div class = "mt-8 flex lg:mt-0 lg:flex-shrink-0" >
9
+ < div class = "inline-flex rounded-md shadow" >
10
+ < a
11
+ href = "#"
12
+ class = "inline-flex items-center justify-center rounded-md border border-transparent bg-indigo-600 px-5 py-3 text-base font-medium text-white hover:bg-indigo-700" >
13
+ Get started
14
+ </ a >
15
+ </ div >
16
+ < div class = "ml-3 inline-flex rounded-md shadow" >
17
+ < a
18
+ href = "#"
19
+ class = "inline-flex items-center justify-center rounded-md border border-transparent bg-white px-5 py-3 text-base font-medium text-indigo-600 hover:bg-indigo-50" >
20
+ Learn more
21
+ </ a >
22
+ </ div >
23
+ </ div >
24
+ </ div >
25
+ </ div >
26
+ ) ;
27
+
28
+ export default test ;
Original file line number Diff line number Diff line change
1
+ const path = require ( "path" ) ;
2
+
3
+ module . exports = {
4
+ module : {
5
+ rules : [
6
+ {
7
+ test : / \. ( p n g | j p e ? g | g i f | h t m l ) $ / i,
8
+ use : [
9
+ {
10
+ loader : "file-loader" ,
11
+ } ,
12
+ ] ,
13
+ } ,
14
+ ] ,
15
+ } ,
16
+ } ;
You can’t perform that action at this time.
0 commit comments