Merge branch 'master' of github.com:esteemapp/esteem-mobile

This commit is contained in:
Mustafa Buyukcelebi 2019-04-01 20:34:24 +03:00
commit 9a3b5b0399
8 changed files with 41 additions and 19 deletions

View File

@ -35,6 +35,7 @@ class NotificationView extends PureComponent {
{ key: 'mentions', value: 'MENTIONS' }, { key: 'mentions', value: 'MENTIONS' },
{ key: 'follows', value: 'FOLLOWS' }, { key: 'follows', value: 'FOLLOWS' },
{ key: 'reblogs', value: 'REBLOGS' }, { key: 'reblogs', value: 'REBLOGS' },
{ key: 'transfers', value: 'TRANSFERS' },
], ],
selectedFilter: null, selectedFilter: null,
}; };
@ -45,10 +46,11 @@ class NotificationView extends PureComponent {
// Component Functions // Component Functions
_handleOnDropdownSelect = (index) => { _handleOnDropdownSelect = (index) => {
const { getActivities } = this.props; const { getActivities, changeSelectedFilter } = this.props;
const { filters } = this.state; const { filters } = this.state;
this.setState({ selectedFilter: filters[index].key }); this.setState({ selectedFilter: filters[index].key });
changeSelectedFilter(filters[index].key);
getActivities(filters[index].key, false); getActivities(filters[index].key, false);
}; };

View File

@ -58,19 +58,19 @@
}, },
"settings": { "settings": {
"settings": "Pengaturan", "settings": "Pengaturan",
"general": "General", "general": "Umum",
"currency": "Nilai Tukar Mata Uang", "currency": "Nilai Tukar Mata Uang",
"language": "Bahasa", "language": "Bahasa",
"server": "Server", "server": "Server",
"dark_theme": "Tema Gelap", "dark_theme": "Tema Gelap",
"push_notification": "Notifikasi Gegas", "push_notification": "Notifikasi Gegas",
"notification": { "notification": {
"follow": "Follow", "follow": "Ikuti",
"vote": "Vote", "vote": "Berikan dukungan suara",
"comment": "Comment", "comment": "Komentar",
"mention": "Mention", "mention": "Menyebutkan",
"reblog": "Reblog", "reblog": "Reblog",
"transfers": "Transfers" "transfers": "Transfer"
}, },
"pincode": "Kode PIN", "pincode": "Kode PIN",
"reset": "Setel Ulang", "reset": "Setel Ulang",

View File

@ -58,19 +58,19 @@
}, },
"settings": { "settings": {
"settings": "Configurações", "settings": "Configurações",
"general": "General", "general": "Geral",
"currency": "Moeda", "currency": "Moeda",
"language": "Língua", "language": "Língua",
"server": "Servidor", "server": "Servidor",
"dark_theme": "Tema Escuro", "dark_theme": "Tema Escuro",
"push_notification": "Puxar Notificações", "push_notification": "Puxar Notificações",
"notification": { "notification": {
"follow": "Follow", "follow": "Seguir",
"vote": "Vote", "vote": "Votar",
"comment": "Comment", "comment": "Comentar",
"mention": "Mention", "mention": "Menção",
"reblog": "Reblog", "reblog": "Republicar",
"transfers": "Transfers" "transfers": "Transferências"
}, },
"pincode": "Código PIN", "pincode": "Código PIN",
"reset": "Reiniciar", "reset": "Reiniciar",

View File

@ -144,6 +144,9 @@ export const getActivities = data => new Promise((resolve, reject) => {
case 'reblogs': case 'reblogs':
url = `/reblogs/${data.user}`; url = `/reblogs/${data.user}`;
break; break;
case 'transfers':
url = `/transfers/${data.user}`;
break;
default: default:
url = `/activities/${data.user}`; url = `/activities/${data.user}`;
break; break;

View File

@ -19,6 +19,7 @@ class NotificationContainer extends Component {
lastNotificationId: null, lastNotificationId: null,
notificationLoading: false, notificationLoading: false,
readAllNotificationLoading: false, readAllNotificationLoading: false,
selectedFilter: 'activities',
}; };
} }
@ -31,8 +32,10 @@ class NotificationContainer extends Component {
} }
componentWillReceiveProps(nextProps) { componentWillReceiveProps(nextProps) {
const { selectedFilter } = this.state;
if (nextProps.activeBottomTab === ROUTES.TABBAR.NOTIFICATION && nextProps.username) { if (nextProps.activeBottomTab === ROUTES.TABBAR.NOTIFICATION && nextProps.username) {
this._getAvtivities(); this._getAvtivities(selectedFilter);
} }
} }
@ -81,7 +84,7 @@ class NotificationContainer extends Component {
}; };
} else if (data.type === 'transfer') { } else if (data.type === 'transfer') {
routeName = ROUTES.TABBAR.PROFILE; routeName = ROUTES.TABBAR.PROFILE;
params = { isWalletTab: true }; params = { activePage: 2 };
} }
navigation.navigate({ navigation.navigate({
@ -110,6 +113,10 @@ class NotificationContainer extends Component {
navigation.navigate(ROUTES.SCREENS.LOGIN); navigation.navigate(ROUTES.SCREENS.LOGIN);
}; };
_changeSelectedFilter = (value) => {
this.setState({ selectedFilter: value });
};
render() { render() {
const { isLoggedIn } = this.props; const { isLoggedIn } = this.props;
const { const {
@ -130,6 +137,7 @@ class NotificationContainer extends Component {
notificationLoading={notificationLoading} notificationLoading={notificationLoading}
readAllNotificationLoading={readAllNotificationLoading} readAllNotificationLoading={readAllNotificationLoading}
isLoggedIn={isLoggedIn} isLoggedIn={isLoggedIn}
changeSelectedFilter={this._changeSelectedFilter}
/> />
); );
} }

View File

@ -31,6 +31,7 @@ class NotificationScreen extends PureComponent {
isLoggedIn, isLoggedIn,
notificationLoading, notificationLoading,
readAllNotificationLoading, readAllNotificationLoading,
changeSelectedFilter,
} = this.props; } = this.props;
return ( return (
@ -56,6 +57,7 @@ class NotificationScreen extends PureComponent {
readAllNotification={readAllNotification} readAllNotification={readAllNotification}
readAllNotificationLoading={readAllNotificationLoading} readAllNotificationLoading={readAllNotificationLoading}
loading={notificationLoading} loading={notificationLoading}
changeSelectedFilter={changeSelectedFilter}
/> />
) : ( ) : (
<NoPost <NoPost

View File

@ -329,7 +329,10 @@ class ProfileContainer extends Component {
user, user,
username, username,
} = this.state; } = this.state;
const { isDarkTheme, isLoggedIn, currency } = this.props; const {
isDarkTheme, isLoggedIn, currency, navigation,
} = this.props;
const activePage = (navigation.state.params && navigation.state.params.activePage) || 0;
return ( return (
<ProfileScreen <ProfileScreen
@ -356,6 +359,7 @@ class ProfileContainer extends Component {
selectedQuickProfile={selectedQuickProfile} selectedQuickProfile={selectedQuickProfile}
selectedUser={user} selectedUser={user}
username={username} username={username}
activePage={activePage}
/> />
); );
} }

View File

@ -83,6 +83,7 @@ class ProfileScreen extends PureComponent {
selectedQuickProfile, selectedQuickProfile,
selectedUser, selectedUser,
username, username,
activePage,
} = this.props; } = this.props;
const { const {
@ -118,8 +119,9 @@ class ProfileScreen extends PureComponent {
if (estimatedWalletValue) { if (estimatedWalletValue) {
const { currencyRate, currencySymbol } = currency; const { currencyRate, currencySymbol } = currency;
_estimatedWalletValue = `${currencySymbol} ${(estimatedWalletValue * currencyRate).toFixed( _estimatedWalletValue = `${currencySymbol} ${(
)}`; estimatedWalletValue * currencyRate
).toFixed()}`;
} }
return ( return (
@ -177,6 +179,7 @@ class ProfileScreen extends PureComponent {
<ScrollableTabView <ScrollableTabView
style={[globalStyles.tabView, styles.tabView]} style={[globalStyles.tabView, styles.tabView]}
initialPage={activePage}
renderTabBar={() => ( renderTabBar={() => (
<TabBar style={styles.tabbar} tabUnderlineDefaultWidth={80} tabUnderlineScaleX={2} /> <TabBar style={styles.tabbar} tabUnderlineDefaultWidth={80} tabUnderlineScaleX={2} />
)} )}