mirror of
https://github.com/KoalaSat/nostros.git
synced 2024-09-28 22:30:41 +00:00
Merge branch 'main' into dependabot/npm_and_yarn/i18next-22.0.2
This commit is contained in:
commit
e0fb0174fa
44
.github/workflows/android-build.yml
vendored
Normal file
44
.github/workflows/android-build.yml
vendored
Normal 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
47
.github/workflows/js-linter.yml
vendored
Normal 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
44
.github/workflows/release.yml
vendored
Normal 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
1
CHANGELOG.md
Normal file
@ -0,0 +1 @@
|
||||
|
32
README.md
32
README.md
@ -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
|
||||
|
@ -125,7 +125,4 @@ export const ContactsPage: React.FC = () => {
|
||||
};
|
||||
|
||||
export default ContactsPage;
|
||||
function setIsContact(arg0: boolean) {
|
||||
throw new Error('Function not implemented.');
|
||||
}
|
||||
|
||||
|
@ -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']}
|
||||
|
@ -62,7 +62,7 @@ export const LandingPage: React.FC = () => {
|
||||
}, [init, relayPool, loadingDb]);
|
||||
|
||||
useEffect(() => {
|
||||
if (usersReady && relayPool) {
|
||||
if (usersReady && relayPool && !loadingDb) {
|
||||
initRelays()
|
||||
setPage('home');
|
||||
}
|
||||
|
@ -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';
|
||||
|
@ -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';
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user