Skip to content

Commit

Permalink
Merge Release PR #53
Browse files Browse the repository at this point in the history
Release 1.0.4
  • Loading branch information
awalshy authored Aug 14, 2020
2 parents dbd00ce + 0cd5dba commit 3424368
Show file tree
Hide file tree
Showing 55 changed files with 2,536 additions and 480 deletions.
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
.github
.expo
.expo-shared
22 changes: 22 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint",
"prettier",
"react"
],
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"prettier"
],
"rules": {
"no-console": 1,
"prettier/prettier": 2,
"@typescript-eslint/no-explicit-any": 0,
"react/display-name": 0
}
}
15 changes: 15 additions & 0 deletions .github/ISSUE_TEMPLATE/new-prayer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
name: New Prayer
about: Request a new prayer
title: ''
labels: prayer
assignees: ''

---

# Name of the prayer you want to add
Ex: Notre Père

## The prayer text
Ex: Notre Père, qui êtes aux cieux,
Que votre nom soit sanctifié, etc...
18 changes: 18 additions & 0 deletions .github/ISSUE_TEMPLATE/test.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
name: Test
about: New testing related issue
title: 'Tests - '
labels: tests
assignees: ''

---

# What is the feature to tests
Brief description

> Test category: *unit* | *mocking* | *integration* | *component - render* | *component - interaction* | *e2e*
### Scenario
*Given* I am ...
*When* I click...
*Then* I should see ...
13 changes: 13 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# A Brief descriptions of yout work
blabla...

## Details
- this
- and that

## Testing
- Click on
- Then on
- This should appear/happen

> Do not forget to link your Issue and delete this message
3 changes: 1 addition & 2 deletions .github/workflows/greetings.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Greetings

on: [pull_request, issues]
on: [pull_request]

jobs:
greeting:
Expand All @@ -9,5 +9,4 @@ jobs:
- uses: actions/first-interaction@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
issue-message: 'Yeah ! Thank you @${{ github.actor }} for letting us know your ideas or problems'
pr-message: 'Great @${{ github.actor }} ! Thanks for contributing to our project !'
30 changes: 30 additions & 0 deletions .github/workflows/unit_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Unit testing

on:
push:
branches: [ develop, master ]
pull_request:
branches: [ develop, master ]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [12.x, 13.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install Dependencies
run: yarn install
- name: Run Linter
run: yarn run lint
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.expo
.expo-shared
.github
assets
node_modules
6 changes: 6 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"semi": false,
"trailingComma": "none",
"singleQuote": true,
"printWidth": 80
}
29 changes: 13 additions & 16 deletions App.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import React, { useEffect } from 'react';
import React, { useEffect } from 'react'
import * as Notifications from 'expo-notifications'
import { ThemeProvider } from 'styled-components'

import * as NativeNotifs from './utils/notification/NotificationManager'
import Stack from './components/layout/Routes'
import theme from './config/theme'

