Skip to content

Commit

Permalink
fix: moved examples into docs/react
Browse files Browse the repository at this point in the history
  • Loading branch information
shibisuriya committed May 26, 2024
1 parent fb83369 commit be53404
Show file tree
Hide file tree
Showing 21 changed files with 203 additions and 17 deletions.
2 changes: 1 addition & 1 deletion packages/docs/core-concepts/how-it-works.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Try resizing / moving the grid item below to observe the model update automatica
import { createElement } from 'react'
import { createRoot } from 'react-dom/client'
import { ref, onMounted } from 'vue'
import {Simple} from '@declarative-gridstack/react/examples'
import {Simple} from '../frameworks/react/examples/simple/Simple.jsx'
const el = ref()
onMounted(() => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import React, { Fragment, useState, useRef, useEffect } from "react";
import { GridstackContainer, GridstackItem } from "../../gridstack";
import {
GridstackContainer,
GridstackItem,
} from "@declarative-gridstack/react";
import { JsonView, darkStyles } from "react-json-view-lite";
import "react-json-view-lite/dist/index.css";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import React, { useState, useRef } from "react";
import { GridstackContainer, GridstackItem } from "../../gridstack";
import {
GridstackContainer,
GridstackItem,
} from "@declarative-gridstack/react";
import { JsonView, darkStyles } from "react-json-view-lite";
import "react-json-view-lite/dist/index.css";
import { Widget } from "../components/Widget";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
GridstackContainer,
GridstackItem,
GridstackSubgrid,
} from "../../gridstack";
} from "@declarative-gridstack/react";
import HtmlInput from "../components/HtmlInput";
import { Widget } from "../components/Widget";

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
GridstackContainer,
GridstackItem,
GridstackSubgrid,
} from "../../gridstack";
} from "@declarative-gridstack/react";

import "./styles.css";

Expand Down Expand Up @@ -153,8 +153,6 @@ function Nested() {

const [pushTo, setPushTo] = useState("master");



return (
<Fragment>
<button onClick={toggleGridVisibility}>Toggle grid visibility</button>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import React, { useState, useRef } from "react";
import { GridstackContainer, GridstackItem } from "../../gridstack";
import {
GridstackContainer,
GridstackItem,
} from "@declarative-gridstack/react";
import { JsonView, darkStyles } from "react-json-view-lite";
import "react-json-view-lite/dist/index.css";
import { Widget } from "../components/Widget";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import React, { useState } from "react";
import { GridstackContainer, GridstackItem } from "../../gridstack";
import {
GridstackContainer,
GridstackItem,
} from "@declarative-gridstack/react";
import { JsonView, darkStyles } from "react-json-view-lite";
import "react-json-view-lite/dist/index.css";
import { Widget } from "../components/Widget";
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/frameworks/react/how-to/adding-items.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Click the `Add item` button to add a new item to the layout.
import { createElement } from 'react'
import { createRoot } from 'react-dom/client'
import { ref, onMounted } from 'vue'
import {AddingItem} from '@declarative-gridstack/react/examples'
import {AddingItem} from '../examples/adding-item/AddingItem.jsx'

const el = ref()
onMounted(() => {
Expand Down
3 changes: 2 additions & 1 deletion packages/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"dependencies": {
"@declarative-gridstack/react": "workspace:^",
"react": "^18.2.0",
"react-dom": "^18.2.0"
"react-dom": "^18.2.0",
"react-json-view-lite": "^0.9.7"
},
"devDependencies": {
"vitepress": "^1.0.0-beta.7"
Expand Down
Loading

0 comments on commit be53404

Please sign in to comment.