Merge branch 'development' of https://github.com/ecency/ecency-mobile into sa/edit-history

This commit is contained in:
Sadaqat Ali 2022-05-05 15:56:56 +05:00
commit ba4bf2b56b
17 changed files with 285 additions and 225 deletions

View File

@ -144,7 +144,7 @@ android {
minSdkVersion rootProject.ext.minSdkVersion minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion
versionCode versionMajor * 10000 + versionMinor * 100 + versionPatch versionCode versionMajor * 10000 + versionMinor * 100 + versionPatch
versionName "3.0.28" versionName "3.0.29"
resValue "string", "build_config_package", "app.esteem.mobile.android" resValue "string", "build_config_package", "app.esteem.mobile.android"
multiDexEnabled true multiDexEnabled true
// react-native-image-crop-picker // react-native-image-crop-picker

View File

@ -15,11 +15,11 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>APPL</string> <string>APPL</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>3.0.28</string> <string>3.0.29</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>2807</string> <string>2808</string>
<key>LSRequiresIPhoneOS</key> <key>LSRequiresIPhoneOS</key>
<true /> <true />
<key>NSAppTransportSecurity</key> <key>NSAppTransportSecurity</key>

View File

@ -15,10 +15,10 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>BNDL</string> <string>BNDL</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>3.0.28</string> <string>3.0.29</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>2807</string> <string>2808</string>
</dict> </dict>
</plist> </plist>

View File

@ -1129,7 +1129,7 @@
CODE_SIGN_IDENTITY = "iPhone Distribution"; CODE_SIGN_IDENTITY = "iPhone Distribution";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual; CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 2807; CURRENT_PROJECT_VERSION = 2808;
DEAD_CODE_STRIPPING = NO; DEAD_CODE_STRIPPING = NO;
DEVELOPMENT_TEAM = 75B6RXTKGT; DEVELOPMENT_TEAM = 75B6RXTKGT;
EXCLUDED_ARCHS = ""; EXCLUDED_ARCHS = "";
@ -1208,7 +1208,7 @@
CODE_SIGN_ENTITLEMENTS = Ecency/Ecency.entitlements; CODE_SIGN_ENTITLEMENTS = Ecency/Ecency.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Manual; CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 2807; CURRENT_PROJECT_VERSION = 2808;
DEAD_CODE_STRIPPING = NO; DEAD_CODE_STRIPPING = NO;
DEVELOPMENT_TEAM = 75B6RXTKGT; DEVELOPMENT_TEAM = 75B6RXTKGT;
EXCLUDED_ARCHS = ""; EXCLUDED_ARCHS = "";

View File

@ -17,7 +17,7 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>APPL</string> <string>APPL</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>3.0.28</string> <string>3.0.29</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleURLTypes</key> <key>CFBundleURLTypes</key>

View File

@ -15,10 +15,10 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>BNDL</string> <string>BNDL</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>3.0.28</string> <string>3.0.29</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>2807</string> <string>2808</string>
</dict> </dict>
</plist> </plist>

View File

@ -730,7 +730,7 @@ SPEC CHECKSUMS:
boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c
BugsnagReactNative: a96bc039e0e4ec317a8b331714393d836ca60557 BugsnagReactNative: a96bc039e0e4ec317a8b331714393d836ca60557
BVLinearGradient: e3aad03778a456d77928f594a649e96995f1c872 BVLinearGradient: e3aad03778a456d77928f594a649e96995f1c872
DoubleConversion: cde416483dac037923206447da6e1454df403714 DoubleConversion: 831926d9b8bf8166fd87886c4abab286c2422662
FBLazyVector: 3bb422f41b18121b71783a905c10e58606f7dc3e FBLazyVector: 3bb422f41b18121b71783a905c10e58606f7dc3e
FBReactNativeSpec: f2c97f2529dd79c083355182cc158c9f98f4bd6e FBReactNativeSpec: f2c97f2529dd79c083355182cc158c9f98f4bd6e
Firebase: c23a36d9e4cdf7877dfcba8dd0c58add66358999 Firebase: c23a36d9e4cdf7877dfcba8dd0c58add66358999
@ -742,7 +742,7 @@ SPEC CHECKSUMS:
FirebaseInstanceID: bd3ffc24367f901a43c063b36c640b345a4a5dd1 FirebaseInstanceID: bd3ffc24367f901a43c063b36c640b345a4a5dd1
FirebaseMessaging: 5eca4ef173de76253352511aafef774caa1cba2a FirebaseMessaging: 5eca4ef173de76253352511aafef774caa1cba2a
Folly: b73c3869541e86821df3c387eb0af5f65addfab4 Folly: b73c3869541e86821df3c387eb0af5f65addfab4
glog: 40a13f7840415b9a77023fbcae0f1e6f43192af3 glog: 85ecdd10ee8d8ec362ef519a6a45ff9aa27b2e85
GoogleAppMeasurement: a6a3a066369828db64eda428cb2856dc1cdc7c4e GoogleAppMeasurement: a6a3a066369828db64eda428cb2856dc1cdc7c4e
GoogleDataTransport: f56af7caa4ed338dc8e138a5d7c5973e66440833 GoogleDataTransport: f56af7caa4ed338dc8e138a5d7c5973e66440833
GoogleUtilities: 7f2f5a07f888cdb145101d6042bc4422f57e70b3 GoogleUtilities: 7f2f5a07f888cdb145101d6042bc4422f57e70b3

View File

@ -17,9 +17,9 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string> <string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>3.0.28</string> <string>3.0.29</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>2807</string> <string>2808</string>
<key>NSExtension</key> <key>NSExtension</key>
<dict> <dict>
<key>NSExtensionAttributes</key> <key>NSExtensionAttributes</key>

View File

@ -1,6 +1,6 @@
{ {
"name": "ecency", "name": "ecency",
"version": "3.0.28", "version": "3.0.29",
"displayName": "Ecency", "displayName": "Ecency",
"private": true, "private": true,
"rnpm": { "rnpm": {

View File

@ -2,21 +2,24 @@ import React, { useEffect, useState } from "react";
import { Image } from "react-native"; import { Image } from "react-native";
import EStyleSheet from "react-native-extended-stylesheet"; import EStyleSheet from "react-native-extended-stylesheet";
import FastImage from "react-native-fast-image"; import FastImage from "react-native-fast-image";
import { TouchableWithoutFeedback } from "react-native-gesture-handler"; import { TouchableOpacity } from "react-native-gesture-handler";
interface AutoHeightImageProps {
contentWidth:number,
imgUrl:string,
isAnchored:boolean,
activeOpacity?:number,
onPress:()=>void,
}
export const AutoHeightImage = ({ export const AutoHeightImage = ({
contentWidth, contentWidth,
imgUrl, imgUrl,
isAnchored, isAnchored,
activeOpacity,
onPress onPress
}:{ }:AutoHeightImageProps) => {
contentWidth:number,
imgUrl:string,
isAnchored:boolean,
onPress:()=>void,
}) => {
const [imgWidth, setImgWidth] = useState(contentWidth); const [imgWidth, setImgWidth] = useState(contentWidth);
@ -47,14 +50,14 @@ import { TouchableWithoutFeedback } from "react-native-gesture-handler";
} }
return ( return (
<TouchableWithoutFeedback onPress={onPress} disabled={isAnchored}> <TouchableOpacity onPress={onPress} disabled={isAnchored} activeOpacity={activeOpacity || 1}>
<FastImage <FastImage
style={imgStyle} style={imgStyle}
source={{uri:imgUrl}} source={{uri:imgUrl}}
resizeMode={FastImage.resizeMode.contain} resizeMode={FastImage.resizeMode.contain}
onLoad={_onLoad} onLoad={_onLoad}
/> />
</TouchableWithoutFeedback> </TouchableOpacity>
) )
} }

View File

@ -7,7 +7,7 @@ import { AutoHeightImage } from '../autoHeightImage/autoHeightImage';
import { useHtmlIframeProps, iframeModel } from '@native-html/iframe-plugin'; import { useHtmlIframeProps, iframeModel } from '@native-html/iframe-plugin';
import WebView from 'react-native-webview'; import WebView from 'react-native-webview';
import { VideoPlayer } from '..'; import { VideoPlayer } from '..';
import {useHtmlTableProps } from '@native-html/table-plugin'; import { useHtmlTableProps } from '@native-html/table-plugin';
import { ScrollView } from 'react-native-gesture-handler'; import { ScrollView } from 'react-native-gesture-handler';
interface PostHtmlRendererProps { interface PostHtmlRendererProps {
@ -118,52 +118,7 @@ export const PostHtmlRenderer = memo(
default: default:
break; break;
} }
} catch (error) {} } catch (error) { }
};
const _onElement = (element: Element) => {
if (element.tagName === 'img' && element.attribs.src) {
const imgUrl = element.attribs.src;
console.log('img element detected', imgUrl);
onElementIsImage(imgUrl);
}
};
const _anchorRenderer = ({ InternalRenderer, tnode, ...props }: CustomRendererProps<TNode>) => {
const parsedTnode = parseLinkData(tnode);
const _onPress = () => {
console.log('Link Pressed:', tnode);
const data = parseLinkData(tnode);
_handleOnLinkPress(data);
};
//process video link
if(tnode.classes?.indexOf('markdown-video-link') >= 0){
if(isComment){
const imgElement = tnode.children.find((child) => {
return child.classes.indexOf('video-thumbnail') > 0 ? true : false;
});
if (!imgElement) {
return <VideoThumb contentWidth={contentWidth} onPress={_onPress} />;
}
} else {
return (
<VideoPlayer
mode={parsedTnode.youtubeId ? 'youtube' : 'uri'}
contentWidth={contentWidth}
uri={parsedTnode.videoHref}
youtubeVideoId={parsedTnode.youtubeId}
startTime={parsedTnode.startTime}
disableAutoplay={true}
/>
);
}
}
return <InternalRenderer tnode={tnode} onPress={_onPress} {...props} />;
}; };
@ -186,6 +141,70 @@ export const PostHtmlRenderer = memo(
return getMaxImageWidth(tnode.parent); return getMaxImageWidth(tnode.parent);
}; };
const _onElement = (element: Element) => {
if (element.tagName === 'img' && element.attribs.src) {
const imgUrl = element.attribs.src;
console.log('img element detected', imgUrl);
onElementIsImage(imgUrl);
}
};
const _anchorRenderer = ({ InternalRenderer, tnode, ...props }: CustomRendererProps<TNode>) => {
const parsedTnode = parseLinkData(tnode);
const _onPress = () => {
console.log('Link Pressed:', tnode);
const data = parseLinkData(tnode);
_handleOnLinkPress(data);
};
//process video link
if (tnode.classes?.indexOf('markdown-video-link') >= 0) {
if (isComment) {
const imgElement = tnode.children.find((child) => {
return child.classes.indexOf('video-thumbnail') > 0 ? true : false;
});
if (!imgElement) {
return <VideoThumb contentWidth={contentWidth} onPress={_onPress} />;
}
} else {
return (
<VideoPlayer
mode={parsedTnode.youtubeId ? 'youtube' : 'uri'}
contentWidth={contentWidth}
uri={parsedTnode.videoHref}
youtubeVideoId={parsedTnode.youtubeId}
startTime={parsedTnode.startTime}
disableAutoplay={true}
/>
);
}
}
if (tnode.children.length === 1 && tnode.children[0].tagName === 'img') {
const maxImgWidth = getMaxImageWidth(tnode);
return <AutoHeightImage
contentWidth={maxImgWidth}
imgUrl={tnode.children[0].attributes.src}
isAnchored={false}
activeOpacity={0.8}
onPress={_onPress}
/>
}
return <InternalRenderer tnode={tnode} onPress={_onPress} {...props} />;
};
const _imageRenderer = ({ tnode }: CustomRendererProps<TNode>) => { const _imageRenderer = ({ tnode }: CustomRendererProps<TNode>) => {
const imgUrl = tnode.attributes.src; const imgUrl = tnode.attributes.src;
const _onPress = () => { const _onPress = () => {
@ -225,25 +244,26 @@ export const PostHtmlRenderer = memo(
//based on number of columns a table have, sets scroll enabled or disable, also adjust table full width //based on number of columns a table have, sets scroll enabled or disable, also adjust table full width
const _tableRenderer = ({TDefaultRenderer, ...props}:CustomRendererProps<TNode>) => { const _tableRenderer = ({ TDefaultRenderer, ...props }: CustomRendererProps<TNode>) => {
const tableProps = useHtmlTableProps(props); const tableProps = useHtmlTableProps(props);
const isScrollable = tableProps.numOfColumns > 3; const isScrollable = tableProps.numOfColumns > 3;
const _tableWidth = isScrollable ? tableProps.numOfColumns * _minTableColWidth: contentWidth; const _tableWidth = isScrollable ? tableProps.numOfColumns * _minTableColWidth : contentWidth;
props.style = {width:_tableWidth}; props.style = { width: _tableWidth };
return ( return (
<ScrollView horizontal={true} scrollEnabled={isScrollable}> <ScrollView horizontal={true} scrollEnabled={isScrollable}>
<TDefaultRenderer {...props} /> <TDefaultRenderer {...props} />
</ScrollView> </ScrollView>
)} )
}
// iframe renderer for rendering iframes in body // iframe renderer for rendering iframes in body
const _iframeRenderer = function IframeRenderer(props) { const _iframeRenderer = function IframeRenderer(props) {
const iframeProps = useHtmlIframeProps(props); const iframeProps = useHtmlIframeProps(props);
if(isComment){ if (isComment) {
const _onPress = () => { const _onPress = () => {
console.log('iframe thumb Pressed:', iframeProps); console.log('iframe thumb Pressed:', iframeProps);
if (handleVideoPress) { if (handleVideoPress) {
@ -253,9 +273,9 @@ export const PostHtmlRenderer = memo(
return ( return (
<VideoThumb contentWidth={contentWidth} onPress={_onPress} /> <VideoThumb contentWidth={contentWidth} onPress={_onPress} />
) )
}else{ } else {
return ( return (
<VideoPlayer <VideoPlayer
mode='uri' mode='uri'
uri={iframeProps.source.uri} uri={iframeProps.source.uri}
contentWidth={contentWidth} contentWidth={contentWidth}
@ -281,9 +301,9 @@ export const PostHtmlRenderer = memo(
img: styles.img, img: styles.img,
table: styles.table, table: styles.table,
tr: { ...styles.tr, width: contentWidth }, //center tag causes tr to have 0 width if not exclusivly set, contentWidth help avoid that tr: { ...styles.tr, width: contentWidth }, //center tag causes tr to have 0 width if not exclusivly set, contentWidth help avoid that
th: { ...styles.th, minWidth: _minTableColWidth}, th: { ...styles.th, minWidth: _minTableColWidth },
td: { ...styles.td, minWidth: _minTableColWidth}, td: { ...styles.td, minWidth: _minTableColWidth },
div: { ...styles.div, maxWidth:contentWidth }, //makes sure width covers the available horizontal space for view and not exceed the contentWidth if parent bound id not defined div: { ...styles.div, maxWidth: contentWidth }, //makes sure width covers the available horizontal space for view and not exceed the contentWidth if parent bound id not defined
blockquote: styles.blockquote, blockquote: styles.blockquote,
code: styles.code, code: styles.code,
li: styles.li, li: styles.li,

View File

@ -7,9 +7,9 @@
"transfer": "Siirto", "transfer": "Siirto",
"power_up": "Ansaintaan", "power_up": "Ansaintaan",
"transfer_from_savings": "Säästöistä", "transfer_from_savings": "Säästöistä",
"withdraw_savings": "Withdraw Savings", "withdraw_savings": "Kotiuta säästöihin",
"withdraw_vesting": "Power Down", "withdraw_vesting": "Power Down",
"open_order": "Open Order", "open_order": "Avoimet Tilaukset",
"fill_order": "Täytä hakemus", "fill_order": "Täytä hakemus",
"post": "Julkaisu", "post": "Julkaisu",
"comment": "Kommentti", "comment": "Kommentti",
@ -51,12 +51,12 @@
"to": "Vastaanottaja", "to": "Vastaanottaja",
"estimated_value_desc": "Ostohinnan mukaan", "estimated_value_desc": "Ostohinnan mukaan",
"estimated_value": "Arvioutu arvo", "estimated_value": "Arvioutu arvo",
"vote_value": "Vote value", "vote_value": "Ääniarvo",
"delegated_hive_power": "Delegated hive power", "delegated_hive_power": "Valtuutettu Hive Power",
"powering_down_hive_power": "Powering down", "powering_down_hive_power": "Tehon alentaminen",
"received_hive_power": "Received hive power", "received_hive_power": "Vastaanotettu Hive Power",
"total_hive_power": "Total hive power", "total_hive_power": "Hive Power yhteensä",
"savings": "Savings", "savings": "Säästöt",
"estimated_amount": "Ääniarvo", "estimated_amount": "Ääniarvo",
"amount_information": "Siirrä kytkintä muuttaaksesi määrää", "amount_information": "Siirrä kytkintä muuttaaksesi määrää",
"amount": "Määrä", "amount": "Määrä",
@ -76,11 +76,11 @@
"next": "SEURAAVA", "next": "SEURAAVA",
"delegate": "Valtuuta", "delegate": "Valtuuta",
"power_down": "Power Down", "power_down": "Power Down",
"withdraw_hive": "Withdraw Savings", "withdraw_hive": "Kotiuta säästöihin",
"withdraw_hbd": "Withdraw Savings", "withdraw_hbd": "Kotiuta säästöt",
"transfer_to_savings": "Säästöihin", "transfer_to_savings": "Säästöihin",
"convert": "Muunna", "convert": "Muunna",
"convert_request": "Convert Request", "convert_request": "Muunnospyyntö",
"escrow_transfer": "Escrow-siirto", "escrow_transfer": "Escrow-siirto",
"escrow_dispute": "Escrow-riita", "escrow_dispute": "Escrow-riita",
"escrow_release": "Escrow-vapautus", "escrow_release": "Escrow-vapautus",
@ -91,9 +91,9 @@
"fill_transfer_from_savings": "Säästöt Toteutettu", "fill_transfer_from_savings": "Säästöt Toteutettu",
"fill_vesting_withdraw": "PowerDown toteutettu", "fill_vesting_withdraw": "PowerDown toteutettu",
"ecency": { "ecency": {
"title": "Points", "title": "Pisteet",
"name": "Ecency Points", "name": "Ecency pisteet",
"buy": "GET POINTS" "buy": "Lunasta pisteet"
}, },
"savinghive": { "savinghive": {
"title": "HIVE säästöt" "title": "HIVE säästöt"
@ -115,23 +115,23 @@
"name": "Hive Power" "name": "Hive Power"
}, },
"hive_dollar": { "hive_dollar": {
"name": "Hive Dollar" "name": "Hive Dollarit"
}, },
"btc": { "btc": {
"title": "BTC", "title": "BTC",
"buy": "OTA BTC", "buy": "OTA BTC",
"address": "VASTAANOTA" "address": "VASTAANOTA"
}, },
"last_updated": "Last Updated:", "last_updated": "Viimeksi päivitetty:",
"updating": "Updating...", "updating": "Päivitetään...",
"coin_details": "Details", "coin_details": "Lisätiedot",
"change": "Change", "change": "Muuta",
"activities": "Activities", "activities": "Toiminnat",
"savings_withdrawal": "Pending Withdrawals", "savings_withdrawal": "Odottavat Nostot",
"open_orders": "Open Orders", "open_orders": "Avoimet Tilaukset",
"conversions_requested": "Conversions Requested", "conversions_requested": "Pyydetyt muunnokset",
"expires": "expires", "expires": "vanhenee",
"pending_requests": "Pending Requests" "pending_requests": "Odottavat pyynnöt"
}, },
"notification": { "notification": {
"vote": "äänesti", "vote": "äänesti",
@ -217,7 +217,7 @@
"currency": "Valuutta", "currency": "Valuutta",
"language": "Kieli", "language": "Kieli",
"server": "Palvelin", "server": "Palvelin",
"color_theme": "Appearance", "color_theme": "Ulkoasu",
"push_notification": "Push-ilmoitus", "push_notification": "Push-ilmoitus",
"notification": { "notification": {
"follow": "Seuraa", "follow": "Seuraa",
@ -241,9 +241,9 @@
"always_warn": "Kysy aina" "always_warn": "Kysy aina"
}, },
"theme": { "theme": {
"system": "Device settings", "system": "Laitteen asetukset",
"light": "Light", "light": "Vaalea",
"dark": "Dark" "dark": "Tumma"
}, },
"feedback_success": "Sähköposti avattu onnistuneesti", "feedback_success": "Sähköposti avattu onnistuneesti",
"feedback_fail": "Sähköpostipalvelin alhaalla", "feedback_fail": "Sähköpostipalvelin alhaalla",
@ -304,8 +304,8 @@
"create_a_new_account": "Luo uusi tili", "create_a_new_account": "Luo uusi tili",
"add_an_existing_account": "Lisää olemassa oleva tili", "add_an_existing_account": "Lisää olemassa oleva tili",
"accounts": "Tilit", "accounts": "Tilit",
"refer": "Refer & Earn", "refer": "Suosittele ja tienaa",
"qr": "QR Scan" "qr": "QR-koodi"
}, },
"header": { "header": {
"title": "Kirjaudu mukauttaaksesi syötettäsi", "title": "Kirjaudu mukauttaaksesi syötettäsi",
@ -338,7 +338,7 @@
"limited_lastchar": "Tagi päättyy kirjaimeen tai numeroon", "limited_lastchar": "Tagi päättyy kirjaimeen tai numeroon",
"setting_schedule": "Aikataulutus", "setting_schedule": "Aikataulutus",
"setting_reward": "Palkkio", "setting_reward": "Palkkio",
"setting_reblog": "Reblog", "setting_reblog": "Jako",
"setting_beneficiary": "Hyötyjä", "setting_beneficiary": "Hyötyjä",
"setting_thumb": "Aseta pikkukuva", "setting_thumb": "Aseta pikkukuva",
"reward_default": "Oletus 50 % / 50 %", "reward_default": "Oletus 50 % / 50 %",
@ -374,16 +374,16 @@
"draft_save_title": "Tallennetaan luonnosta", "draft_save_title": "Tallennetaan luonnosta",
"draft_update": "Päivitä nykyinen luonnos", "draft_update": "Päivitä nykyinen luonnos",
"draft_save_new": "Tallenna uutena luonnoksena", "draft_save_new": "Tallenna uutena luonnoksena",
"label": "Label", "label": "Nimike",
"enter_label_placeholder": "Enter Label (Optional)", "enter_label_placeholder": "Syötä Tunniste (Valinnainen)",
"url": "URL", "url": "URL",
"enter_url_placeholder": "Enter URL", "enter_url_placeholder": "Kirjoita URL-osoite",
"link_type_text": "Type of Link", "link_type_text": "Linkin tyyppi",
"preview": "Preview", "preview": "Esikatselu",
"invalid_url_error": "Please insert valid url", "invalid_url_error": "Syötä kelvollinen URL",
"plain": "Plain", "plain": "Yksinkertainen",
"video": "Video", "video": "Video",
"image": "Image" "image": "Kuva"
}, },
"snippets": { "snippets": {
"label_no_snippets": "Katkelmia ei löytynyt", "label_no_snippets": "Katkelmia ei löytynyt",
@ -406,7 +406,7 @@
"title": "Ladatut kuvat", "title": "Ladatut kuvat",
"title_remove_confirmation": "Poista kuva", "title_remove_confirmation": "Poista kuva",
"btn_add": "Kuva", "btn_add": "Kuva",
"btn_insert": "INSERT", "btn_insert": "Lisää",
"btn_delete": "POISTA", "btn_delete": "POISTA",
"message_failed": "Kuvan lataaminen epäonnistui" "message_failed": "Kuvan lataaminen epäonnistui"
}, },
@ -486,8 +486,8 @@
"restart_ecency": "Haluatko käynnistää Ecencyn uudelleen?", "restart_ecency": "Haluatko käynnistää Ecencyn uudelleen?",
"restart_ecency_desc": "Muutosten käyttöönotto vaatii uudelleenkäynnistyksen.", "restart_ecency_desc": "Muutosten käyttöönotto vaatii uudelleenkäynnistyksen.",
"invalid_response": "Pyyntöä ei voitu käsitellä, Yritä myöhemmin uudelleen.", "invalid_response": "Pyyntöä ei voitu käsitellä, Yritä myöhemmin uudelleen.",
"wallet_updating": "Wallet update in progress, try again as update finishes", "wallet_updating": "Lompakon päivitys käynnissä, yritä uudelleen päivityksen valmistuessa",
"claim_failed": "Failed to claim rewards, {message}\nTry again or write to support@ecency.com" "claim_failed": "Palkintojen lunastaminen epäonnistui, {message}\nYritä uudelleen tai kirjoita osoitteeseen support@ecency.com"
}, },
"post": { "post": {
"reblog_alert": "Haluatko varmasti jakaa?", "reblog_alert": "Haluatko varmasti jakaa?",
@ -567,10 +567,10 @@
"promote": "korosta", "promote": "korosta",
"boost": "tehosta", "boost": "tehosta",
"report": "raportoi", "report": "raportoi",
"pin-blog": "Pin to blog", "pin-blog": "Kiinnitä blogiin",
"unpin-blog": "Unpin from blog", "unpin-blog": "Irrota blogista",
"pin-community": "Pin to community", "pin-community": "Kiinnitä yhteisölle",
"unpin-community": "Unpin from community" "unpin-community": "Poista kiinnitys yhteisöstä"
}, },
"deep_link": { "deep_link": {
"no_existing_user": "Käyttäjää ei ole", "no_existing_user": "Käyttäjää ei ole",
@ -613,7 +613,7 @@
"stop_information": "Haluatko varmasti poistua?", "stop_information": "Haluatko varmasti poistua?",
"percent": "Prosentti", "percent": "Prosentti",
"auto_vests": "Automaattiset Ansainnat", "auto_vests": "Automaattiset Ansainnat",
"vests": "Vests", "vests": "Annot",
"save": "TALLENNA", "save": "TALLENNA",
"percent_information": "Prosenttitieto", "percent_information": "Prosenttitieto",
"next": "SEURAAVA", "next": "SEURAAVA",
@ -624,7 +624,7 @@
"stop": "Lopeta", "stop": "Lopeta",
"sc_power_down_error": "Tätä ominaisuutta ei ole vielä toteutettu Hivesignerin kirjautumisessa", "sc_power_down_error": "Tätä ominaisuutta ei ole vielä toteutettu Hivesignerin kirjautumisessa",
"address_view": "Näytä osoite", "address_view": "Näytä osoite",
"already_delegated": "Already delegated to ", "already_delegated": "On jo delegoitu ",
"remain_hp": "HP jäljellä", "remain_hp": "HP jäljellä",
"account_detail_head": "Tilin tiedot", "account_detail_head": "Tilin tiedot",
"account_detail_subhead": "Anna HIVE Power -valtuutuksen saajan käyttäjänimi", "account_detail_subhead": "Anna HIVE Power -valtuutuksen saajan käyttäjänimi",
@ -638,13 +638,13 @@
"username_alert": "Virhe käyttäjänimessä!", "username_alert": "Virhe käyttäjänimessä!",
"username_alert_detail": "Valitse toinen käyttäjänimi", "username_alert_detail": "Valitse toinen käyttäjänimi",
"power_down": "Power Down", "power_down": "Power Down",
"power_down_amount_head": "Withdraw Amount", "power_down_amount_head": "Nostomäärä",
"power_down_amount_subhead": "Enter amount for powering down hive power", "power_down_amount_subhead": "Syötä hive power tehonalennuksen määrä",
"withdraw_accounts": "Withdraw Accounts", "withdraw_accounts": "Nostotilit",
"amount_hp": "Amount (HP)", "amount_hp": "Määrä (HP)",
"powering_down": "Powering Down", "powering_down": "Tehon alentaminen",
"powering_down_subheading": "You are currently powering down.", "powering_down_subheading": "Olet alentamassa tehoa.",
"powering_down_info": "Next power down is in {days} days, {hp} HIVE" "powering_down_info": "Seuraavaan tehonalennukseen on {days} päivää, {hp} HIVE"
}, },
"boost": { "boost": {
"title": "Hanki pisteitä", "title": "Hanki pisteitä",
@ -744,7 +744,7 @@
"mute": "HILJENNÄ / ESTÄ", "mute": "HILJENNÄ / ESTÄ",
"unmute": "POISTA HILJENNYS / ESTO", "unmute": "POISTA HILJENNYS / ESTO",
"report": "ILMIANNA KÄYTTÄJÄ", "report": "ILMIANNA KÄYTTÄJÄ",
"delegate": "DELEGATE HIVE POWER" "delegate": "VALTUUTA HIVE POWER"
}, },
"communities": { "communities": {
"joined": "Jäsenyys", "joined": "Jäsenyys",
@ -792,18 +792,18 @@
"load_draft_tooltip": "Lataa viimeisin luonnoksesi tähän" "load_draft_tooltip": "Lataa viimeisin luonnoksesi tähän"
}, },
"refer": { "refer": {
"refer_earn": "Refer & Earn", "refer_earn": "Suosittele ja tienaa",
"refer": "Refer", "refer": "Suosittele",
"rewarded": "Referral points rewarded", "rewarded": "Suosituspisteitä saatu",
"not_rewarded": "Referral reward pending", "not_rewarded": "Suosituspalkkio odottaa",
"delegate_hp": "Delegate HP", "delegate_hp": "Valtuuta HP",
"earned": "Earned Points", "earned": "Ansaitut Pisteet",
"pending": "Pending Points", "pending": "Odottavat Pisteet",
"empty_text": "Refer your loved ones today and earn free points" "empty_text": "Suosittele tutuillesi ja tienaa ilmaisia pisteitä"
}, },
"qr": { "qr": {
"qr_scan": "QR Scan", "qr_scan": "QR-koodi",
"open": "Open URL", "open": "Avaa URL",
"detected_url": "Detected URL" "detected_url": "Havaittu URL"
} }
} }

View File

@ -271,9 +271,11 @@ class ApplicationContainer extends Component {
}; };
//change app theme on the fly //change app theme on the fly
_appearanceChangeListener = ({ colorScheme }) => { _appearanceChangeListener = () => {
console.log('OS color scheme changed', colorScheme);
const { dispatch } = this.props; const { dispatch } = this.props;
//workaround for bug with Appearece package: https://github.com/facebook/react-native/issues/28525#issuecomment-841812810
const colorScheme = Appearance.getColorScheme();
getTheme().then((darkThemeSetting) => { getTheme().then((darkThemeSetting) => {
if (darkThemeSetting === null) { if (darkThemeSetting === null) {
dispatch(isDarkTheme(colorScheme === 'dark')); dispatch(isDarkTheme(colorScheme === 'dark'));

View File

@ -23,7 +23,6 @@ class NotificationContainer extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
notifications: [],
notificationsMap: new Map(), notificationsMap: new Map(),
lastNotificationId: null, lastNotificationId: null,
isRefreshing: true, isRefreshing: true,
@ -41,7 +40,7 @@ class NotificationContainer extends Component {
} }
} }
_getActivities = (type = 'activities', loadMore = false) => { _getActivities = (type = 'activities', loadMore = false, loadUnread = false) => {
const { lastNotificationId, endOfNotification, isLoading, notificationsMap } = this.state; const { lastNotificationId, endOfNotification, isLoading, notificationsMap } = this.state;
const since = loadMore ? lastNotificationId : null; const since = loadMore ? lastNotificationId : null;
@ -49,7 +48,7 @@ class NotificationContainer extends Component {
return; return;
} }
if (!endOfNotification || !loadMore) { if (!endOfNotification || !loadMore || loadUnread) {
this.setState({ this.setState({
isRefreshing: !loadMore, isRefreshing: !loadMore,
isLoading: true, isLoading: true,
@ -65,8 +64,12 @@ class NotificationContainer extends Component {
isLoading: false, isLoading: false,
}); });
} else { } else {
console.log('');
const stateNotifications = notificationsMap.get(type) || [];
const _notifications = loadMore const _notifications = loadMore
? unionBy(notificationsMap.get(type) || [], res, 'id') ? unionBy(stateNotifications, res, 'id')
: loadUnread
? unionBy(res, stateNotifications, 'id')
: res; : res;
notificationsMap.set(type, _notifications); notificationsMap.set(type, _notifications);
this.setState({ this.setState({
@ -133,7 +136,7 @@ class NotificationContainer extends Component {
_readAllNotification = () => { _readAllNotification = () => {
const { dispatch, intl, isConnected, currentAccount, pinCode } = this.props; const { dispatch, intl, isConnected, currentAccount, pinCode } = this.props;
const { notifications } = this.state; const { notificationsMap } = this.state;
if (!isConnected) { if (!isConnected) {
return; return;
@ -143,7 +146,11 @@ class NotificationContainer extends Component {
markNotifications() markNotifications()
.then(() => { .then(() => {
const updatedNotifications = notifications.map((item) => ({ ...item, read: 1 })); notificationsMap.forEach((notifications, key) => {
const updatedNotifications = notifications.map((item) => ({ ...item, read: 1 }));
notificationsMap.set(key, updatedNotifications);
});
dispatch(updateUnreadActivityCount(0)); dispatch(updateUnreadActivityCount(0));
markHiveNotifications(currentAccount, pinCode) markHiveNotifications(currentAccount, pinCode)
.then(() => { .then(() => {
@ -152,7 +159,7 @@ class NotificationContainer extends Component {
.catch((err) => { .catch((err) => {
bugsnapInstance.notify(err); bugsnapInstance.notify(err);
}); });
this.setState({ notifications: updatedNotifications, isRefreshing: false }); this.setState({ notificationsMap, isRefreshing: false });
}) })
.catch(() => { .catch(() => {
Alert.alert( Alert.alert(
@ -174,14 +181,25 @@ class NotificationContainer extends Component {
}; };
UNSAFE_componentWillReceiveProps(nextProps) { UNSAFE_componentWillReceiveProps(nextProps) {
const { selectedFilter } = this.state; const { selectedFilter, notificationsMap } = this.state;
const { currentAccount } = this.props; const { currentAccount } = this.props;
if ( if (currentAccount && nextProps.currentAccount) {
currentAccount && if (nextProps.currentAccount.name !== currentAccount.name) {
nextProps.currentAccount && this.setState(
nextProps.currentAccount.name !== currentAccount.name {
) { endOfNotification: false,
this.setState({ endOfNotification: false }, () => this._getActivities(selectedFilter)); notificationsMap: new Map(),
},
() => this._getActivities(selectedFilter),
);
} else if (
nextProps.currentAccount.unread_activity_count > currentAccount.unread_activity_count
) {
notificationsMap.forEach((value, key) => {
console.log('fetching new activities for ', key);
this._getActivities(key, false, true);
});
}
} }
} }

View File

@ -5,7 +5,7 @@ import { isRTL } from '../../../utils/I18nUtils';
export default EStyleSheet.create({ export default EStyleSheet.create({
cardContainer: { cardContainer: {
backgroundColor:'$primaryLightBackground', backgroundColor: '$primaryLightBackground',
marginVertical: 8, marginVertical: 8,
marginHorizontal: 16, marginHorizontal: 16,
borderRadius: 12, borderRadius: 12,
@ -14,37 +14,37 @@ export default EStyleSheet.create({
borderColor: "$primaryLightBackground", borderColor: "$primaryLightBackground",
} as ViewStyle, } as ViewStyle,
cardHeader:{ cardHeader: {
flexDirection:'row', flexDirection: 'row',
alignItems:'center', alignItems: 'center',
paddingHorizontal: 16, paddingHorizontal: 16,
paddingTop:16, paddingTop: 16,
} as ViewStyle, } as ViewStyle,
cardTitleContainer:{ cardTitleContainer: {
marginHorizontal: 8, marginHorizontal: 8,
flex:1, flex: 1,
} as ViewStyle, } as ViewStyle,
cardValuesContainer:{ cardValuesContainer: {
marginHorizontal: 8, marginHorizontal: 8,
justifyContent:'flex-end' justifyContent: 'flex-end'
} as ViewStyle, } as ViewStyle,
claimContainer:{ claimContainer: {
flexDirection:'row', flexDirection: 'row',
justifyContent:'center', justifyContent: 'center',
alignItems:'center', alignItems: 'center',
marginTop:8 marginTop: 8
} as ViewStyle, } as ViewStyle,
claimBtn:{ claimBtn: {
flexDirection: 'row', flexDirection: 'row',
paddingHorizontal: 16 paddingHorizontal: 16
} as ViewStyle, } as ViewStyle,
claimBtnTitle:{ claimBtnTitle: {
color: '$pureWhite', color: '$pureWhite',
fontSize: 14, fontSize: 14,
fontWeight: 'bold', fontWeight: 'bold',
@ -62,16 +62,16 @@ export default EStyleSheet.create({
height: 24, height: 24,
} as ViewStyle, } as ViewStyle,
logo:{ logo: {
height:24, height: 24,
width:24, width: 24,
borderRadius:12, borderRadius: 12,
backgroundColor:'$primaryBlue', backgroundColor: '$primaryBlue',
} as ImageStyle, } as ImageStyle,
menuIcon:{ menuIcon: {
color: '$primaryBlue', color: '$primaryBlue',
paddingLeft:12, paddingLeft: 12,
} as ViewStyle, } as ViewStyle,
header: { header: {
@ -80,52 +80,56 @@ export default EStyleSheet.create({
dotStyle: { dotStyle: {
backgroundColor: '$primaryDarkText', backgroundColor: '$primaryDarkText',
}, },
chartContainer:{ chartContainer: {
height:112, height: 112,
}, },
cardFooter:{ cardFooter: {
position:'absolute', position: 'absolute',
bottom:8, bottom: 8,
left: isRTL() ? 16 : 76, left: isRTL() ? 16 : 76,
right: isRTL() ? 76 : 16, right: isRTL() ? 76 : 16,
paddingTop:8, paddingTop: 8,
flexDirection: isRTL() ? "row-reverse" : "row", flexDirection: isRTL() ? "row-reverse" : "row",
justifyContent:'space-between', justifyContent: 'space-between',
borderColor:'$chartText', borderColor: '$chartText',
borderTopWidth:EStyleSheet.hairlineWidth, borderTopWidth: EStyleSheet.hairlineWidth,
} as ViewStyle, } as ViewStyle,
textDiffPositive:{ textDiffPositive: {
fontSize:18, fontSize: 18,
color: '$primaryGreen', color: '$primaryGreen',
textAlign: 'left', textAlign: 'left',
} as TextStyle, } as TextStyle,
textDiffNegative:{ textDiffNegative: {
fontSize:16, fontSize: 16,
color: '$primaryRed', color: '$primaryRed',
textAlign: 'left', textAlign: 'left',
} as TextStyle, } as TextStyle,
textCurValue:{ textCurValue: {
fontSize:16, fontSize: 16,
color: '$primaryBlack', color: '$primaryBlack',
fontWeight: '300', fontWeight: '300',
textAlign: 'left', textAlign: 'left',
} as TextStyle, } as TextStyle,
textTitle:{ textTitle: {
fontSize:16, fontSize: 16,
color: '$primaryBlack', color: '$primaryBlack',
fontWeight: '500', fontWeight: '500',
textAlign: 'left', textAlign: 'left',
}, },
textSubtitle:{ textSubtitle: {
fontSize:14, fontSize: 14,
color: '$primaryDarkText', color: '$primaryDarkText',
fontWeight: '300', fontWeight: '300',
textAlign: 'left', textAlign: 'left',
} as TextStyle, } as TextStyle,
textSubtitleRight:{ textSubtitleRight: {
fontSize:14, fontSize: 14,
color: '$primaryDarkText', color: '$primaryDarkText',
fontWeight: '300', fontWeight: '300',
textAlign:'right' textAlign: 'right'
} as TextStyle } as TextStyle,
}); claimActivityIndicator: {
marginLeft: 16
} as ViewStyle
});

View File

@ -1,4 +1,4 @@
import { View, Text, Dimensions, TouchableOpacity } from 'react-native'; import { View, Text, Dimensions, TouchableOpacity, ActivityIndicator } from 'react-native';
import React, { ComponentType, Fragment, useEffect, useState } from 'react'; import React, { ComponentType, Fragment, useEffect, useState } from 'react';
import styles from './children.styles'; import styles from './children.styles';
import { Icon, MainButton, SimpleChart } from '../../../components'; import { Icon, MainButton, SimpleChart } from '../../../components';
@ -18,6 +18,7 @@ export interface CoinCardProps {
unclaimedRewards: string; unclaimedRewards: string;
enableBuy?: boolean; enableBuy?: boolean;
isClaiming?: boolean; isClaiming?: boolean;
isLoading?: boolean;
footerComponent: ComponentType<any> footerComponent: ComponentType<any>
onCardPress: () => void; onCardPress: () => void;
onClaimPress: () => void; onClaimPress: () => void;
@ -37,6 +38,7 @@ export const CoinCard = ({
unclaimedRewards, unclaimedRewards,
enableBuy, enableBuy,
isClaiming, isClaiming,
isLoading,
onCardPress, onCardPress,
onClaimPress, onClaimPress,
}: CoinCardProps) => { }: CoinCardProps) => {
@ -83,11 +85,20 @@ export const CoinCard = ({
const btnTitle = unclaimedRewards const btnTitle = unclaimedRewards
? unclaimedRewards ? unclaimedRewards
: intl.formatMessage({ id: `wallet.${id}.buy` }); : intl.formatMessage({ id: `wallet.${id}.buy` });
const _rightComponent = isLoading ? (
<ActivityIndicator color={EStyleSheet.value('$pureWhite')} style={styles.claimActivityIndicator} />
) : (
<View style={styles.claimIconWrapper}>
<Icon name="add" iconType="MaterialIcons" color={EStyleSheet.value('$primaryBlue')} size={23} />
</View>
)
return ( return (
<View style={styles.claimContainer}> <View style={styles.claimContainer}>
<MainButton <MainButton
isLoading={isClaiming && claimExpected} isLoading={isClaiming && claimExpected}
isDisable={isClaiming && claimExpected} isDisable={isLoading || (isClaiming && claimExpected)}
style={styles.claimBtn} style={styles.claimBtn}
height={50} height={50}
onPress={_onClaimPress} onPress={_onClaimPress}
@ -96,9 +107,7 @@ export const CoinCard = ({
<Text style={styles.claimBtnTitle}> <Text style={styles.claimBtnTitle}>
{btnTitle} {btnTitle}
</Text> </Text>
<View style={styles.claimIconWrapper}> {_rightComponent}
<Icon name="add" iconType="MaterialIcons" color={EStyleSheet.value('$primaryBlue')} size={23} />
</View>
</Fragment> </Fragment>
</MainButton> </MainButton>
</View> </View>

View File

@ -69,7 +69,10 @@ const WalletScreen = ({navigation}) => {
//side-effects //side-effects
useEffect(()=>{ useEffect(()=>{
AppState.addEventListener('change', _handleAppStateChange); AppState.addEventListener('change', _handleAppStateChange);
_fetchData();
//if coinsData is empty, initilise wallet without a fresh acount fetch
_fetchData(Object.keys(coinsData).length?true:false);
return _cleanup; return _cleanup;
},[]) },[])
@ -229,6 +232,7 @@ const WalletScreen = ({navigation}) => {
unclaimedRewards={coinData.unclaimedBalance} unclaimedRewards={coinData.unclaimedBalance}
enableBuy={!coinData.unclaimedBalance && item.id === COIN_IDS.ECENCY} enableBuy={!coinData.unclaimedBalance && item.id === COIN_IDS.ECENCY}
isClaiming={isClaiming} isClaiming={isClaiming}
isLoading={isLoading}
onCardPress={_onCardPress} onCardPress={_onCardPress}
onClaimPress={_onClaimPress} onClaimPress={_onClaimPress}
footerComponent={index === 0 && <HorizontalIconList options={POINTS} optionsKeys={POINTS_KEYS} />} footerComponent={index === 0 && <HorizontalIconList options={POINTS} optionsKeys={POINTS_KEYS} />}