Skip to content

Commit

Permalink
chore: added many complex data
Browse files Browse the repository at this point in the history
  • Loading branch information
pacifiquem authored and pacifiquem committed Oct 1, 2023
1 parent be582bc commit 4c22549
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 15 deletions.
14 changes: 1 addition & 13 deletions demo/src/app.jsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,7 @@
import search from 'string-hunt'
import { useEffect, useState } from 'preact/hooks'
import FormatJson from './components/jsonFormatter'

const data = [
{
name: "John doe",
date: "10/10/2020",
age: 12
},
{
name: "Ivan doe",
date: "10/10/2020",
age: 14
},
]
import data from './utils/data'

export function App() {
const [query, setQuery] = useState("")
Expand Down
2 changes: 1 addition & 1 deletion demo/src/components/jsonFormatter.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default function FormatJson({ json, title }) {

}

return <div className="p-10 bg-neutral-700 bg-opacity-30 ">
return <div className="p-10 bg-neutral-700 bg-opacity-30 h-[60vh] overflow-auto">
<h1 className="text-3xl text-white font-semibold">{ title }</h1>
<hr className="my-4 opacity-10"/>
<JsonFormatter json={json} tabWith={4} jsonStyle={jsonStyle} />
Expand Down
24 changes: 23 additions & 1 deletion demo/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,26 @@

a{
color: darkorange;
}
}

/* Define the scrollbar track */
div::-webkit-scrollbar {
width: 5px; /* Adjust the width as needed */
}

/* Define the scrollbar thumb */
div::-webkit-scrollbar-thumb {
background-color: orange; /* Change the color of the scrollbar thumb */
border-radius: 5px; /* Round the corners of the thumb */
}

/* Define the scrollbar track (background) */
div::-webkit-scrollbar-track {
background-color: gray; /* Change the color of the scrollbar track */
}

/* Define the scrollbar corner */
div::-webkit-scrollbar-corner {
background-color: transparent; /* Change the color of the scrollbar corner */
}

40 changes: 40 additions & 0 deletions demo/src/utils/data.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
const data = [
{
id: 1,
name: "John Doe",
age: 30,
address: {
street: "123 Main St",
city: "New York",
state: "NY",
},
email: "[email protected]",
phone: "555-123-4567",
hobbies: ["Reading", "Gardening"],
isActive: true,
socialMedia: {
twitter: "@johndoe",
instagram: "@johndoe123",
},
},
{
id: 2,
name: "Jane Smith",
age: 25,
address: {
street: "456 Elm St",
city: "Los Angeles",
state: "CA",
},
email: "[email protected]",
phone: "555-987-6543",
hobbies: ["Painting", "Cooking"],
isActive: false,
socialMedia: {
twitter: "@janesmith",
instagram: "@janesmith456",
},
},
];

export default data;

0 comments on commit 4c22549

Please sign in to comment.