Skip to content

Commit

Permalink
Merge 31e20a7 into 4745a3a
Browse files Browse the repository at this point in the history
  • Loading branch information
alexrisch authored Oct 28, 2024
2 parents 4745a3a + 31e20a7 commit 3bfa536
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 35 deletions.
10 changes: 5 additions & 5 deletions components/Chat/ChatPlaceholder/ChatPlaceholder.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Button } from "@design-system/Button/Button";
import { translate } from "@i18n";
import { actionSheetColors, textPrimaryColor } from "@styles/colors";
import { isGroupTopic } from "@utils/groupUtils/groupId";
Expand All @@ -23,7 +24,6 @@ import { getProfile, getProfileData } from "../../../utils/profile";
import { conversationName } from "../../../utils/str";
import { consentToPeersOnProtocol } from "../../../utils/xmtpRN/conversations";
import ActivityIndicator from "../../ActivityIndicator/ActivityIndicator";
import Button from "../../Button/Button";
import { Recommendation } from "../../Recommendations/Recommendation";
import { showActionSheetWithOptions } from "../../StateHandlers/ActionSheetStateHandler";

Expand Down Expand Up @@ -78,9 +78,9 @@ export default function ChatPlaceholder({ messagesCount }: Props) {
<View>
<Text style={styles.chatPlaceholderText}>This user is blocked</Text>
<Button
variant="secondary"
variant="fill"
picto="lock.open"
title="Unblock"
text="Unblock"
style={styles.cta}
onPress={() => {
showActionSheetWithOptions(
Expand Down Expand Up @@ -124,9 +124,9 @@ export default function ChatPlaceholder({ messagesCount }: Props) {
)}

<Button
variant="secondary"
variant="fill"
picto="hand.wave"
title="Say hi"
text="Say hi"
style={styles.cta}
onPress={() => {
sendMessage({
Expand Down
6 changes: 3 additions & 3 deletions components/Chat/ChatPlaceholder/GroupChatPlaceholder.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Button } from "@design-system/Button/Button";
import { useGroupMembers } from "@hooks/useGroupMembers";
import { useGroupName } from "@hooks/useGroupName";
import { translate } from "@i18n";
Expand All @@ -19,7 +20,6 @@ import { useCurrentAccount } from "../../../data/store/accountsStore";
import { useConversationContext } from "../../../utils/conversation";
import { sendMessage } from "../../../utils/message";
import ActivityIndicator from "../../ActivityIndicator/ActivityIndicator";
import Button from "../../Button/Button";

type Props = {
messagesCount: number;
Expand Down Expand Up @@ -93,9 +93,9 @@ export function GroupChatPlaceholder({ messagesCount }: Props) {
</Text>

<Button
variant="outline"
variant="fill"
picto="hand.wave"
title={translate("say_hi")}
text={translate("say_hi")}
style={styles.cta}
onPress={handleSend}
/>
Expand Down
11 changes: 6 additions & 5 deletions components/Chat/ConsentPopup/ConsentPopup.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Button } from "@design-system/Button/Button";
import { translate } from "@i18n";
import { useNavigation } from "@react-navigation/native";
import { NativeStackNavigationProp } from "@react-navigation/native-stack";
Expand All @@ -17,7 +18,6 @@ import {
import { NavigationParamList } from "../../../screens/Navigation/Navigation";
import { useConversationContext } from "../../../utils/conversation";
import { consentToPeersOnProtocol } from "../../../utils/xmtpRN/conversations";
import Button from "../../Button/Button";
import { showActionSheetWithOptions } from "../../StateHandlers/ActionSheetStateHandler";

export default function ConsentPopup() {
Expand Down Expand Up @@ -59,9 +59,10 @@ export default function ConsentPopup() {
<Text style={styles.info}>{translate("do_you_trust_this_contact")}</Text>
<View style={styles.buttonsContainer}>
<Button
variant="secondary-danger"
variant="text"
action="danger"
picto="xmark"
title={translate("block")}
text={translate("block")}
style={styles.cta}
onPress={() => {
showActionSheetWithOptions(
Expand All @@ -87,9 +88,9 @@ export default function ConsentPopup() {
}}
/>
<Button
variant="secondary"
variant="fill"
picto="checkmark"
title={translate("accept")}
text={translate("accept")}
style={styles.cta}
onPress={() => {
if (!conversation.peerAddress) return;
Expand Down
8 changes: 4 additions & 4 deletions components/Chat/ConsentPopup/GroupConsentPopup.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { useSelect } from "@data/store/storeHelpers";
import { Button } from "@design-system/Button/Button";
import { useGroupConsent } from "@hooks/useGroupConsent";
import { useGroupCreator } from "@hooks/useGroupCreator";
import { useGroupMembers } from "@hooks/useGroupMembers";
Expand All @@ -17,7 +18,6 @@ import {
} from "../../../data/store/accountsStore";
import { NavigationParamList } from "../../../screens/Navigation/Navigation";
import { useConversationContext } from "../../../utils/conversation";
import Button from "../../Button/Button";

export function GroupConsentPopup() {
const conversation = useConversationContext("conversation");
Expand Down Expand Up @@ -92,14 +92,14 @@ export function GroupConsentPopup() {
<View style={styles.buttonsContainer}>
<Button
variant="text"
title={translate("decline")}
text={translate("decline")}
style={[styles.cta, styles.blockCta]}
onPress={onBlock}
/>
<Button
variant="secondary"
variant="fill"
picto="checkmark"
title={translate("join_this_group")}
text={translate("join_this_group")}
style={styles.cta}
onPress={onAccept}
/>
Expand Down
2 changes: 1 addition & 1 deletion design-system/Button/Button.props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export interface IButtonProps extends RNPressableProps {
*/
withHapticFeedback?: boolean;

/** @deprecated */
/** @deprecated - use text instead */
title?: string;
/** @deprecated */
picto?: IPicto;
Expand Down
4 changes: 4 additions & 0 deletions i18n/translations/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,10 @@ export const en = {
// Wallet selector
no_wallet_detected: "No wallet detected",

// Profile
view_removed_chats: "View removed chats",
change_or_add_account: "Change or add account",

// Revocation
current_installation_revoked: "Logged out",
current_installation_revoked_description:
Expand Down
25 changes: 11 additions & 14 deletions screens/NewConversation/NewConversation.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Button } from "@design-system/Button/Button";
import { NativeStackScreenProps } from "@react-navigation/native-stack";
import {
backgroundColor,
Expand All @@ -21,7 +22,6 @@ import {
import { NewConversationModalParams } from "./NewConversationModal";
import ActivityIndicator from "../../components/ActivityIndicator/ActivityIndicator";
import AndroidBackAction from "../../components/AndroidBackAction";
import ConverseButton from "../../components/Button/Button";
import SearchBar from "../../components/NewConversation/SearchBar";
import Recommendations from "../../components/Recommendations/Recommendations";
import ProfileSearch from "../../components/Search/ProfileSearch";
Expand Down Expand Up @@ -94,7 +94,7 @@ export default function NewConversation({
navigation.setOptions({
headerLeft: () =>
Platform.OS === "ios" ? (
<ConverseButton variant="text" title="Cancel" onPress={handleBack} />
<Button variant="text" text="Cancel" onPress={handleBack} />
) : (
<AndroidBackAction navigation={navigation} />
),
Expand All @@ -109,9 +109,9 @@ export default function NewConversation({
return <ActivityIndicator style={styles.activityIndicator} />;
} else {
return (
<ConverseButton
<Button
variant="text"
title={route.params?.addingToGroupTopic ? "Add" : "Next"}
text={route.params?.addingToGroupTopic ? "Add" : "Next"}
onPress={handleRightAction}
style={{ marginRight: -10, padding: 10 }}
/>
Expand Down Expand Up @@ -334,10 +334,10 @@ export default function NewConversation({
]}
>
{!group.enabled && (
<ConverseButton
<Button
variant="text"
picto="person.2"
title="New group"
text="New group"
style={styles.newGroupButton}
onPress={() => {
setGroup({ enabled: true, members: [] });
Expand All @@ -351,16 +351,13 @@ export default function NewConversation({
const preferredName = getPreferredName(m, m.address);

return (
<ConverseButton
<Button
key={m.address}
title={preferredName}
variant="secondary"
text={preferredName}
variant="fill"
size="md"
picto="xmark"
style={styles.groupMemberButton}
textStyle={{
lineHeight: 17,
top: Platform.OS === "ios" ? undefined : 1,
}}
onPress={() =>
setGroup((g) => {
const members = [...g.members];
Expand Down Expand Up @@ -544,7 +541,7 @@ const useStyles = () => {
padding: 0,
marginHorizontal: 0,
marginRight: 10,
height: Platform.OS === "ios" ? 30 : undefined,
// height: Platform.OS === "ios" ? 30 : undefined,
marginTop: 10,
},
activityIndicator: {
Expand Down
7 changes: 4 additions & 3 deletions screens/Profile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -707,8 +707,9 @@ export default function ProfileScreen({
items={[
{
id: "blocked",
title: "View removed chats",
title: translate("view_removed_chats"),
action: () => {
navigation.popToTop();
navigate("Blocked");
},
titleColor:
Expand All @@ -718,7 +719,7 @@ export default function ProfileScreen({
},
{
id: "accounts",
title: "Change or add account",
title: translate("change_or_add_account"),
action: () => {
navigation.push("Accounts");
},
Expand All @@ -729,7 +730,7 @@ export default function ProfileScreen({
},
{
id: "notifications",
title: "Turn on notifications",
title: translate("turn_on_notifications"),
action: () => {
// @todo => move that to a helper because also used in AccountSettingsButton
if (notificationsPermissionStatus === "denied") {
Expand Down

0 comments on commit 3bfa536

Please sign in to comment.