Skip to content

Commit

Permalink
add forum example
Browse files Browse the repository at this point in the history
  • Loading branch information
c12i committed May 29, 2024
1 parent 3d55842 commit e67789e
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 59 deletions.
57 changes: 0 additions & 57 deletions templates/react/example/ui/src/App.svelte.hbs

This file was deleted.

26 changes: 26 additions & 0 deletions templates/react/example/ui/src/App.tsx.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import holochainLogo from './assets/holochainLogo.svg'
import { useContext } from 'react'
import { HolochainContext } from './contexts/HolochainContext'
import AllPosts from './forum/posts/AllPosts';
import CreatePost from './forum/posts/CreatePost';

import './App.css'

const App = () => {
const { error, loading } = useContext(HolochainContext)
if (loading) {
return <div>loading...</div>
}
if (error) {
return <div>Error starting app: {error.message}</div>
}
return (
<div>
<h2>Welcome to the Forum hApp</h2>
<AllPosts />
<CreatePost />
</div>
)
}

export default App
4 changes: 2 additions & 2 deletions templates/react/web-app/ui/src/App.tsx.hbs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import holochainLogo from './assets/holochainLogo.svg'
import './App.css'
import { useContext } from 'react'
import { HolochainContext } from './contexts/HolochainContext'
import './App.css'

function App() {
const App = () => {
const { error, loading } = useContext(HolochainContext)
return (
<>
Expand Down

0 comments on commit e67789e

Please sign in to comment.