Skip to content

Instantly share code, notes, and snippets.

@hawkrives
Last active February 28, 2024 16:51
Show Gist options
  • Save hawkrives/26196cec12a0076ae9d31f456bc8b4d9 to your computer and use it in GitHub Desktop.
Save hawkrives/26196cec12a0076ae9d31f456bc8b4d9 to your computer and use it in GitHub Desktop.
File structure:
app.js
/modules/
/menus/
/streaming-media/
/sis/
index.js
state.js
/courses-list/
/course-search/
/time-entry/
/student-work/
/balances/
index.js
state.js
import React from 'react'
import {App} from '@frogpond/app' // 🔮
import * as Menus from './modules/menus'
import * as SIS from './modules/sis'
// I'm envisioning that instead of a big `switch`, we'd <somehow>
// come up with a list of all loaded modules + screens and iterate
// through them?
// Or maybe this is when we switch to just adding the callback to
// the descriptor that we push into the navigator.
export default <App
iconSet={Ionicons} // 🔮 not quite sure how this would work yet
modules={[ // list of all modules
Menus,
SIS,
StreamingMedia,
]}
/>
// This "module" essentially replaces the list of views in source/views/views.js
import React from 'react'
import TabbedView from '@frogpond/tabbed-view'
import * as BalancesTab from './balances'
import * as CoursesListTab from './courses-list'
import * as CourseSearchTab from './course-search'
import * as TimeEntryTab from './time-entry'
import * as StudentWorkTab from './student-work'
import {reducer, selector} from './state' // 🔮
const tabs = [
BalancesTab,
CoursesListTab,
CourseSearchTab,
TimeEntryTab,
StudentWorkTab,
]
export const view = () => <TabbedView tabs={tabs} />
export {reducer, selector} // 🔮 might not need to export selector from here?
// remaining questions include "what is a selector" and "how can
// we automatically scope the visible state for a module" and
// "is that what a selector is for"
export const screenTitle = 'SIS'
export const icon = 'flower'
export const tintColor = '#fafafa'
export const gradientColor = ['#fafafa', '#afafaf']
// This "module" replaces the tab config.
import React from 'react'
import {connect} from 'react-redux'
import {TableView, Section, Cell} from '@frogpond/x-tableviews'
import {Row} from '@frogpond/x-layout'
import {reducer, selector} from './state' // 🔮
const BalancesCell = ({title, detail}) => (/*do something*/)
const PlainBalances = ({flex, ole, print}) =>
<Section title="Balances">
<Row>
<BalancesCell title="Flex Dollars" detail={flex} />
<BalancesCell title="Ole Dollars" detail={ole} />
<BalancesCell title="StoPrint" detail={print} />
</Row>
</Section>
const balancesConnector = connect(state => ({ // 🔮
flex: state.flex,
ole: state.ole,
print: state.print,
})
const Balances = balancesConnector(PlainBalances)
const PlainMealPlan = ({daily, weekly, description}) =>
<Section title="Meals">
<Row>
<BalancesCell title="Remaining Today" detail={daily} />
<BalancesCell title="This Week" detail={weekly} />
</Row>
</Section>
const mealsConnector = connect(state => ({ // 🔮
daily: state.daily,
weekly: state.weekly,
})
const MealPlan = mealsConnector(PlainMealPlan)
const WrapperView = ({loggedIn}) =>
<TableView>
<Balances />
<MealPlan />
{!loggedIn ? <LoginWarning /> : null}
</TableView>
const wrapperConnector = connect(state => ({ // 🔮
loggedIn: state.stolaf.loggedIn,
})
export const View = wrapperConnector(WrapperView)
@nemoj463
Copy link

nemoj463 commented Jan 3, 2024

Hello. When running your own business, you need to take into account various criteria to ensure that your business is successful and constantly growing. The best way to make this a reality is to seek help from https://globaledgemarkets.com/. The specialists of this service will develop customised and effective marketing solutions for your business that will help you improve your business.

@Cloudsicker
Copy link

In today's world, there's an abundance of services and websites offering opportunities to earn money. If you're looking to turn your hobbies into a source of income, consider using a platform [like https://www.newukcasino.uk/bonuses-casino/](like https://www.newukcasino.uk/bonuses-casino/) . Personally, I've been using it for just 2 months, and I've already discovered how lucrative it can be with its bonuses and guidance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment