Skip to content

Commit

Permalink
cleanup structure
Browse files Browse the repository at this point in the history
  • Loading branch information
PhotoNomad0 committed Dec 13, 2023
1 parent ec6e06d commit e512338
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 34 deletions.
52 changes: 30 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,69 +73,77 @@ yarn test:headless

- Structure of the React components in this app

Application (in pages/\App.jsx) contains:
**Startup** is main.jsx which renders the Application (App)

**Application** (App.jsx) contains:

- AuthContext context
- StoreContext context:

Home (in pages/index.js) contains:
<Layout>
<WorkspaceContainer />
</Layout>

WorkspaceContainer component manages the Resource workspace

- Contains Workspace component (resource workspace rcl) that contains several:
- ScriptureCard components
- ResourceCard components
<AuthContextProvider>
<StoreContextProvider>
<Layout>
<WorkspaceContainer />
</Layout>
</StoreContextProvider>
</AuthContextProvider>

Layout component:
**Layout** component:

- accesses authentication context and store context
- Manages server selection through url variables
- Displays Onboarding component if login is required
- displayes settings page if selected
- displays error page if selected
- displays feedback page if selected
- Contains the header and footer

BibleReference component:
**WorkspaceContainer** component manages the workspace containing the resource cards

- Contains Workspace component (resource workspace rcl) that contains several cards of type:
- ScriptureCard components
- ResourceCard components

**BibleReference** component:

- Uses bible Reference RCL
- Updates reference store context

Onboarding component
**Onboarding** component

- Displays the AccountSetup component when login is required

Header component:
**Header** component:

- Contains BibleReference component

Footer component:
**Footer** component:

- Shows app version/build

Drawer component (hamburger menu):
**Drawer** component (hamburger menu):

- Shows

TranslationSettings component:
**TranslationSettings** component:

- Prompts for organization and language

ResourceCard component:
**ResourceCard** component:

- Card that displays translationHelps content

ScriptureCard component:
**ScriptureCard** component:

- Card that displays scripture content

AuthContext context:
**AuthContext** context:

- Initializes the authentication context (defined in gitea-react-toolkit)

StoreContext context:

- Manages and persists application state data into local storage
- Manages and persists the rest of the application state data into local storage

useLocalStorage - custom hook that persists generic application data into local storage

Expand Down
13 changes: 2 additions & 11 deletions src/components/App.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// import { useEffect } from 'react'
import PropTypes from 'prop-types'
import { ThemeProvider } from '@material-ui/core/styles'
import CssBaseline from '@material-ui/core/CssBaseline'
import StoreContextProvider from '@context/StoreContext'
Expand All @@ -10,16 +8,9 @@ import WorkspaceContainer from '@components/WorkspaceContainer'
import Layout from '@components/Layout'
import theme from '../theme'

export default function Application() {
// useEffect(() => {
// // Remove the server-side injected CSS.
// const jssStyles = document.querySelector('#jss-server-side')
//
// if (jssStyles) {
// jssStyles.parentElement.removeChild(jssStyles)
// }
// }, [])
// TODO: set page title again

export default function Application() {
return (
<ThemeProvider theme={theme}>
{/* CssBaseline kickstart an elegant, consistent, and simple baseline to build upon. */}
Expand Down
2 changes: 1 addition & 1 deletion src/components/TranslationSettings.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ const useStyles = makeStyles(theme => ({

export default function TranslationSettings({
authentication,
setPage,
}) {
const { actions: { logout } } = useContext(AuthContext)
const classes = useStyles()
Expand All @@ -55,6 +54,7 @@ export default function TranslationSettings({
setOwner: setOrganization,
setLanguageId,
setLastError,
setPage,
},
} = useContext(StoreContext)

Expand Down

0 comments on commit e512338

Please sign in to comment.