Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • benhayward.ben/mobile-native
  • minds/mobile-native
  • msantang78/mobile-native
  • edgebal/mobile-native
  • msantang78_test/mobile-native
  • duyquoc/mobile-native
  • priestd09/mobile-native
  • eiennohi/mobile-native
  • omadrid/mobile-native
  • sieuhuflit/mobile-native
  • juanmsolaro/mobile-native
  • ascenderking/mobile-native
  • jim-toth/mobile-native
  • thinnakrit/mobile-native-lang
  • project_connection/mobile-native
  • AaronTheBruce/mobile-native
  • cormac.kantargis.hack/mobile-native
  • xthread/mobile-native
  • Paulnguyenun/mobile-native
  • lustigdev/mobile-native
  • GubbenOlsson/mobile-native
  • calvinoea/mobile-native
  • namesty/mobile-native
  • mrrobot16/mobile-native
  • eliobricenov/mobile-native
  • bedriguler/mobile-native
  • m994/mobile-native
  • threetoes/mobile-native
  • liangel/mobile-native
  • hosituan/mobile-native
  • nacef.otay/mobile-native
  • madibaa/mobile-native
  • valentin129/mobile-native
  • manishoo/mobile-native1
34 results
Show changes
......@@ -238,6 +238,7 @@
"report":"Report",
"createFirstPost":"Create your first post",
"blocked":"You have blocked @{{username}}",
"blockedNav":"You have blocked &{username}&",
"tapUnblock":"Tap to unblock",
"notFound":"Channel not found",
"viewScheduled":"Scheduled",
......@@ -783,5 +784,6 @@
"showingStored":"Showing stored data",
"actions":"Actions",
"requests":"Requests",
"notAllowed":"You are not allowed"
"notAllowed":"You are not allowed",
"undo":"Undo"
}
......@@ -189,6 +189,7 @@
"confirmUnsubscribe": "Estás seguro que quieres desuscribirte de este canal? ",
"subscribed": "Suscrito",
"blocked": "Has bloqueado a @{{username}}",
"blockedNav":"Has bloqueado a &{username}&",
"tapUnblock": "Pulsa para desbloquear",
"notFound": "Canal no encontrado",
"viewScheduled": "Agendado"
......@@ -767,5 +768,6 @@
"showingStored": "Mostrando datos guardados",
"enableComments": "Activar comentarios",
"disableComments": "Desactivar comentarios",
"more": "Más"
"more": "Más",
"undo":"Deshacer"
}
\ No newline at end of file
import React, {Component} from 'react';
import {Text, StyleSheet, View} from 'react-native';
import {CommonStyle} from '../../styles/Common';
import Colors from '../../styles/Colors';
import i18n from '../services/i18n.service';
import { TouchableOpacity } from 'react-native-gesture-handler';
export default class BlockedChannel extends Component {
/**
* Navigate To channel
*/
navToChannel = () => {
// only active if receive the navigation property
if (this.props.navigation) {
this.props.navigation.push('Channel', {
guid: this.props.entity.ownerObj.guid,
});
}
};
render() {
return (
<View style={[styles.container, CommonStyle.hairLineBottom]}>
<View style={[CommonStyle.flexContainerCenter, styles.insideBox]}>
<Text style={styles.text}>
{i18n.to('channel.blockedNav', null, {
username: (
<Text style={styles.username} onPress={this.navToChannel}>
@{this.props.entity.ownerObj.username}
</Text>
),
})}
</Text>
<TouchableOpacity
onPress={async () => {
await this.props.entity.unblockOwner();
}}>
<Text style={styles.textUndo}>{i18n.t('undo')}</Text>
</TouchableOpacity>
</View>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
overflow: 'visible',
height: 150,
backgroundColor: Colors.lightGreyed,
padding: 5,
},
insideBox: {
borderStyle: 'solid',
borderColor: Colors.darkGreyed,
borderWidth: 0.5,
alignItems: 'center',
},
text: {
color: Colors.darkGreyed,
},
username: {
fontWeight: 'bold',
},
textUndo: {
color: Colors.darkGreyed,
marginTop: 20,
fontWeight: 'bold',
}
});
......@@ -2,10 +2,11 @@ import apiService from "./api.service";
import sessionService from "./session.service";
import storageService from "./storage.service";
import logService from "./log.service";
import {observable, action} from 'mobx';
export class BlockListService {
blocked: Map = new Map();
@observable blocked: Map = new Map();
constructor() {
sessionService.onSession(async (token) => {
......@@ -53,11 +54,13 @@ export class BlockListService {
return this.blocked;
}
@action
async add(guid: string) {
this.blocked.set( guid );
storageService.setItem('@minds:blocked', this.blocked.keys());
}
@action
async remove(guid: string) {
this.blocked.delete(guid);
storageService.setItem('@minds:blocked', this.blocked.keys());
......
......@@ -33,6 +33,7 @@ import Pinned from '../../common/components/Pinned';
import blockListService from '../../common/services/block-list.service';
import i18n from '../../common/services/i18n.service';
import ActivityModel from '../ActivityModel';
import BlockedChannel from '../../common/components/BlockedChannel';
/**
* Activity
......@@ -71,6 +72,11 @@ export default class Activity extends Component {
*/
render() {
const entity = ActivityModel.checkOrCreate(this.props.entity);
if (blockListService.blocked.has(entity.ownerObj.guid)) {
return (<BlockedChannel entity={entity} navigation={this.props.navigation}/>);
}
const hasText = !!entity.text;
const lock = (entity.paywall && entity.paywall !== '0')? <Lock entity={entity} navigation={this.props.navigation}/> : null;
......