Page MenuHomePhabricator

[native] update ThreadSettingsPushNotifs to use new thread notifs settings experience
ClosedPublic

Authored by ginsu on Thu, Jul 4, 12:12 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Jul 4, 5:58 AM
Unknown Object (File)
Thu, Jul 4, 5:58 AM
Unknown Object (File)
Thu, Jul 4, 5:58 AM
Unknown Object (File)
Thu, Jul 4, 5:56 AM
F2185569: Screenshot 2024-07-04 at 3.18.54 AM.png
Thu, Jul 4, 12:23 AM
F2185545: Screen Recording 2024-07-04 at 3.10.10 AM.mov
Thu, Jul 4, 12:18 AM
F2185537: Screen Recording 2024-07-04 at 3.09.24 AM.mov
Thu, Jul 4, 12:18 AM
Subscribers

Details

Summary

Currently the ThreadSettingsPushNotifs component renders a switch that the user can use to update their notif settings. We should update ThreadSettingsPushNotifs to instead navigate to our new thread settings notifications screen

Depends on D12664

Test Plan

Please see the demo video below

When hasPushPermissions is true:

When hasPushPermissions is false:

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

native/chat/settings/thread-settings.react.js
462 ↗(On Diff #42001)

Updated the copy to match what we have on web

Screenshot 2024-07-04 at 3.18.54 AM.png (146×280 px, 10 KB)

native/components/edit-setting-button.react.js
12 ↗(On Diff #42001)

I made this optional to prevent some redundancy in ThreadSettingsPushNotifs

ginsu requested review of this revision.Thu, Jul 4, 12:30 AM
ashoat added inline comments.
native/chat/settings/thread-settings-push-notifs.react.js
48–50 ↗(On Diff #42001)

This constructor can be removed now. It's not doing anything except calling its parent. If it's not defined, the parent will be called anyways

60–66 ↗(On Diff #42001)

Let's avoid ternary like this. See point 3 here

Instead I think it would be cleaner to assign two variables and render both below:

let editSettingsButton, notifSettingsLinkingButton;
if (this.props.hasPushPermissions) {
  editSettingsButton = (
    <EditSettingButton onPress={this.onPressEditThreadNotificationSettings} />
  );
} else {
  notifSettingsLinkingButton = (
    <TouchableOpacity onPress={this.onNotificationsSettingsLinkingIconPress}>
      <SWMansionIcon name="info-circle" size={20} color="gray" />
    </TouchableOpacity>
  );
}
This revision is now accepted and ready to land.Thu, Jul 4, 6:40 AM

address comments + rebase before landing

This revision was landed with ongoing or failed builds.Thu, Jul 4, 11:21 AM
This revision was automatically updated to reflect the committed changes.