details for tablet layout

This commit is contained in:
Roland Osborne 2023-09-25 16:42:46 -07:00
parent fa2927d5ba
commit 35453fc678
9 changed files with 31 additions and 101 deletions

View File

@ -9,6 +9,7 @@ const LightColors = {
activeBorder: '#338866', activeBorder: '#338866',
idleBorder: '#dddddd', idleBorder: '#dddddd',
activeFill: '#66aa88', activeFill: '#66aa88',
idleFill: '#888888',
linkText: '#338866', linkText: '#338866',
dangerText: '#ff8888', dangerText: '#ff8888',
labelText: '#555555', labelText: '#555555',
@ -69,6 +70,7 @@ const DarkColors = {
activeBorder: '#aaaaaa', activeBorder: '#aaaaaa',
idleBorder: '#eeeeee', idleBorder: '#eeeeee',
activeFill: '#559955', activeFill: '#559955',
idleFill: '#888888',
linkText: '#88eecc', linkText: '#88eecc',
dangerText: '#ffaaaa', dangerText: '#ffaaaa',
labelText: '#eeeeee', labelText: '#eeeeee',
@ -132,6 +134,7 @@ export const Colors = {
idleBorder: getColor('idleBorder'), idleBorder: getColor('idleBorder'),
activeBorder: getColor('activeBorder'), activeBorder: getColor('activeBorder'),
activeFill: getColor('activeFill'), activeFill: getColor('activeFill'),
idleFill: getColor('idleFill'),
linkText: getColor('linkText'), linkText: getColor('linkText'),
dangerText: getColor('dangerText'), dangerText: getColor('dangerText'),
labelText: getColor('labelText'), labelText: getColor('labelText'),

View File

@ -142,6 +142,7 @@ const Strings = [
deleteTopic: 'Delete Topic', deleteTopic: 'Delete Topic',
blockTopic: 'Block Topic', blockTopic: 'Block Topic',
reportTopic: 'Report Topic', reportTopic: 'Report Topic',
unknown: 'unknown',
}, },
{ {
visibleRegistry: 'Visible dans le Registre', visibleRegistry: 'Visible dans le Registre',
@ -280,6 +281,7 @@ const Strings = [
deleteTopic: 'Supprimer le Sujet', deleteTopic: 'Supprimer le Sujet',
blockTopic: 'Bloquer le Sujet', blockTopic: 'Bloquer le Sujet',
reportTopic: 'Signaler le Sujet', reportTopic: 'Signaler le Sujet',
unknown: 'Inconnu',
}, },
{ {
visibleRegistry: 'Visible en el Registro', visibleRegistry: 'Visible en el Registro',
@ -418,6 +420,7 @@ const Strings = [
deleteTopic: 'Borrar el Tema', deleteTopic: 'Borrar el Tema',
blockTopic: 'Bloquer el Tema', blockTopic: 'Bloquer el Tema',
reportTopic: 'Reportar el Tema', reportTopic: 'Reportar el Tema',
unknown: 'Desconocido',
}, },
{ {
visibleRegistry: 'Sichtbar in der Registrierung', visibleRegistry: 'Sichtbar in der Registrierung',
@ -556,6 +559,7 @@ const Strings = [
deleteTopic: 'Das Thema Löschen', deleteTopic: 'Das Thema Löschen',
blockTopic: 'Blockiere das Thema', blockTopic: 'Blockiere das Thema',
reportTopic: 'Das Thema Melden', reportTopic: 'Das Thema Melden',
unknown: 'Unbekannt',
} }
]; ];

View File

@ -30,6 +30,7 @@ import { Call } from './call/Call';
import { Sharing } from './sharing/Sharing'; import { Sharing } from './sharing/Sharing';
import splash from 'images/session.png'; import splash from 'images/session.png';
import { useNavigate } from 'react-router-dom'; import { useNavigate } from 'react-router-dom';
import { getLanguageStrings } from 'constants/Strings';
const ConversationStack = createStackNavigator(); const ConversationStack = createStackNavigator();
const ProfileStack = createStackNavigator(); const ProfileStack = createStackNavigator();
@ -180,6 +181,7 @@ function ContactStackScreen({ addChannel }) {
function HomeScreen({ navParams }) { function HomeScreen({ navParams }) {
const strings = getLanguageStrings();
const drawerParams = { drawerPosition: 'right', headerShown: false, swipeEnabled: false, drawerType: 'front' }; const drawerParams = { drawerPosition: 'right', headerShown: false, swipeEnabled: false, drawerType: 'front' };
const conversation = useContext(ConversationContext); const conversation = useContext(ConversationContext);
const [channel, setChannel] = useState(false); const [channel, setChannel] = useState(false);
@ -222,13 +224,13 @@ function HomeScreen({ navParams }) {
<View style={styles.home}> <View style={styles.home}>
<SafeAreaView edges={['top', 'bottom', 'left']} style={styles.sidebar}> <SafeAreaView edges={['top', 'bottom', 'left']} style={styles.sidebar}>
<View edges={['left']} style={styles.options}> <View edges={['left']} style={styles.options}>
<TouchableOpacity style={styles.option} onPress={openProfile}> <TouchableOpacity style={styles.option} onPress={openProfile} activeOpacity={1}>
<ProfileIcon color={Colors.text} size={24} /> <ProfileIcon color={Colors.text} size={24} />
<Text style={styles.profileLabel}>Profile</Text> <Text style={styles.profileLabel}>{ strings.account }</Text>
</TouchableOpacity> </TouchableOpacity>
<TouchableOpacity style={styles.option} onPress={openCards}> <TouchableOpacity style={styles.option} onPress={openCards} activeOpacity={1}>
<CardsIcon color={Colors.text} size={24} /> <CardsIcon color={Colors.text} size={24} />
<Text style={styles.profileLabel}>Contacts</Text> <Text style={styles.profileLabel}>{ strings.contacts }</Text>
</TouchableOpacity> </TouchableOpacity>
</View> </View>
<View style={styles.channels}> <View style={styles.channels}>

View File

@ -80,6 +80,7 @@ export const styles = StyleSheet.create({
trigger: { trigger: {
triggerTouchable: { triggerTouchable: {
activeOpacity: 70, activeOpacity: 70,
underlayColor: Colors.screenBase,
}, },
}, },
options: { options: {

View File

@ -81,91 +81,10 @@ export function Details({ channel, clearConversation }) {
}); });
} }
const remove = () => {
Alert.alert(
"Removing Topic",
"Confirm?",
[
{ text: "Cancel",
onPress: () => {},
},
{ text: "Remove",
onPress: async () => {
try {
await actions.remove();
clearConversation();
}
catch (err) {
console.log(err);
Alert.alert(
'Failed to Delete Topic',
'Please try again.'
)
}
},
}
]
);
}
const block = () => {
Alert.alert(
"Blocking Topic",
"Confirm?",
[
{ text: "Cancel",
onPress: () => {},
},
{ text: "Block",
onPress: async () => {
try {
await actions.block();
clearConversation();
}
catch (err) {
console.log(err);
Alert.alert(
'Failed to Block Topic',
'Please try again.'
)
}
},
}
]
);
}
const report = () => {
Alert.alert(
"Report Topic",
"Confirm?",
[
{ text: "Cancel",
onPress: () => {},
},
{ text: "Report",
onPress: async () => {
try {
await actions.report();
}
catch (err) {
console.log(err);
Alert.alert(
'Failed to Report Topic',
'Please try again.'
)
}
},
}
]
);
}
return ( return (
<View style={styles.body}> <View style={styles.body}>
<View style={styles.details}> <View style={styles.details}>
<Logo src={state.logo} width={72} height={72} radius={8} /> <Logo src={state.logo} width={92} height={92} radius={8} />
<View style={styles.info}> <View style={styles.info}>
<View style={styles.subject}> <View style={styles.subject}>
{ state.locked && !state.unlocked && ( { state.locked && !state.unlocked && (
@ -192,7 +111,8 @@ export function Details({ channel, clearConversation }) {
<Text style={styles.notifyText}>{ state.strings.enableNotifications }</Text> <Text style={styles.notifyText}>{ state.strings.enableNotifications }</Text>
</TouchableOpacity> </TouchableOpacity>
{ state.notification != null && ( { state.notification != null && (
<Switch style={styles.switch} value={state.notification} onValueChange={setNotifications} trackColor={styles.track}/> <Switch value={state.notification} style={Platform.OS==='ios' ? styles.visibleSwitch : {}} thumbColor={Colors.sliderGrip}
ios_backgroundColor={Colors.idleFill} trackColor={styles.track} onValueChange={setNotifications} />
)} )}
</View> </View>
</View> </View>
@ -236,7 +156,7 @@ export function Details({ channel, clearConversation }) {
<View style={styles.members}> <View style={styles.members}>
<Text style={styles.membersLabel}>{ state.strings.members }</Text> <Text style={styles.membersLabel}>{ state.strings.members }</Text>
{ state.count - state.members.length > 0 && ( { state.count - state.members.length > 0 && (
<Text style={styles.unknown}> (+ {state.count - state.contacts.length} unknown)</Text> <Text style={styles.unknown}> (+ {state.count - state.contacts.length}) { state.strings.unknown }</Text>
)} )}
</View> </View>

View File

@ -80,7 +80,7 @@ export const styles = StyleSheet.create({
paddingTop: 24, paddingTop: 24,
width: '100%', width: '100%',
borderBottomWidth: 1, borderBottomWidth: 1,
borderColor: Colors.divider, borderColor: Colors.itemDivider,
display: 'flex', display: 'flex',
flexDirection: 'row', flexDirection: 'row',
backgroundColor: Colors.screenBase, backgroundColor: Colors.screenBase,
@ -183,13 +183,6 @@ export const styles = StyleSheet.create({
fontSize: 16, fontSize: 16,
color: Colors.text, color: Colors.text,
}, },
track: {
false: Colors.grey,
true: Colors.background,
},
switch: {
transform: [{ scaleX: .7 }, { scaleY: .7 }],
},
modalOverlay: { modalOverlay: {
width: '100%', width: '100%',
height: '100%', height: '100%',
@ -215,7 +208,7 @@ export const styles = StyleSheet.create({
}, },
close: { close: {
borderWidth: 1, borderWidth: 1,
borderColor: Colors.lightgrey, borderColor: Colors.closeButton,
borderRadius: 4, borderRadius: 4,
padding: 8, padding: 8,
marginRight: 8, marginRight: 8,
@ -224,7 +217,7 @@ export const styles = StyleSheet.create({
alignItems: 'center', alignItems: 'center',
}, },
closeText: { closeText: {
color: Colors.cancelButtonText, color: Colors.closeButtonText,
}, },
field: { field: {
input: { input: {
@ -283,4 +276,11 @@ export const styles = StyleSheet.create({
color: Colors.linkText, color: Colors.linkText,
fontSize: 10, fontSize: 10,
}, },
track: {
false: Colors.idleFill,
true: Colors.activeFill,
},
visibleSwitch: {
transform: [{ scaleX: .6 }, { scaleY: .6 }],
},
}) })

View File

@ -50,7 +50,7 @@ export function useDetails(clear) {
const notification = await conversation.actions.getNotifications(); const notification = await conversation.actions.getNotifications();
updateState({ notification }); updateState({ notification });
})(); })();
}, []); }, [conversation.state.card, conversation.state.channel]);
useEffect(() => { useEffect(() => {
let locked; let locked;

View File

@ -121,7 +121,7 @@ export function Profile({ drawer }) {
<Text style={styles.visibleLabel}>{ state.strings.visibleRegistry }</Text> <Text style={styles.visibleLabel}>{ state.strings.visibleRegistry }</Text>
</TouchableOpacity> </TouchableOpacity>
<Switch value={state.searchable} style={Platform.OS==='ios' ? styles.visibleSwitch : {}} thumbColor={Colors.sliderGrip} <Switch value={state.searchable} style={Platform.OS==='ios' ? styles.visibleSwitch : {}} thumbColor={Colors.sliderGrip}
ios_backgroundColor={Colors.disabledIndicator} trackColor={styles.track} onValueChange={setVisible} /> ios_backgroundColor={Colors.idleFill} trackColor={styles.track} onValueChange={setVisible} />
</TouchableOpacity> </TouchableOpacity>
</View> </View>
)} )}

View File

@ -173,7 +173,7 @@ export function Settings({ drawer }) {
<TouchableOpacity activeOpacity={1} onPress={() => setNotifications(!state.pushEnabled)}> <TouchableOpacity activeOpacity={1} onPress={() => setNotifications(!state.pushEnabled)}>
<Text style={styles.optionText}>{ state.strings.enableNotifications }</Text> <Text style={styles.optionText}>{ state.strings.enableNotifications }</Text>
</TouchableOpacity> </TouchableOpacity>
<Switch value={state.pushEnabled} style={Platform.OS==='ios' ? styles.notifications : {}} thumbColor={Colors.sliderGrip} ios_backgroundColor={Colors.disabledIndicator} <Switch value={state.pushEnabled} style={Platform.OS==='ios' ? styles.notifications : {}} thumbColor={Colors.sliderGrip} ios_backgroundColor={Colors.idleFill}
trackColor={styles.track} onValueChange={setNotifications} /> trackColor={styles.track} onValueChange={setNotifications} />
</View> </View>
</TouchableOpacity> </TouchableOpacity>