-
Notifications
You must be signed in to change notification settings - Fork 3
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
Alejandro Maggi
committed
Oct 27, 2022
0 parents
commit d85c10a
Showing
50 changed files
with
79,729 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"root": true, | ||
"extends": [ | ||
"@react-native-community", | ||
"prettier" | ||
], | ||
"rules": { | ||
"prettier/prettier": [ | ||
"error", | ||
{ | ||
"tabWidth": 2, | ||
"useTabs": false, | ||
"avoidEscape": true, | ||
"trailingComma": "es5", | ||
"arrowParens": "always", | ||
"singleQuote": true | ||
} | ||
] | ||
} | ||
} |
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,46 @@ | ||
--- | ||
name: Bug report | ||
about: Please search the existing issues and read the documentation before opening | ||
an issue. | ||
title: '' | ||
labels: bug | ||
assignees: '' | ||
|
||
--- | ||
|
||
<!-- Issues that don't use this template are likely to be closed. --> | ||
|
||
### Current behaviour | ||
|
||
<!-- What's currently happening? --> | ||
|
||
### Expected behaviour | ||
|
||
<!-- What do you expect to happen? If there is an error, provide the complete error message with stack trace. --> | ||
|
||
### Code sample | ||
|
||
For Syntax Highlighting check this [link](https://help.github.com/en/articles/creating-and-highlighting-code-blocks) | ||
|
||
<!-- Provide a complete code sample that could be run to reproduce the issue, ideally on snack.expo.io or in a github repo. --> | ||
|
||
### Screenshots (if applicable) | ||
|
||
<!-- Include screenshots if there's a bug in the layout. --> | ||
|
||
### What have you tried | ||
|
||
<!-- List down the steps you have tried to fix or identify the issue and links to any related issues you found. --> | ||
|
||
### Your Environment | ||
|
||
<details><summary>Click To Expand</summary> | ||
<p> | ||
|
||
**`react-native info` output:** | ||
|
||
<!-- Please run `react-native info` on your terminal and paste the contents into the code block below --> | ||
|
||
``` | ||
OUTPUT GOES HERE | ||
``` |
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,10 @@ | ||
<!-- Please provide enough information so that others can review your pull request. --> | ||
<!-- Keep pull requests small and focused on a single change. --> | ||
|
||
### Motivation | ||
|
||
<!-- What existing problem does the pull request solve? Can you solve the issue with a different approach? --> | ||
|
||
### Test plan | ||
|
||
<!-- List the steps with which we can test this change. Provide screenshots if this changes anything visual. --> |
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,47 @@ | ||
on: [push, pull_request] | ||
|
||
permissions: | ||
contents: read | ||
pull-requests: read | ||
|
||
jobs: | ||
run-linters: | ||
name: Run linters | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Get npm cache directory | ||
id: npm-cache-directory | ||
run: | | ||
echo "::set-output name=dir::$(npm config get cache)" | ||
- uses: actions/cache@v3 | ||
id: npm-cache | ||
with: | ||
path: ${{ steps.npm-cache-directory.outputs.dir }} | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | ||
|
||
- uses: actions/cache@v3 | ||
id: eslintcache-cache | ||
with: | ||
path: .eslintcache | ||
key: ${{ runner.os }}-eslintcache | ||
|
||
- name: Setup node | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version-file: '.nvmrc' | ||
|
||
- name: Install Node.js dependencies | ||
run: npm ci --no-audit --prefer-offline | ||
|
||
- name: Eslint | ||
run: npm run lint | ||
|
||
- name: TypeScript | ||
run: npm run typescript | ||
|
||
- name: Jest | ||
run: npm run test |
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,29 @@ | ||
# OSX | ||
# | ||
.DS_Store | ||
|
||
# XDE | ||
.expo/ | ||
|
||
# VSCode | ||
.vscode/ | ||
jsconfig.json | ||
|
||
# node.js | ||
# | ||
node_modules/ | ||
npm-debug.log | ||
yarn-debug.log | ||
yarn-error.log | ||
|
||
# jest | ||
# | ||
coverage/ | ||
cache/jest/ | ||
|
||
# generated by bob | ||
lib/ | ||
|
||
# TypeScript | ||
# | ||
tsconfig.tsbuildinfo |
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,5 @@ | ||
.DS_Store | ||
.idea | ||
media | ||
example | ||
__tests__ |
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 @@ | ||
lts/gallium |
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,8 @@ | ||
{ | ||
"tabWidth": 2, | ||
"useTabs": false, | ||
"avoidEscape": true, | ||
"trailingComma": "es5", | ||
"arrowParens": "always", | ||
"singleQuote": true | ||
} |
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,3 @@ | ||
language: node_js | ||
node_js: | ||
- 14 |
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,20 @@ | ||
The MIT License (MIT) | ||
Copyright (c) 2022 Alejandro Maggi | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
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,42 @@ | ||
# React Native Agenda π | ||
|
||
![BuildStatus](https://github.com/maggialejandro/agenda-react-native/actions/workflows/lint.yml/badge.svg) | ||
[![NPM version](https://img.shields.io/npm/v/agenda-react-native.svg)](https://www.npmjs.com/package/agenda-react-native) | ||
[![npm](https://img.shields.io/npm/dm/agenda-react-native.svg)](https://github.com/maggialejandro/agenda-react-native) | ||
[![CodeFactor](https://www.codefactor.io/repository/github/maggialejandro/agenda-react-native/badge)](https://www.codefactor.io/repository/github/maggialejandro/agenda-react-native) | ||
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://makeapullrequest.com) | ||
|
||
## Installation | ||
|
||
```console | ||
npm install agenda-react-native --save | ||
``` | ||
|
||
Using yarn | ||
|
||
```console | ||
yarn add agenda-react-native | ||
``` | ||
|
||
<p align="center"> | ||
<img alt="Screenshot" src="https://github.com/maggialejandro/agenda-react-native/blob/main/screenshot.png?raw=true" width="400" /> | ||
</p> | ||
|
||
## Usage | ||
|
||
## API | ||
|
||
| Prop | Description | Required? | Default | Type | | ||
| -------------------- | ---------------------------------------- | --------- | ------- | ---------------------- | | ||
| **`onDayPress`** | Callback called when a day is pressed. | no | | (date: Date) => void | | ||
| **`onEventPress`** | Callback called when a event is pressed. | no | | (event: Event) => void | | ||
| **`selectedDay`** | Selected day | no | today | Date | | ||
| **`events`** | Events | no | | Event[] | | ||
| **`monthTheme`** | Month component theme | no | | MonthThemeType | | ||
| **`theme`** | Agenda theme | no | | ThemeType | | ||
| **`locale`** | Locale | no | | LocaleType | | ||
| **`firstDayMonday`** | Monday as first day of the week | no | false | boolean | | ||
|
||
## License | ||
|
||
MIT |
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,3 @@ | ||
module.exports = { | ||
presets: ['module:metro-react-native-babel-preset'], | ||
}; |
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 @@ | ||
module.exports = require('./lib/module/babel/index.js'); |
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,10 @@ | ||
node_modules/**/* | ||
.expo/* | ||
npm-debug.* | ||
*.jks | ||
*.p12 | ||
*.key | ||
*.mobileprovision | ||
*.orig.* | ||
web-build/ | ||
web-report/ |
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 @@ | ||
{} |
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,78 @@ | ||
import React, { useState } from 'react'; | ||
import { SafeAreaView, useWindowDimensions } from 'react-native'; | ||
import { Agenda, Event, MonthThemeType } from 'react-native-agenda'; | ||
|
||
const MONTH_THEME: MonthThemeType = { | ||
activeDayContentStyle: { | ||
backgroundColor: '#1890FF', | ||
borderRadius: 18, | ||
alignItems: 'center', | ||
justifyContent: 'center', | ||
}, | ||
activeDayTextStyle: { | ||
color: 'white', | ||
}, | ||
dayContainerStyle: { | ||
marginVertical: 0, | ||
paddingVertical: 5, | ||
backgroundColor: 'transparent', | ||
}, | ||
dayContentStyle: { | ||
width: 36, | ||
height: 36, | ||
}, | ||
activeDayContainerStyle: { | ||
backgroundColor: 'transparent', | ||
}, | ||
}; | ||
|
||
const events: Event[] = [ | ||
{ | ||
name: 'Buy a gift', | ||
startDate: new Date(2022, 8, 12, 10, 30), | ||
endDate: new Date(2022, 8, 15, 10, 30), | ||
color: '#3722f6', | ||
}, | ||
{ | ||
name: 'Test Two', | ||
startDate: new Date(2022, 8, 14, 12, 40), | ||
endDate: new Date(2022, 8, 17, 12, 40), | ||
color: '#61d800', | ||
}, | ||
{ | ||
name: 'Test Three', | ||
startDate: new Date(2022, 8, 28, 11, 40), | ||
endDate: new Date(2022, 9, 10, 14, 40), | ||
color: '#dd0074', | ||
}, | ||
{ | ||
name: 'Study', | ||
startDate: new Date(2022, 7, 28, 14, 20), | ||
endDate: new Date(2022, 8, 3, 14, 20), | ||
color: '#fa8100', | ||
}, | ||
{ | ||
name: 'Check-in', | ||
startDate: new Date(2022, 8, 5, 14, 20), | ||
endDate: new Date(2022, 8, 5, 16, 20), | ||
color: '#b794f6', | ||
}, | ||
]; | ||
|
||
const App = () => { | ||
const [selectedDay, setSelectedDay] = useState(new Date(2022, 8, 1)); | ||
const { height } = useWindowDimensions(); | ||
|
||
return ( | ||
<SafeAreaView style={{ height }}> | ||
<Agenda | ||
events={events} | ||
selectedDay={selectedDay} | ||
onDayPress={setSelectedDay} | ||
monthTheme={MONTH_THEME} | ||
/> | ||
</SafeAreaView> | ||
); | ||
}; | ||
|
||
export default App; |
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,33 @@ | ||
{ | ||
"expo": { | ||
"name": "react-native-agenda", | ||
"slug": "react-native-agenda", | ||
"privacy": "public", | ||
"version": "1.0.0", | ||
"orientation": "portrait", | ||
"icon": "./assets/icon.png", | ||
"userInterfaceStyle": "light", | ||
"splash": { | ||
"image": "./assets/splash.png", | ||
"resizeMode": "contain", | ||
"backgroundColor": "#ffffff" | ||
}, | ||
"packagerOpts": { | ||
"assetExts": ["ttf"], | ||
"config": "./metro.config.js", | ||
"projectRoots": "" | ||
}, | ||
"ios": { | ||
"supportsTablet": true | ||
}, | ||
"android": { | ||
"adaptiveIcon": { | ||
"foregroundImage": "./assets/adaptive-icon.png", | ||
"backgroundColor": "#FFFFFF" | ||
} | ||
}, | ||
"web": { | ||
"favicon": "./assets/favicon.png" | ||
} | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.