Merge branch 'main' into dependabot/npm_and_yarn/react-native-community/eslint-config-3.0.3

This commit is contained in:
KoalaSat 2022-10-24 21:55:10 +00:00 committed by GitHub
commit ba29374978
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 174 additions and 25 deletions

44
.github/workflows/android-build.yml vendored Normal file
View File

@ -0,0 +1,44 @@
name: "Build: Android"
on:
workflow_dispatch:
workflow_call:
push:
branches: [ "main" ]
paths: [ "frontend" ]
pull_request:
branches: [ "main" ]
paths: [ "frontend" ]
jobs:
build-android:
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/checkout@v3
- name: 'Install yarn Dependencies'
run: |
yarn install
- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 11
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: 'Build Android Release'
run: |
cd android
./gradlew assembleRelease
- name: 'Get Commit Hash'
id: commit
uses: pr-mpt/actions-commit-hash@v1
- name: 'Upload .apk Release Artifact (for Release)'
uses: actions/upload-artifact@v3
with:
name: nostros-${{ github.ref_name }}.apk
path: android/app/build/outputs/apk/release/app-release.apk

47
.github/workflows/js-linter.yml vendored Normal file
View File

@ -0,0 +1,47 @@
name: "Lint: Javascript Client"
on:
# Trigger the workflow on push or pull request,
# but only for the main branch
push:
branches:
- main
paths:
- frontend
pull_request:
branches:
- main
paths:
- frontend
jobs:
run-linters:
name: Run linters
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v2
- name: 'Setup node'
uses: actions/setup-node@v3
with:
node-version: 16.17.0
cache: yarn
cache-dependency-path: frontend/package-lock.json
# ESLint and Prettier must be in `package.json`
- name: 'Install NPM Dependencies'
run: |
cd frontend
yarn install
- name: Run linters
uses: wearerequired/lint-action@v2
with:
prettier: true
prettier_dir: frontend
## Disabled due to error
# eslint: true
# eslint_dir: frontend

44
.github/workflows/release.yml vendored Normal file
View File

@ -0,0 +1,44 @@
name: Release
on:
push:
tags:
- "v*.*.*"
jobs:
android-build:
uses: KoalaSat/nostros/.github/workflows/android-build.yml@main
release:
needs: [android-build]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: "Generate Release Changelog"
id: changelog
uses: heinrichreimer/github-changelog-generator-action@v2.3
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Release
id: create-release
uses: softprops/action-gh-release@v1
with:
body: ${{ steps.changelog.outputs.changelog }}
# Upload APK artifact asset
- name: 'Download APK Artifact'
uses: actions/download-artifact@v3
with:
name: nostros-${{ github.ref_name }}.apk
path: .
- name: 'Upload APK Asset'
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-release.outputs.upload_url }}
asset_path: app-release.apk
asset_name: nostros-${{ github.ref_name }}.apk
asset_content_type: application/apk

1
CHANGELOG.md Normal file
View File

@ -0,0 +1 @@

View File