Notifications.setNotificationHandler({
handleNotification: async () => ({
Expand All @@ -14,20 +12,19 @@ Notifications.setNotificationHandler({
})
})

export default function App() {
const App = (): JSX.Element => {
useEffect(() => {
const subcription = Notifications.addPushTokenListener(NativeNotifs.registerForNotificationsAsync)
Notifications.addNotificationReceivedListener(notification => {
console.log('Notification', notification)
NativeNotifs.registerForNotificationsAsync()
// const subscription = Notifications.addPushTokenListener()
Notifications.addNotificationReceivedListener((notification) => {
if (!notification.request.content.title) return
})
return () => {
Notifications.removeAllNotificationListeners()
}
// return () => {
// subscription.remove()
// }
}, [])

return (
<ThemeProvider theme={theme} >
<Stack />
</ThemeProvider>
);
}
return <Stack />
}

export default App
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Prayer Notifications App

![Unit testing](https://github.com/awalshy/PrayerNotificationsApp/workflows/Unit%20testing/badge.svg?branch=develop)

## The project

This project is a React Native App that create daily notifications.

## Contributing

Thank you for contributing to the project !
If you are not a developper and you want to tell us about a bug or if you want to request a new feature, please feel free to create a new issue !

If you are a developper, please see the [contributions section](./docs/contributing.md). Please also see the [local development](./docs/local-development.md) to install and dev in your local environment.

## Launch the project

Run `yarn install` to get dependencies, then `expo-cli start`. Requires the `expo-cli` installation.

## Tests and deployment

#### Tests

See the [testing](./docs/testing.md) guidelines. CI is launched on PRs.

#### Deployment
> Deployments are done by hand for the moment.
17 changes: 12 additions & 5 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
"name": "Prayer Notification App",
"description": "Get notifications for prayer",
"slug": "prayer-notification-app",
"version": "0.0.1",
"version": "1.0.4",
"orientation": "portrait",
"icon": "./assets/icon-large.png",
"icon": "./assets/icon.png",
"privacy": "unlisted",
"backgroundColor": "#EBEBEB",
"primaryColor": "#35415A",
Expand All @@ -26,11 +26,18 @@
"supportsTablet": true
},
"android": {
"package": "com.prayernotifs.app"
"package": "com.prayernotifs.app",
"icon": "./assets/icon-medium.png",
"useNextNotificationsApi": true,
"versionCode": 4,
"adaptiveIcon": {
"foregroundImage": "./assets/icon-adaptive.png",
"backgroundImage": "./assets/icon.png",
"backgroundColor": "#35415A"
}
},
"notification": {
"icon": "./assets/icon-tiny.png",
"color": "#35415A"
"icon": "./assets/icon-notif.png"
}
}
}
Binary file added assets/icon-adaptive.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icon-notif.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/icon-small.png
Binary file not shown.
File renamed without changes
Binary file added assets/notif.ogg
Binary file not shown.
Binary file modified assets/splash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 18 additions & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
module.exports = function(api) {
api.cache(true);
const presets = ['babel-preset-expo'];
const plugins = [[
require.resolve('babel-plugin-module-resolver'),
{
root: ['.'],
alias: {
'config': './config',
'elements': './elements',
'screens': './screens',
'utils': './utils',
'components': './components',
'data': './data'
}
}
]];

return {
presets: ['babel-preset-expo'],
presets,
plugins
};
};
16 changes: 12 additions & 4 deletions colors.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
{
"primary": "#35415A",
"secondary": "#CA2D02",
"tertiary": "#9197AE",
"forth": "#EBEBEB"
"colors": {
"primary": "#35415A",
"secondary": "#CA2D02",
"tertiary": "#9197AE",
"forth": "#EBEBEB"
},
"notifications": {
"title": "Angelus",
"description": "descciption",
"subscription": "apicaosica",
"active": true
}
}
68 changes: 46 additions & 22 deletions components/layout/Routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,32 @@ enableScreens()
import { Image } from 'react-native'

// Screens
import Home from '../../screens/Home'
import ManageNotificationsSubs from '../../screens/ManageNotificationsSubs'
import Home from 'screens/HomeScreen'
import ManageNotificationsSubs from 'screens/ManageNotificationsSubs'
import GospelScreen from 'screens/GospelScreen'
import PrayerScreen from 'screens/PrayerScreen'
import MyPrayerScreen from 'screens/MyPrayerScreen'

// Parameters Type
type MainStack = {
Home: {}
Home: unknown
}

function Logo() {
return (
<Image
style={{ width: 40, height: 40, marginRight: 5 }}
source={require('../../assets/icon-tiny.png')} />
)
type LogoProps = {
width: number
height: number
}

const Logo = ({ width, height }: LogoProps): JSX.Element => (
<Image
style={{ width, height, marginRight: 5 }}
source={require('../../assets/icon-tiny.png')}
/>
)

const MainStack = createNativeStackNavigator()

const Stack = () => (
const Stack = (): JSX.Element => (
<NavigationContainer>
<MainStack.Navigator
initialRouteName="Home"
Expand All @@ -33,19 +40,36 @@ const Stack = () => (
backgroundColor: '#35415A'
},
headerTintColor: '#EBEBEB',
headerRight: (props: any) => <Logo {...props} />
}}>
<MainStack.Screen
name="Home"
component={Home}
/>
<MainStack.Screen
name="ManageNotifs"
component={ManageNotificationsSubs}
options={{ title: "Manage Notifications"}}
/>
headerRight: () => <Logo width={40} height={40} />
}}
>
<MainStack.Screen
name="Home"
component={Home}
options={{ title: 'Acceuil' }}
/>
<MainStack.Screen
name="ManageNotifs"
component={ManageNotificationsSubs}
options={{ title: 'Gérer les Notifications' }}
/>
<MainStack.Screen
name="Evangile"
component={GospelScreen}
options={{ title: 'Evangile' }}
/>
<MainStack.Screen
name="Prayer"
component={PrayerScreen}
options={{ title: 'Prière' }}
/>
<MainStack.Screen
name="MyPrayer"
component={MyPrayerScreen}
options={{ title: 'Ma Prière' }}
/>
</MainStack.Navigator>
</NavigationContainer>
)

export default Stack
export default Stack
Loading

0 comments on commit 3424368

Please sign in to comment.