Skip to content

Commit

Permalink
updates for 2022 season
Browse files Browse the repository at this point in the history
  • Loading branch information
connerbush committed Dec 8, 2022
1 parent e3cefc3 commit 166b4f0
Show file tree
Hide file tree
Showing 18 changed files with 268 additions and 182 deletions.
8 changes: 3 additions & 5 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
{
"typescript.format.semicolons": "remove",
"prettier.semi": false,
"prettier.semi": true,
"editor.wordWrap": "wordWrapColumn",
"prettier.singleQuote": false,
"typescript.preferences.quoteStyle": "auto",
"prettier.jsxSingleQuote": false,
"editor.wordWrapColumn": 80,
"typescript.format.insertSpaceAfterCommaDelimiter": true,
"prettier.trailingComma": "es5",
"cSpell.words": [
"Ionicons",
"mailchimp"
]
"cSpell.words": ["Ionicons", "mailchimp"],
"javascript.format.semicolons": "insert"
}
27 changes: 15 additions & 12 deletions App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { useFonts } from "expo-font"
import StylesProvider from "./context/styles.context"
import VolunteerProvider from "./context/volunteer.context"
import { GestureHandlerRootView } from "react-native-gesture-handler"
import AssetsProvider from "./context/assets.context"

export default function App() {
const isLoadingComplete = useCachedResources()
Expand All @@ -22,18 +23,20 @@ export default function App() {

if (isLoadingComplete && fontsLoaded) {
return (
<GestureHandlerRootView style={{ flex: 1 }}>
<SafeAreaProvider>
<UserProvider>
<VolunteerProvider>
<StylesProvider>
<Navigation />
<StatusBar />
</StylesProvider>
</VolunteerProvider>
</UserProvider>
</SafeAreaProvider>
</GestureHandlerRootView>
<GestureHandlerRootView style={{ flex: 1 }}>
<SafeAreaProvider>
<UserProvider>
<VolunteerProvider>
<StylesProvider>
<AssetsProvider>
<Navigation />
<StatusBar />
</AssetsProvider>
</StylesProvider>
</VolunteerProvider>
</UserProvider>
</SafeAreaProvider>
</GestureHandlerRootView>
)
} else {
return null
Expand Down
40 changes: 25 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
![c4k-horizontal](https://user-images.githubusercontent.com/68450309/155401405-cd59fd70-dc84-4438-96ed-1264ac21f321.png)

For over 35 years, Christmas 4 Kids has given the joy of Christmas to thousands of Middle Tennessee children that might not otherwise experience it. Each December, local businesses, volunteers, celebrities, recording artists, and their bus drivers set aside two days from their busy schedules for these special children.
For over 35 years, Christmas 4 Kids has given the joy of Christmas to thousands of Middle Tennessee children that might not otherwise experience it. Each December, local businesses, volunteers, celebrities, recording artists, and their bus drivers set aside two days from their busy schedules for these special children.

## The Biggest Christmas Party In Town

The entire year’s efforts come together when the buses pick up over 400 children and bring them to a Christmas Party held in their honor. Santa and Mrs. Claus host the party, which provides lunch (donated by Garth Brooks), live music, dancing and a lot of fun!! After the party, the children get back on the buses for a parade, led by the Nashville Trolley carrying Santa and Mrs. Claus, that stretches nearly five miles and features more than 70 Tour Buses, ending at Super Walmart in Hendersonville. Each child is met by his or her own chaperone, and they’re given $150.00 to buy anything they want. Plus, Christmas 4 Kids gives every child a brand new winter coat.
The entire year’s efforts come together when the buses pick up over 400 children and bring them to a Christmas Party held in their honor. Santa and Mrs. Claus host the party, which provides lunch (donated by Garth Brooks), live music, dancing and a lot of fun!! After the party, the children get back on the buses for a parade, led by the Nashville Trolley carrying Santa and Mrs. Claus, that stretches nearly five miles and features more than 70 Tour Buses, ending at Super Walmart in Hendersonville. Each child is met by his or her own chaperone, and they’re given $150.00 to buy anything they want. Plus, Christmas 4 Kids gives every child a brand new winter coat.

## Volunteer!

Expand All @@ -20,36 +20,46 @@ C4K is made possible by generous donors just like you! Your donations put smiles

This app was built to aid volunteers on the day of the C4K event. The app checks volunteers in by scanning their driver's license, saving organizers' time by not manually checking in each volunteer. The app also has use information such as event rules, event schedule, organizers' contact information, and a store map.

[Play Store Link](https://play.google.com/store/apps/details?id=com.c4k.shoppingeventmanager&hl=en_US&gl=US) --- [App Store Link](https://apps.apple.com/ng/app/christmas-4-kids/id1491062275)
[Play Store Link](https://play.google.com/store/apps/details?id=com.c4k.shoppingeventmanager&hl=en_US&gl=US) --- [App Store Link](https://apps.apple.com/ng/app/christmas-4-kids/id1491062275)

<img height="700px" src="https://user-images.githubusercontent.com/68450309/155424804-a562c1dd-c244-4a06-bbd8-ffdac290ac7f.gif" />


### Tech Stack

```
• React Native
• Expo
• TypeScript
• FireBase
• Twilio
```

## How to install and run the app locally

### 1. Clone the repo

`git clone https://github.com/Christmas-4-Kids/c4k.git`

### 2. Change directory to C4K

`cd C4K`

### 3. Install dependencies

`yarn`

### 4. Start app

`yarn start`

Expo Developer Tools opens on `localhost:19002`

---

### [Download](https://developer.android.com/studio/?gclid=Cj0KCQiA09eQBhCxARIsAAYRiykJEPi1qfKv5Xmd1nPFXcQKFUy7_-LOP91bMxP7p8-ykpcuf6UPIG8aAlJoEALw_wcB&gclsrc=aw.ds) and [Install](https://developer.android.com/studio/install) Android Studio to run and [emulate and Android device](https://developer.android.com/studio/run/emulator)
or

or

### [Download](https://apps.apple.com/us/app/xcode/id497799835?mt=12) and install Xcode to emulate an IOS device

---
Expand Down Expand Up @@ -79,12 +89,12 @@ Below are the important steps. For full documentation please see the [official F
// Uncomment to run firebase functions locally
// firebase.functions().useEmulator("localhost", 5001);
```
---
## Roadmap
- [ ] Convert map to be url based

---

## Roadmap

- [x] Convert map to be url based
- [ ] Allow the app to work without being logged in (Countdown, socials, Store, events)
- [ ] Add registration to app
- [ ] Collect data on user activity
Expand All @@ -99,10 +109,10 @@ Below are the important steps. For full documentation please see the [official F
- [ ] Feature to share your experience the day after
- [ ] Tooltips on how to use the app
- [ ] Storage DL data and image tied to Volunteer
## Contributing
Feel free to open an issue or contact a [contributer](https://github.com/orgs/Christmas-4-Kids/people) to get involved with development

## Contributing

Feel free to open an issue or contact a [contributer](https://github.com/orgs/Christmas-4-Kids/people) to get involved with development

## Building & Publishing to the app stores

Expand Down
23 changes: 21 additions & 2 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"expo": {
"name": "c4k",
"slug": "c4k",
"version": "2.4.3",
"version": "2.5.0",
"sdkVersion": "45.0.0",
"orientation": "portrait",
"icon": "./assets/images/icon.png",
"scheme": "myapp",
Expand All @@ -26,7 +27,25 @@
"backgroundColor": "#112430"
},
"package": "com.c4k.shoppingeventmanager",
"versionCode": 10
"versionCode": 13,
"permissions": [
"CAMERA",
"VIBRATE",
"READ_PHONE_STATE",
"FOREGROUND_SERVICE",
"WAKE_LOCK",
"com.anddoes.launcher.permission.UPDATE_COUNT",
"com.android.launcher.permission.INSTALL_SHORTCUT",
"com.google.android.c2dm.permission.RECEIVE",
"com.google.android.gms.permission.ACTIVITY_RECOGNITION",
"com.google.android.providers.gsf.permission.READ_GSERVICES",
"com.htc.launcher.permission.READ_SETTINGS",
"com.htc.launcher.permission.UPDATE_SHORTCUT",
"com.majeur.launcher.permission.UPDATE_BADGE",
"com.sec.android.provider.badge.permission.READ",
"com.sec.android.provider.badge.permission.WRITE",
"com.sonyericsson.home.permission.BROADCAST_BADGE"
]
},
"web": {
"favicon": "./assets/images/favicon.png"
Expand Down
12 changes: 6 additions & 6 deletions components/ChaperoneGroupCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,14 @@ export const ChaperoneGroupCard = () => {
const ChaperoneListItem = ({ name, phone, chaperoneList, setChaperoneList }) => {
const { styles } = useStyles()

const pressCall = () => {
const pressCall = async () => {
const url = `tel://${phone}`
Linking.openURL(url)
await Linking.openURL(url)
}

const removeContact = phone => {
setChaperoneList(chaperoneList.filter(chaperone => chaperone.phone !== phone))
AsyncStorage.setItem("chaperoneList", JSON.stringify(chaperoneList.filter(chaperone => chaperone.phone !== phone)))
const removeContact = (phone) => {
setChaperoneList(chaperoneList.filter((chaperone) => chaperone.phone !== phone))
AsyncStorage.setItem("chaperoneList", JSON.stringify(chaperoneList.filter((chaperone) => chaperone.phone !== phone)))
}

return (
Expand All @@ -96,7 +96,7 @@ const ChaperoneListItem = ({ name, phone, chaperoneList, setChaperoneList }) =>

<C4kText style={styles.chaperoneGroupCardBodyText}>{name}</C4kText>

<FontAwesome5 name="phone-alt" size={8} color="#FFF" style={{ backgroundColor: "#23A57F", borderRadius: 3, padding: 5 }} onPress={() => pressCall()} />
<FontAwesome5 name="phone-alt" size={8} color="#FFF" style={{ backgroundColor: "#23A57F", borderRadius: 3, padding: 5 }} onPress={async () => await pressCall()} />
</View>
)
}
Expand Down
10 changes: 5 additions & 5 deletions components/ChaperoneListCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ import { C4kText } from "./C4kText"

const getVolunteerType = (volunteerType: string) => {
switch (volunteerType) {
case "2021_ADMIN":
case "2022_ADMIN":
return "Organizer"
case "2021_ALL_DAY_CHAPERONE":
case "2022_ALL_DAY_CHAPERONE":
return "All Day Chaperone"
case "2021_EVENING_CHAPERONE":
case "2022_EVENING_CHAPERONE":
return "Evening Chaperone"
case "2021_LEBANON_CHAPERONE":
case "2022_LEBANON_CHAPERONE":
return "Lebanon Chaperone"
case "2021_DRIVER":
case "2022_DRIVER":
return "Driver"
default:
return "Unknown"
Expand Down
47 changes: 47 additions & 0 deletions context/assets.context.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import React, { useEffect, useState } from "react"
import { collection, onSnapshot, orderBy, query } from "firebase/firestore"
import { db } from "../services/firestore.service"

type AssetsContext = {
assets: Map<string, string>
}

const AssetsContext = React.createContext<AssetsContext>({
assets: new Map(),
})

export default function AssetProvider({ children }: { children: any }) {
const [assets, setAssets] = useState(new Map())

useEffect(() => {
const unsub = onSnapshot(query(collection(db, "assetUrls"), orderBy("name")), (querySnapshot) => {
const tempAssets = new Map()
querySnapshot.forEach((doc) => {
const asset = doc.data()
tempAssets.set(asset.name, asset.url)
})
setAssets(tempAssets)
})
return () => {
unsub()
}
}, [])

return (
<AssetsContext.Provider
value={{
assets,
}}
>
{children}
</AssetsContext.Provider>
)
}

export const useAssets = () => {
const context = React.useContext(AssetsContext)
if (context === undefined) {
throw new Error("useAssets must be used inside a AssetProvider")
}
return context
}
6 changes: 3 additions & 3 deletions context/volunteer.context.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useEffect, useState } from "react"
import { collection, onSnapshot, orderBy, query } from "firebase/firestore"
import { collection, onSnapshot, orderBy, query, where } from "firebase/firestore"
import { db } from "../services/firestore.service"

export interface Address {
Expand Down Expand Up @@ -75,9 +75,9 @@ export default function VolunteerProvider({ children }: { children: any }) {
const [volunteers, setVolunteers] = useState<Volunteer[]>([])

useEffect(() => {
const unsub = onSnapshot(query(collection(db, "volunteers"), orderBy("lastNameLower")), querySnapshot => {
const unsub = onSnapshot(query(collection(db, "volunteers"), where("volunteerYear", "==", "2022"), orderBy("lastNameLower")), (querySnapshot) => {
const tempVolunteers = []
querySnapshot.forEach(doc => {
querySnapshot.forEach((doc) => {
tempVolunteers.push(createVolunteer(doc.data()))
})
setVolunteers(tempVolunteers)
Expand Down
Loading

0 comments on commit 166b4f0

Please sign in to comment.