Skip to content

Commit 4891c24

Browse files
committed
Add a button to launch community browser directly from action panel.
1 parent a455b75 commit 4891c24

File tree

4 files changed

+22
-4
lines changed

4 files changed

+22
-4
lines changed

_locales/en/messages.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,5 +526,6 @@
526526
"reactionPopupThree": "$name$, $name2$ & $name3$",
527527
"reactionPopupMany": "$name$, $name2$, $name3$ &",
528528
"reactionListCountSingular": "And $otherSingular$ has reacted <span>$emoji$</span> to this message",
529-
"reactionListCountPlural": "And $otherPlural$ have reacted <span>$emoji$</span> to this message"
529+
"reactionListCountPlural": "And $otherPlural$ have reacted <span>$emoji$</span> to this message",
530+
"launchingCommunityBrowser": "Launching communities in browser..."
530531
}

ts/components/leftpane/ActionsPanel.tsx

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ import { editProfileModal, onionPathModal } from '../../state/ducks/modalDialog'
2828

2929
// tslint:disable-next-line: no-import-side-effect no-submodule-imports
3030

31-
import { ipcRenderer } from 'electron';
31+
import { ipcRenderer, shell } from 'electron';
3232
import { loadDefaultRooms } from '../../session/apis/open_group_api/opengroupV2/ApiUtil';
3333
import { getOpenGroupManager } from '../../session/apis/open_group_api/opengroupV2/OpenGroupManagerV2';
3434
import { getSwarmPollingInstance } from '../../session/apis/snode_api';
35-
import { UserUtils } from '../../session/utils';
35+
import { ToastUtils, UserUtils } from '../../session/utils';
3636
import { Avatar, AvatarSize } from '../avatar/Avatar';
3737
import { ActionPanelOnionStatusLight } from '../dialog/OnionStatusPathDialog';
3838
import { SessionIconButton } from '../icon';
@@ -75,6 +75,9 @@ const Section = (props: { type: SectionType }) => {
7575
usePrimaryColor: true,
7676
dispatch,
7777
});
78+
} else if (type === SectionType.Communities) {
79+
void shell.openExternal('https://sessioncommunities.online');
80+
ToastUtils.pushToastSuccess('launch', window.i18n('launchingCommunityBrowser'))
7881
} else if (type === SectionType.PathIndicator) {
7982
// Show Path Indicator Modal
8083
dispatch(onionPathModal({}));
@@ -121,6 +124,16 @@ const Section = (props: { type: SectionType }) => {
121124
isSelected={isSelected}
122125
/>
123126
);
127+
case SectionType.Communities:
128+
return (
129+
<SessionIconButton
130+
iconSize="medium"
131+
dataTestId="communities-section"
132+
iconType={'communities'}
133+
onClick={handleClick}
134+
isSelected={isSelected}
135+
/>
136+
);
124137
case SectionType.PathIndicator:
125138
return (
126139
<ActionPanelOnionStatusLight
@@ -293,6 +306,7 @@ export const ActionsPanel = () => {
293306
<Section type={SectionType.Profile} />
294307
<Section type={SectionType.Message} />
295308
<Section type={SectionType.Settings} />
309+
<Section type={SectionType.Communities} />
296310
<Section type={SectionType.PathIndicator} />
297311
<Section type={SectionType.ColorMode} />
298312
</LeftPaneSectionContainer>

ts/state/ducks/section.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export enum SectionType {
1010
Profile,
1111
Message,
1212
Settings,
13+
Communities,
1314
ColorMode,
1415
PathIndicator,
1516
}

ts/types/LocalizerKeys.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,4 +526,6 @@ export type LocalizerKeys =
526526
| 'openGroupsTitle'
527527
| 'serverBanUserAndDeleteAll'
528528
| 'serverBanUser'
529-
| 'serverUnbanUser';
529+
| 'serverUnbanUser'
530+
| 'reportIssue'
531+
| 'launchingCommunityBrowser';

0 commit comments

Comments
 (0)