@ -1,5 +1,4 @@
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/db3100f978a542d588f8ae9a4abf2d55)](https://www.codacy.com/gh/KoalaSat/sats-4-likes-bot/dashboard?utm_source=github.com&utm_medium=referral&utm_content=KoalaSat/sats-4-likes-bot&utm_campaign=Badge_Grade)
[![MIT license](https://img.shields.io/badge/license-MIT-green)](https://github.com/KoalaSat/sats-4-likes-bot/blob/main/LICENSE)
[![Apache 2 license](https://img.shields.io/badge/license-Apache%202-blue)](https://github.com/KoalaSat/nostros/blob/main/LICENSE)
![nostros_logo](https://user-images.githubusercontent.com/111684255/197588983-2a196d74-0f1e-45e8-be56-0da8c1602835.png)
@ -7,7 +6,7 @@ Wellcome to the NOSTROS project.
# Getting Started
## Required Libraries and Framworks
## Required Libraries and Frameworks
- Node 16.x
- JDK 17.0.x
- (Android) Android Studio SKD
@ -16,30 +15,41 @@ Wellcome to the NOSTROS project.
# Running
- Open a virtual device
- Install
```
yarn install
```
- Run Metro
```
yarn start
```
# Some Features to Work On
## Home
### Bugs
- [ ] User info missing on first start
- [ ] i18n not loading
- [ ] Logging out and in again does not work
- [ ] Clipboard library not working
### Basics
- [ ] Infinite Load
- [ ] Relays management (add, remove and recomend)
- [ ] Random Key Generator
### Home
- [ ] Public Room
- [ ] Other Rooms
## Profile
### Profile
- [ ] Verify NIP-05
- [ ] Verify LNURL https://github.com/andrerfneves/lightning-address
## Contacts
### Contacts
- [ ] Direct Messages https://github.com/nostr-protocol/nips/blob/master/04.md
## Note
### Note
- [ ] Mentions https://github.com/nostr-protocol/nips/blob/master/08.md
- [ ] Reactions https://github.com/nostr-protocol/nips/blob/master/25.md
- [ ] Deletion https://github.com/nostr-protocol/nips/blob/master/09.md
- [ ] Tag Users https://github.com/nostr-protocol/nips/blob/master/10.md
## Send
### Send
- [ ] Mentions https://github.com/nostr-protocol/nips/blob/master/08.md
## Config
- [ ] Relays management (add, remove and recomend)
### Config
- [ ] Private Key download
# Kudos

View File

@ -125,7 +125,4 @@ export const ContactsPage: React.FC = () => {
};
export default ContactsPage;
function setIsContact(arg0: boolean) {
throw new Error('Function not implemented.');
}

View File

@ -12,12 +12,14 @@ import { EventKind } from '../../lib/nostr/Events';
import { RelayFilters } from '../../lib/nostr/Relay';
import { getReplyEventId } from '../../Functions/RelayFunctions/Events';
import { getUsers } from '../../Functions/DatabaseFunctions/Users';
import Loading from '../Loading';
export const HomePage: React.FC = () => {
const { database, setPage, page } = useContext(AppContext);
const { lastEventId, setLastEventId, relayPool, publicKey } = useContext(RelayPoolContext);
const { lastEventId, relayPool, publicKey } = useContext(RelayPoolContext);
const theme = useTheme();
const [notes, setNotes] = useState<Note[]>([]);
const [totalContacts, setTotalContacts] = useState<number>(-1);
const { t } = useTranslation('common');
const loadNotes: () => void = () => {
@ -32,6 +34,7 @@ export const HomePage: React.FC = () => {
if (database) {
getNotes(database, { limit: 1 }).then((notes) => {
getUsers(database, { contacts: true }).then((users) => {
setTotalContacts(users.length)
let message: RelayFilters = {
kinds: [EventKind.textNote, EventKind.recommendServer],
authors: [publicKey, ...users.map((user) => user.id)],
@ -92,7 +95,11 @@ export const HomePage: React.FC = () => {
return (
<>
<Layout style={styles.container} level='4'>
{notes.length === 0 && totalContacts !== 0 ? (
<Loading />
) : (
<List data={notes} renderItem={(item) => itemCard(item.item)} />
)}
</Layout>
<ActionButton
buttonColor={theme['color-primary-400']}

View File

@ -62,7 +62,7 @@ export const LandingPage: React.FC = () => {
}, [init, relayPool, loadingDb]);
useEffect(() => {
if (usersReady && relayPool) {
if (usersReady && relayPool && !loadingDb) {
initRelays()
setPage('home');
}

View File

@ -1,4 +1,4 @@
import React, { useContext, useEffect, useState } from 'react';
import React, { useContext, useState } from 'react';
import { Layout } from '@ui-kitten/components';
import { StyleSheet } from 'react-native';
import { AppContext } from '../../Contexts/AppContext';

View File

@ -1,4 +1,4 @@
import React, { useEffect, useState } from 'react';
import React, { useState } from 'react';
import { SQLiteDatabase } from 'react-native-sqlite-storage';
import { initDatabase } from '../Functions/DatabaseFunctions';
import { createInitDatabase } from '../Functions/DatabaseFunctions/Migrations';

View File

@ -6,7 +6,6 @@ import { AppContext } from './AppContext';
import { storeEvent } from '../Functions/DatabaseFunctions/Events';
import { getRelays, Relay as RelayEntity, storeRelay } from '../Functions/DatabaseFunctions/Relays';
import { showMessage } from 'react-native-flash-message';
import { getReplyEventId } from '../Functions/RelayFunctions/Events';
export interface RelayPoolContextProps {
relayPool?: RelayPool;

View File

@ -20,7 +20,7 @@
"buffer": "^6.0.3",
"create-hash": "^1.2.0",
"events": "^3.3.0",
"i18next": "^21.10.0",
"i18next": "^22.0.2",
"moment": "^2.29.4",
"react": "17.0.1",
"react-i18next": "^11.18.6",

View File

@ -3899,10 +3899,10 @@ human-signals@^1.1.1:
resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-1.1.1.tgz#c5b1cd14f50aeae09ab6c59fe63ba3395fe4dfa3"
integrity sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==
i18next@^21.10.0:
version "21.10.0"
resolved "https://registry.yarnpkg.com/i18next/-/i18next-21.10.0.tgz#85429af55fdca4858345d0e16b584ec29520197d"
integrity sha512-YeuIBmFsGjUfO3qBmMOc0rQaun4mIpGKET5WDwvu8lU7gvwpcariZLNtL0Fzj+zazcHUrlXHiptcFhBMFaxzfg==
i18next@^22.0.2:
version "22.0.2"
resolved "https://registry.yarnpkg.com/i18next/-/i18next-22.0.2.tgz#04634aa751388625735cdb41f625a6b0dd1dcb2f"
integrity sha512-rGXWILemhx0dpNE5PfudVU1g4SdW0hkh4WYHaP8Cl6gm1KkMdBckmNqj9WvYqp8fOSocqX5FFJeadwiOZHLSXQ==
dependencies:
"@babel/runtime" "^7.17.2"