-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added platform-bible-react preview page, revised readmes (#870)
- Loading branch information
Showing
8 changed files
with
89 additions
and
18 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,16 @@ | ||
{ | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Preview platform-bible-react", | ||
"type": "node", | ||
"request": "launch", | ||
"runtimeExecutable": "npm", | ||
"runtimeArgs": ["run", "start"], | ||
"skipFiles": ["<node_internals>/**"] | ||
} | ||
] | ||
} |
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
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,12 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>platform-bible-react Preview</title> | ||
</head> | ||
<body> | ||
<div id="root"></div> | ||
<script type="module" src="/src/preview/index.tsx"></script> | ||
</body> | ||
</html> |
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 @@ | ||
This folder contains a preview site to play with `platform-bible-react` components in a live, | ||
hot-reloading environment without having to rebuild and run Platform.Bible every time. | ||
|
||
Run the preview with `npm start`. |
Empty file.
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,29 @@ | ||
import { useState } from 'react'; | ||
import './app.component.css'; | ||
import { ScriptureReference } from 'platform-bible-utils'; | ||
import { RefSelector } from '..'; | ||
|
||
const defaultScrRef: ScriptureReference = { | ||
bookNum: 1, | ||
chapterNum: 1, | ||
verseNum: 1, | ||
}; | ||
|
||
function App() { | ||
const [scrRef, setScrRef] = useState(defaultScrRef); | ||
|
||
return ( | ||
<> | ||
<h1>platform-bible-react Preview</h1> | ||
<p> | ||
Edit <code>lib\platform-bible-react\src\preview\app.component.tsx</code> and save to see | ||
updates | ||
</p> | ||
<p> | ||
<RefSelector scrRef={scrRef} handleSubmit={setScrRef} /> | ||
</p> | ||
</> | ||
); | ||
} | ||
|
||
export default App; |
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,14 @@ | ||
import { StrictMode } from 'react'; | ||
import { createRoot } from 'react-dom/client'; | ||
import App from './app.component'; | ||
|
||
const container = document.getElementById('root'); | ||
if (!container) { | ||
throw new Error('Document root element not found!'); | ||
} | ||
|
||
createRoot(container).render( | ||
<StrictMode> | ||
<App /> | ||
</StrictMode>, | ||
); |
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