This repository has been archived by the owner on May 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c44af18
commit 15a018a
Showing
191 changed files
with
5,436 additions
and
1,489 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
### Code Quality | ||
|
||
This code-base is available open-source to the general public, it is important that all developers working on this project do their best to write high-quality code that is testable, scalable, and follows software development best practices. | ||
|
||
#### Code style | ||
- We will be using TypeScript for all our React components | ||
- Install prettier on your code editor | ||
- Run yarn lint often to check for linting rules | ||
|
||
#### Structure | ||
- Write tests for all code relating to reducers/state manipulation | ||
- Unless absolutely necessary do not use any (TypeScript) | ||
- Follow the project folder structure, place files where they belong | ||
- We will be using functional components | ||
- For consistency, use hooks whenever possible. for e.g. Use useDispatch instead of redux HOC | ||
|
||
#### Styles | ||
- No inline styles. Use styled-components whenever possible | ||
- Limit custom styles (including styled-components) in views, try to extract component whenever possible | ||
- Use font sizes, colors, etc from constants | ||
- Use our @components/atoms/Text component only, do not use the default Text from react-native (we have custom text styles applied by default) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
### Git Hygiene | ||
|
||
- When merging PRs to develop, please use Squash and merge | ||
- Make sure to review the commit message before finalizing the merge, don't just leave defaults in there | ||
- Use Merge from release branches to master | ||
- Use Merge from master to develop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,136 @@ | ||
### Server-driven UI | ||
|
||
#### Cards | ||
|
||
| key | value | | ||
| --- | ----- | | ||
| component | `Card` | | ||
| title | title of the card | | ||
| body | optional, body of the card | | ||
| backgroundColor | optional, background color of the color, defaults to `#FFFFFF` | | ||
| icon | optional, icon of the card | | ||
| externalLink | optional, if specified, display the card as an external link and open the link in a browser when tapped | | ||
| deepLink | optional, if specified, deep link to a specific screen. | | ||
| action | `share-app` optional, if specified, shares the app when tapped | | ||
|
||
> Please specify one of `action`, `deepLink` or `externalLink` | ||
Example: | ||
```json | ||
{ | ||
"component": "Card", | ||
"title": "foo", | ||
"body": "bar", | ||
"backgroundColor": "#FF0000", | ||
"icon": "http://foo/image.png", | ||
"externalLink": "http://govt.nz", | ||
"deepLink": "nzcovidtracer://SomeScreen" | ||
} | ||
``` | ||
#### Panels | ||
|
||
| key | value | | ||
| --- | ----- | | ||
| component | `Panel` | | ||
| title | title of the card | | ||
| body | body of the card | | ||
| backgroundColor | optional, background color of the color, defaults to `#FFFFFF` | | ||
| buttons | optional, primary and secondary button, empty or empty array to hide buttons | | ||
| buttons.text | button text | | ||
| buttons.externalLink | optional, if specified, open the link on a browser when tapped | | ||
| buttons.deepLink | optional, if specified, navigate the deep link when tapped | | ||
| buttons.accessibilityHint | optional, if specified, override the default accessibility hint | | ||
|
||
> Please specify either `deepLink` or `externalLink` | ||
Example: | ||
```json | ||
{ | ||
"component": "Panel", | ||
"title": "foo", | ||
"body": "bar", | ||
"backgroundColor": "#FF0000", | ||
"buttons": [{ | ||
"text": "primary", | ||
"deepLink": "nzcovidtracer://SomeScreen" | ||
}, { | ||
"text": "secondary", | ||
"externalLink": "http://govt.nz", | ||
"accessibilityHint": "Custom hint" | ||
}] | ||
} | ||
``` | ||
|
||
#### Info blocks | ||
|
||
| key | value | | ||
| --- | ----- | | ||
| component | `InfoBlock` | | ||
| icon | optional, icon of the card | | ||
| backgroundColor | optional, background of the card, defaults to `#FFF1D0` | | ||
| title | required, title of the card | | ||
| body | required, body of the card | | ||
|
||
Example: | ||
```json | ||
{ | ||
"component": "InfoBlock", | ||
"icon": "http://foo/image.png", | ||
"backgroundColor": "#FF0000", | ||
"title": "foo", | ||
"body": "bar" | ||
} | ||
``` | ||
|
||
#### Sections | ||
|
||
Section group cards and panels together: | ||
|
||
| key | value | | ||
| --- | ----- | | ||
| title | optional, section title | | ||
| data | an array of `Card` or `Panel` components | | ||
|
||
There might be multiple sections in a scroll view. | ||
|
||
Example (2 sections): | ||
```json | ||
[{ | ||
"data": [{ | ||
"component": "Panel", | ||
"title": "foo", | ||
"body": "bar", | ||
"buttons": [{ | ||
"text": "primary", | ||
"deepLink": "nzcovidtracer://SomeScreen" | ||
}] | ||
}, { | ||
"component": "Card", | ||
"title": "foo", | ||
"body": "bar" | ||
}] | ||
}, | ||
{ | ||
"title": "Section 2", | ||
"data": [{ | ||
"component": "Panel", | ||
"title": "foo", | ||
"body": "bar" | ||
}] | ||
}] | ||
``` | ||
|
||
|
||
#### Deep links | ||
|
||
For security and maintainability reasons, only a specified set of deeplinks will be supported | ||
|
||
| link | behaviour | | ||
| --- | ----- | | ||
| nzcovidtracer://dashboard/today | Navigate to `dashboard` on the `today tab` | | ||
| nzcovidtracer://dashboard/resources | Navigate to `dashboard` on the `resources tab` | | ||
| nzcovidtracer://nhi | Navigate to `privacy` -> `add nhi`, if user has no NHI stored. Otherwise navigate to `edit nhi` | | ||
| nzcovidtracer://diary | Navigate to `diary` | | ||
| nzcovidtracer://manualEntry | Navigate to `manual entry` | | ||
|
||
> Please note that these links are only supported from server driven components for now |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
declare module "@bugfender/rn-bugfender"; | ||
declare module "react-native-bluetooth-state-manager"; | ||
declare module "react-native-google-safetynet"; | ||
declare module "react-native-ios11-devicecheck"; | ||
declare module "*.png"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.