Skip to content

Instantly share code, notes, and snippets.

@hawkrives
Last active September 27, 2024 20:20
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)
@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.

@juliaroberts981
Copy link

Immersing myself in the online gaming scene in Nigeria has been an extraordinary journey, especially thanks to this fantastic platform. I was completely blown away by how intuitive and user-friendly everything is. Trust me, this is one of those experiences that you have to try firsthand to fully grasp. It's like entering a whole new universe, one that takes your gaming experience to an entirely different level. Right in the middle of it all is 1win Nigeria, a platform that's been a game-changer in every sense of the word. It has revolutionized my gaming world, and I can vouch for the tremendous impact it's had on my overall experience.

@barek1337436
Copy link

The graphics and sound effects on this site are really something. I’ve played on other platforms where the games feel outdated, but here everything looks modern and polished. It really enhances the experience, making each game feel more immersive and fun. If you’re someone who appreciates good visuals and audio in your games, I’d suggest taking a look at https://www.777-online.com/. It’s the kind of attention to detail that makes the difference between just playing and really enjoying the experience, and for me, that’s what makes this site stand out compared to others I’ve tried.

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