Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F7188002
index.jsx
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
index.jsx
View Options
import
'babel-polyfill'
;
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
ReactDOM
from
'react-dom'
;
import
{
BrowserRouter
as
HashRouter
,
Route
,
Link
}
from
'react-router-dom'
;
import
useCollections
from
'./collections/use-collections.js'
;
import
Collections
from
'./collections/collections.jsx'
;
import
BodyPageEditor
from
'./body-page-editor/body-page-editor'
;
function
AppRouter
()
{
const
collections
=
useCollections
();
return
(
<
HashRouter
basename
=
"/#"
>
<
div
>
<
Link
to
=
"/"
>
<
h1
>
Sealpage
<
/h1>
<
/Link>
<
nav
>
<
ul
>
{
collections
.
map
(
collection
=>
(
<
li
key
=
{
collection
.
name
}
>
<
Link
to
=
{
`/collections/
${
collection
.
name
}
`
}
>
{
collection
.
name
}
<
/Link>
<
/li>
))}
<
/ul>
<
Link
to
=
{
'/body-page-editor'
}
>
BodyPageEditor
<
/Link>
<
/nav>
<
hr
/>
<
Route
path
=
"/"
exact
component
=
{()
=>
<
h2
>
Admin
panel
<
/h2>} /
>
<
Route
path
=
"/collections"
component
=
{
Collections
}
/>
{
/* it's only for mockup testing */
}
<
Route
path
=
"/body-page-editor"
component
=
{
BodyPageEditor
}
/>
<
/div>
<
/HashRouter>
);
}
ReactDOM
.
render
(
React
.
createElement
(
AppRouter
),
document
.
getElementById
(
'app'
));
File Metadata
Details
Attached
Mime Type
text/x-java
Expires
Tue, Jul 8, 07:49 (23 h, 4 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
810418
Default Alt Text
index.jsx (1 KB)
Attached To
Mode
rSEALPAGE Sealpage
Attached
Detach File
Event Timeline
Log In to Comment