CLosed groups ui initial listprops

pull/790/head
Vincent 5 years ago
parent 8ba78df919
commit de4edf9252

@ -1105,7 +1105,7 @@
"Placeholder text in the message entry field when it is disabled while we are waiting for a friend request approval" "Placeholder text in the message entry field when it is disabled while we are waiting for a friend request approval"
}, },
"sendMessageFriendRequest": { "sendMessageFriendRequest": {
"message": "Hi there! This is ...!", "message": "Send your first message",
"description": "description":
"Placeholder text in the message entry field when it is the first message sent to that contact" "Placeholder text in the message entry field when it is the first message sent to that contact"
}, },
@ -1437,7 +1437,7 @@
"description": "Header for notification settings" "description": "Header for notification settings"
}, },
"readReceiptSettingDescription": { "readReceiptSettingDescription": {
"message": "Enable the sending and receiving of read receipts", "message": "See and share when messages have been read (enables read receipts in all sessions).",
"description": "Description of the read receipts setting" "description": "Description of the read receipts setting"
}, },
"readReceiptSettingTitle": { "readReceiptSettingTitle": {
@ -2605,6 +2605,9 @@
"message": "Complete Sign Up" "message": "Complete Sign Up"
}, },
"compose": { "compose": {
"message": "Compose"
},
"newSession": {
"message": "New Session" "message": "New Session"
}, },
"searchForAKeyPhrase": { "searchForAKeyPhrase": {
@ -2650,11 +2653,11 @@
"decline": { "decline": {
"message": "Decline" "message": "Decline"
}, },
"generalSettingsTitle": { "appearanceSettingsTitle": {
"message": "General" "message": "Appearance"
}, },
"generalSettingsDescription": { "appearanceSettingsDescription": {
"message": "General settings and configuration" "message": "Appearance and interface options"
}, },
"accountSettingsTitle": { "accountSettingsTitle": {
"message": "Account" "message": "Account"
@ -2678,13 +2681,13 @@
"message": "Notifications" "message": "Notifications"
}, },
"notificationSettingsDescription": { "notificationSettingsDescription": {
"message": "Choose what you're notified about" "message": "Configure notification options"
}, },
"devicesSettingsTitle": { "devicesSettingsTitle": {
"message": "Devices" "message": "Devices"
}, },
"devicesSettingsDescription": { "devicesSettingsDescription": {
"message": "Manage linked devices" "message": "Manage your linked devices"
}, },
"mnemonicEmpty": { "mnemonicEmpty": {
"message": "Seed is mandatory" "message": "Seed is mandatory"
@ -2713,11 +2716,26 @@
"addChannel": { "addChannel": {
"message": "Join Open Group" "message": "Join Open Group"
}, },
"joinOpenGroup": {
"message": "Join Open Group"
},
"createClosedGroup": {
"message": "Create Closed Group"
},
"createClosedGroupDescription": {
"message": "Closed groups are end-to-end encrypted group chats for up to 10 members. They provide the same privacy protections as one-on-one sessions."
},
"createClosedGroupNamePrompt": {
"message": "Group Name"
},
"createClosedGroupPlaceholder": {
"message": "Enter a group name"
},
"enterChannelURL": { "enterChannelURL": {
"message": "Enter Open Group URL" "message": "Enter Open Group URL"
}, },
"channelUrlPlaceholder": { "channelUrlPlaceholder": {
"message": "https://chat.lokinet.org" "message": "chat.getsession.org"
}, },
"addChannelDescription": { "addChannelDescription": {
"message": "Enter an open group URL." "message": "Enter an open group URL."

@ -902,7 +902,7 @@ async function updateToLokiSchemaVersion1(currentVersion, instance) {
rssFeed: 'https://loki.network/feed/', rssFeed: 'https://loki.network/feed/',
closable: true, closable: true,
name: 'Loki.network News', name: 'Loki.network News',
profileAvatar: 'images/loki/session_icon.png', profileAvatar: 'images/session/session_chat_icon.png',
}; };
const updatesRssFeedData = { const updatesRssFeedData = {
@ -911,7 +911,7 @@ async function updateToLokiSchemaVersion1(currentVersion, instance) {
rssFeed: 'https://loki.network/category/messenger-updates/feed/', rssFeed: 'https://loki.network/category/messenger-updates/feed/',
closable: false, closable: false,
name: 'Messenger updates', name: 'Messenger updates',
profileAvatar: 'images/loki/session_icon.png', profileAvatar: 'images/session/session_chat_icon.png',
}; };
const autoJoinLokiChats = false; const autoJoinLokiChats = false;

@ -35,6 +35,6 @@
"-----BEGIN CERTIFICATE-----\nMIID7zCCAtegAwIBAgIJAIm6LatK5PNiMA0GCSqGSIb3DQEBBQUAMIGNMQswCQYD\nVQQGEwJVUzETMBEGA1UECAwKQ2FsaWZvcm5pYTEWMBQGA1UEBwwNU2FuIEZyYW5j\naXNjbzEdMBsGA1UECgwUT3BlbiBXaGlzcGVyIFN5c3RlbXMxHTAbBgNVBAsMFE9w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WBBQBixjx\nP/s5GURuhYa+lGUypzI8kDAfBgNVHSMEGDAWgBQBixjxP/s5GURuhYa+lGUypzI8\nkDAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUAA4IBAQB+Hr4hC56m0LvJAu1R\nK6NuPDbTMEN7/jMojFHxH4P3XPFfupjR+bkDq0pPOU6JjIxnrD1XD/EVmTTaTVY5\niOheyv7UzJOefb2pLOc9qsuvI4fnaESh9bhzln+LXxtCrRPGhkxA1IMIo3J/s2WF\n/KVYZyciu6b4ubJ91XPAuBNZwImug7/srWvbpk0hq6A6z140WTVSKtJG7EP41kJe\n/oF4usY5J7LPkxK3LWzMJnb5EIJDmRvyH8pyRwWg6Qm6qiGFaI4nL8QU4La1x2en\n4DGXRaLMPRwjELNgQPodR38zoCMuA8gHZfZYYoZ7D7Q1wNUiVHcxuFrEeBaYJbLE\nrwLV\n-----END CERTIFICATE-----\n",
"import": false, "import": false,
"serverTrustRoot": "BbqY1DzohE4NUZoVF+L18oUPrK3kILllLEJh2UnPSsEx", "serverTrustRoot": "BbqY1DzohE4NUZoVF+L18oUPrK3kILllLEJh2UnPSsEx",
"defaultPublicChatServer": "https://chat.lokinet.org/", "defaultPublicChatServer": "https://chat.getsession.org",
"defaultFileServer": "https://file.lokinet.org" "defaultFileServer": "https://file.lokinet.org"
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

@ -121,7 +121,6 @@
'x.svg', 'x.svg',
'x_white.svg', 'x_white.svg',
'icon-paste.svg', 'icon-paste.svg',
'loki/loki_icon_text.png',
'loki/session_icon_128.png', 'loki/session_icon_128.png',
]); ]);
@ -988,6 +987,19 @@
return toastID; return toastID;
}; };
window.getFriendsFromContacts = contacts => {
// To call from TypeScript, input / output are both
// of type Array<ConversationType>
let friendList = contacts;
if (friendList !== undefined) {
friendList = friendList.filter(
friend => friend.type === 'direct' && !friend.isMe
);
}
return friendList;
}
// Get memberlist. This function is not accurate >> // Get memberlist. This function is not accurate >>
// window.getMemberList = window.lokiPublicChatAPI.getListOfMembers(); // window.getMemberList = window.lokiPublicChatAPI.getListOfMembers();

@ -347,7 +347,7 @@ $session_message-container-border-radius: 5px;
min-width: 165px; min-width: 165px;
height: 45px; height: 45px;
line-height: 40px; line-height: 40px;
padding: 0; padding: 0px $session-margin-lg;
font-size: $session-font-md; font-size: $session-font-md;
font-family: $session-font-family; font-family: $session-font-family;
border-radius: 500px; border-radius: 500px;
@ -553,6 +553,11 @@ label {
position: relative; position: relative;
} }
.module-left-pane-overlay {
h3 {
margin-bottom: 6px;
}
}
.message-selection-overlay { .message-selection-overlay {
display: none; display: none;
position: absolute; position: absolute;
@ -1380,6 +1385,7 @@ input {
background-color: $session-shade-4; background-color: $session-shade-4;
border: $session-separator-element-border; border: $session-separator-element-border;
display: flex; display: flex;
align-items: center;
transition: $session-transition-duration; transition: $session-transition-duration;
.module-avatar, .module-avatar,

@ -292,7 +292,8 @@ $session-compose-margin: 20px;
} }
.session-description-long { .session-description-long {
font-size: 14px; font-size: $session-font-sm;
line-height: $session-font-h3;
margin: 0px 20px; margin: 0px 20px;
} }

@ -177,6 +177,7 @@ export class LeftPane extends React.Component<Props, State> {
private renderChannelSection() { private renderChannelSection() {
const { const {
friends,
openConversationInternal, openConversationInternal,
conversations, conversations,
searchResults, searchResults,
@ -189,6 +190,7 @@ export class LeftPane extends React.Component<Props, State> {
return ( return (
<LeftPaneChannelSection <LeftPaneChannelSection
friends={friends}
openConversationInternal={openConversationInternal} openConversationInternal={openConversationInternal}
conversations={conversations} conversations={conversations}
searchResults={searchResults} searchResults={searchResults}

@ -23,7 +23,7 @@ export class GroupInvitation extends React.Component<Props> {
<div className="contents"> <div className="contents">
<img <img
alt="group-avatar" alt="group-avatar"
src="images/loki/session_icon.png" src="images/session/session_chat_icon.png"
className="invite-group-avatar" className="invite-group-avatar"
/> />
<span className="group-details"> <span className="group-details">

@ -19,14 +19,16 @@ import {
import { SearchOptions } from '../../types/Search'; import { SearchOptions } from '../../types/Search';
import { debounce } from 'lodash'; import { debounce } from 'lodash';
import { cleanSearchTerm } from '../../util/cleanSearchTerm'; import { cleanSearchTerm } from '../../util/cleanSearchTerm';
import { ConversationType } from '../../state/ducks/conversations';
import { SessionSearchInput } from './SessionSearchInput'; import { SessionSearchInput } from './SessionSearchInput';
import { SessionClosableOverlay } from './SessionClosableOverlay'; import { SessionClosableOverlay } from './SessionClosableOverlay';
import { MainViewController } from '../MainViewController'; import { MainViewController } from '../MainViewController';
export interface Props { export interface Props {
friends: Array<ConversationType>;
searchTerm: string; searchTerm: string;
isSecondaryDevice: boolean; isSecondaryDevice: boolean;
conversations?: Array<ConversationListItemPropsType>; conversations?: Array<ConversationListItemPropsType>;
searchResults?: SearchResultsProps; searchResults?: SearchResultsProps;
@ -37,11 +39,17 @@ export interface Props {
clearSearch: () => void; clearSearch: () => void;
} }
export enum SessionGroupType {
Open = 'open-group',
Closed = 'closed-group',
}
interface State { interface State {
showAddChannelView: boolean;
channelUrlPasted: string; channelUrlPasted: string;
loading: boolean; loading: boolean;
connectSuccess: boolean; connectSuccess: boolean;
// The type of group that is being added. Undefined in default view.
groupAddType: SessionGroupType | undefined;
} }
export class LeftPaneChannelSection extends React.Component<Props, State> { export class LeftPaneChannelSection extends React.Component<Props, State> {
@ -51,10 +59,10 @@ export class LeftPaneChannelSection extends React.Component<Props, State> {
public constructor(props: Props) { public constructor(props: Props) {
super(props); super(props);
this.state = { this.state = {
showAddChannelView: false,
channelUrlPasted: '', channelUrlPasted: '',
loading: false, loading: false,
connectSuccess: false, connectSuccess: false,
groupAddType: undefined,
}; };
this.handleOnPasteUrl = this.handleOnPasteUrl.bind(this); this.handleOnPasteUrl = this.handleOnPasteUrl.bind(this);
@ -178,12 +186,14 @@ export class LeftPaneChannelSection extends React.Component<Props, State> {
} }
public render(): JSX.Element { public render(): JSX.Element {
return ( return (
<div className="session-left-pane-section-content"> <div className="session-left-pane-section-content">
{this.renderHeader()} {this.renderHeader()}
{this.state.showAddChannelView {this.state.groupAddType
? this.renderClosableOverlay() ? this.renderClosableOverlay(this.state.groupAddType)
: this.renderGroups()} : this.renderGroups()
}
</div> </div>
); );
} }
@ -247,32 +257,68 @@ export class LeftPaneChannelSection extends React.Component<Props, State> {
} }
} }
private handleToggleOverlay() { private handleToggleOverlay(groupType?: SessionGroupType) {
this.setState(prevState => ({ // If no groupType, return to default view.
showAddChannelView: !prevState.showAddChannelView, // Close the overlay with handleToggleOverlay(undefined)
}));
switch (groupType) {
case SessionGroupType.Open:
this.setState({
groupAddType: SessionGroupType.Open,
});
break;
case SessionGroupType.Closed:
this.setState({
groupAddType: SessionGroupType.Closed,
});
break;
default:
// Exit overlay
this.setState({
groupAddType: undefined,
});
break;
}
} }
private renderClosableOverlay() { private renderClosableOverlay(groupType: SessionGroupType) {
const { searchTerm } = this.props; const { searchTerm, friends } = this.props;
const { loading } = this.state; const { loading } = this.state;
return ( const openGroupElement = (
<SessionClosableOverlay <SessionClosableOverlay
overlayMode="channel" overlayMode={SessionGroupType.Open}
onChangeSessionID={this.handleOnPasteUrl} onChangeSessionID={this.handleOnPasteUrl}
onCloseClick={this.handleToggleOverlay} onCloseClick={() => this.handleToggleOverlay(undefined)}
onButtonClick={this.handleJoinChannelButtonClick} onButtonClick={this.handleJoinChannelButtonClick}
searchTerm={searchTerm} searchTerm={searchTerm}
updateSearch={this.updateSearchBound} updateSearch={this.updateSearchBound}
showSpinner={loading} showSpinner={loading}
/> />
); );
const closedGroupElement = (
<SessionClosableOverlay
friends={friends}
overlayMode={SessionGroupType.Closed}
onChangeSessionID={this.handleOnPasteUrl}
onCloseClick={() => this.handleToggleOverlay(undefined)}
onButtonClick={this.handleCreateClosedGroupButtonClick}
searchTerm={searchTerm}
updateSearch={this.updateSearchBound}
showSpinner={loading}
/>
);
const renderElement = groupType === SessionGroupType.Open ? openGroupElement : closedGroupElement;
return renderElement;
} }
private renderBottomButtons(): JSX.Element { private renderBottomButtons(): JSX.Element {
const edit = window.i18n('edit'); const edit = window.i18n('edit');
const addChannel = window.i18n('addChannel'); const joinOpenGroup = window.i18n('joinOpenGroup');
const createClosedGroup = window.i18n('createClosedGroup');
const showEditButton = false; const showEditButton = false;
return ( return (
@ -284,11 +330,18 @@ export class LeftPaneChannelSection extends React.Component<Props, State> {
buttonColor={SessionButtonColor.White} buttonColor={SessionButtonColor.White}
/> />
)} )}
<SessionButton <SessionButton
text={addChannel} text={joinOpenGroup}
buttonType={SessionButtonType.SquareOutline} buttonType={SessionButtonType.SquareOutline}
buttonColor={SessionButtonColor.Green} buttonColor={SessionButtonColor.Green}
onClick={this.handleToggleOverlay} onClick={() => this.handleToggleOverlay(SessionGroupType.Open)}
/>
<SessionButton
text={createClosedGroup}
buttonType={SessionButtonType.SquareOutline}
buttonColor={SessionButtonColor.White}
onClick={() => this.handleToggleOverlay(SessionGroupType.Closed)}
/> />
</div> </div>
); );
@ -327,8 +380,14 @@ export class LeftPaneChannelSection extends React.Component<Props, State> {
return false; return false;
} }
joinChannelStateManager(this, channelUrlPasted, this.handleToggleOverlay); joinChannelStateManager(this, channelUrlPasted, this.handleToggleOverlay(SessionGroupType.Open));
return true;
}
private handleCreateClosedGroupButtonClick() {
alert("creating closed group!");
return true; return true;
} }
} }

@ -140,7 +140,7 @@ export class LeftPaneContactSection extends React.Component<Props, State> {
style, style,
}: RowRendererParamsType): JSX.Element | undefined => { }: RowRendererParamsType): JSX.Element | undefined => {
const { sentFriendsRequest } = this.props; const { sentFriendsRequest } = this.props;
const friends = this.getCurrentFriends(); const friends = window.getFriendsFromContacts(this.props.friends);
const combined = [...sentFriendsRequest, ...friends]; const combined = [...sentFriendsRequest, ...friends];
const item = combined[index]; const item = combined[index];
@ -211,19 +211,6 @@ export class LeftPaneContactSection extends React.Component<Props, State> {
); );
} }
private getCurrentFriends(): Array<ConversationType> {
const { friends } = this.props;
let friendList = friends;
if (friendList !== undefined) {
friendList = friendList.filter(
friend => friend.type === 'direct' && !friend.isMe
);
}
return friendList;
}
private handleToggleOverlay() { private handleToggleOverlay() {
this.setState((prevState: { showAddContactView: boolean }) => ({ this.setState((prevState: { showAddContactView: boolean }) => ({
showAddContactView: !prevState.showAddContactView, showAddContactView: !prevState.showAddContactView,
@ -334,7 +321,7 @@ export class LeftPaneContactSection extends React.Component<Props, State> {
private renderList() { private renderList() {
const { sentFriendsRequest } = this.props; const { sentFriendsRequest } = this.props;
const friends = this.getCurrentFriends(); const friends = window.getFriendsFromContacts(this.props.friends);
const length = sentFriendsRequest.length + friends.length; const length = sentFriendsRequest.length + friends.length;
const combined = [...sentFriendsRequest, ...friends]; const combined = [...sentFriendsRequest, ...friends];

@ -191,7 +191,7 @@ export class LeftPaneMessageSection extends React.Component<Props, any> {
return LeftPane.RENDER_HEADER( return LeftPane.RENDER_HEADER(
labels, labels,
null, null,
window.i18n('compose'), window.i18n('newSession'),
this.handleToggleOverlay this.handleToggleOverlay
); );
} }

@ -82,7 +82,7 @@ export class LeftPaneSectionHeader extends React.Component<Props, State> {
if (buttonLabel) { if (buttonLabel) {
children.push( children.push(
<SessionButton <SessionButton
text={window.i18n('compose')} text={window.i18n('newSession')}
onClick={buttonClicked} onClick={buttonClicked}
key="compose" key="compose"
disabled={false} disabled={false}

@ -25,7 +25,7 @@ export class LeftPaneSettingSection extends React.Component<any, State> {
super(props); super(props);
this.state = { this.state = {
settingCategory: SessionSettingCategory.General, settingCategory: SessionSettingCategory.Appearance,
searchQuery: '', searchQuery: '',
}; };
@ -179,9 +179,9 @@ export class LeftPaneSettingSection extends React.Component<any, State> {
public getCategories() { public getCategories() {
return [ return [
{ {
id: SessionSettingCategory.General, id: SessionSettingCategory.Appearance,
title: window.i18n('generalSettingsTitle'), title: window.i18n('appearanceSettingsTitle'),
description: window.i18n('generalSettingsDescription'), description: window.i18n('appearanceSettingsDescription'),
hidden: false, hidden: false,
}, },
{ {

@ -3,18 +3,22 @@ import React from 'react';
import { SessionIconButton, SessionIconSize, SessionIconType } from './icon'; import { SessionIconButton, SessionIconSize, SessionIconType } from './icon';
import { SessionIdEditable } from './SessionIdEditable'; import { SessionIdEditable } from './SessionIdEditable';
import { UserSearchDropdown } from './UserSearchDropdown'; import { UserSearchDropdown } from './UserSearchDropdown';
import { MemberList } from '../conversation/MemberList';
import { ConversationType } from '../../state/ducks/conversations';
import { import {
SessionButton, SessionButton,
SessionButtonColor, SessionButtonColor,
SessionButtonType, SessionButtonType,
} from './SessionButton'; } from './SessionButton';
import { SessionSpinner } from './SessionSpinner'; import { SessionSpinner } from './SessionSpinner';
import { SessionGroupType } from './LeftPaneChannelSection';
interface Props { interface Props {
overlayMode: 'message' | 'contact' | 'channel'; overlayMode: 'message' | 'contact' | SessionGroupType;
onChangeSessionID: any; onChangeSessionID: any;
onCloseClick: any; onCloseClick: any;
onButtonClick: any; onButtonClick: any;
friends?: Array<ConversationType>;
searchTerm?: string; searchTerm?: string;
searchResults?: any; searchResults?: any;
updateSearch?: any; updateSearch?: any;
@ -50,7 +54,9 @@ export class SessionClosableOverlay extends React.Component<Props> {
const isAddContactView = overlayMode === 'contact'; const isAddContactView = overlayMode === 'contact';
const isMessageView = overlayMode === 'message'; const isMessageView = overlayMode === 'message';
// const isChannelView = overlayMode === 'channel';
// const isOpenGroupView = overlayMode === SessionGroupType.Open;
const isClosedGroupView = overlayMode === SessionGroupType.Closed;
let title; let title;
let buttonText; let buttonText;
@ -59,7 +65,7 @@ export class SessionClosableOverlay extends React.Component<Props> {
let placeholder; let placeholder;
switch (overlayMode) { switch (overlayMode) {
case 'message': case 'message':
title = window.i18n('enterRecipient'); title = window.i18n('newSession');
buttonText = window.i18n('next'); buttonText = window.i18n('next');
descriptionLong = window.i18n('usersCanShareTheir...'); descriptionLong = window.i18n('usersCanShareTheir...');
subtitle = window.i18n('enterSessionID'); subtitle = window.i18n('enterSessionID');
@ -72,16 +78,28 @@ export class SessionClosableOverlay extends React.Component<Props> {
subtitle = window.i18n('enterSessionID'); subtitle = window.i18n('enterSessionID');
placeholder = window.i18n('pasteSessionIDRecipient'); placeholder = window.i18n('pasteSessionIDRecipient');
break; break;
case 'channel': case 'open-group':
default:
title = window.i18n('addChannel'); title = window.i18n('addChannel');
buttonText = window.i18n('joinChannel'); buttonText = window.i18n('joinChannel');
descriptionLong = window.i18n('addChannelDescription'); descriptionLong = window.i18n('addChannelDescription');
subtitle = window.i18n('enterChannelURL'); subtitle = window.i18n('enterChannelURL');
placeholder = window.i18n('channelUrlPlaceholder'); placeholder = window.i18n('channelUrlPlaceholder');
break;
case 'closed-group':
title = window.i18n('createClosedGroup');
buttonText = window.i18n('createClosedGroup');
descriptionLong = window.i18n('createClosedGroupDescription');
subtitle = window.i18n('createClosedGroupNamePrompt');
placeholder = window.i18n('createClosedGroupPlaceholder');
break;
default:
break;
} }
const ourSessionID = window.textsecure.storage.user.getNumber(); const ourSessionID = window.textsecure.storage.user.getNumber();
const friends = window.getFriendsFromContacts(this.props.friends);
console.log(this.props.friends);
console.log(window.getFriendsFromContacts(this.props.friends));
return ( return (
<div className="module-left-pane-overlay"> <div className="module-left-pane-overlay">
@ -105,6 +123,18 @@ export class SessionClosableOverlay extends React.Component<Props> {
onChange={onChangeSessionID} onChange={onChangeSessionID}
/> />
{showSpinner && <SessionSpinner />} {showSpinner && <SessionSpinner />}
{isClosedGroupView && (
<div className="friend-selection-list">
<MemberList
members={friends}
selected={{}}
i18n={window.i18n}
onMemberClicked={() => null }//this.onMemberClicked}
/>
</div>
)}
<div className="session-description-long">{descriptionLong}</div> <div className="session-description-long">{descriptionLong}</div>
{isMessageView && <h4>{window.i18n('or')}</h4>} {isMessageView && <h4>{window.i18n('or')}</h4>}
@ -130,6 +160,7 @@ export class SessionClosableOverlay extends React.Component<Props> {
text={ourSessionID} text={ourSessionID}
/> />
)} )}
<SessionButton <SessionButton
buttonColor={SessionButtonColor.Green} buttonColor={SessionButtonColor.Green}
buttonType={SessionButtonType.BrandOutline} buttonType={SessionButtonType.BrandOutline}

@ -9,7 +9,7 @@ import {
} from '../SessionButton'; } from '../SessionButton';
export enum SessionSettingCategory { export enum SessionSettingCategory {
General = 'general', Appearance = 'appearance',
Account = 'account', Account = 'account',
Privacy = 'privacy', Privacy = 'privacy',
Permissions = 'permissions', Permissions = 'permissions',
@ -326,7 +326,7 @@ export class SettingsView extends React.Component<SettingsViewProps, State> {
hidden: true, hidden: true,
comparisonValue: 'light', comparisonValue: 'light',
type: SessionSettingType.Toggle, type: SessionSettingType.Toggle,
category: SessionSettingCategory.General, category: SessionSettingCategory.Appearance,
setFn: window.toggleTheme, setFn: window.toggleTheme,
content: undefined, content: undefined,
onClick: undefined, onClick: undefined,
@ -338,7 +338,7 @@ export class SettingsView extends React.Component<SettingsViewProps, State> {
description: window.i18n('hideMenuBarDescription'), description: window.i18n('hideMenuBarDescription'),
hidden: !Settings.isHideMenuBarSupported(), hidden: !Settings.isHideMenuBarSupported(),
type: SessionSettingType.Toggle, type: SessionSettingType.Toggle,
category: SessionSettingCategory.General, category: SessionSettingCategory.Appearance,
setFn: window.toggleMenuBar, setFn: window.toggleMenuBar,
content: { defaultValue: true }, content: { defaultValue: true },
comparisonValue: undefined, comparisonValue: undefined,
@ -351,7 +351,7 @@ export class SettingsView extends React.Component<SettingsViewProps, State> {
description: window.i18n('spellCheckDescription'), description: window.i18n('spellCheckDescription'),
hidden: false, hidden: false,
type: SessionSettingType.Toggle, type: SessionSettingType.Toggle,
category: SessionSettingCategory.General, category: SessionSettingCategory.Appearance,
setFn: window.toggleSpellCheck, setFn: window.toggleSpellCheck,
content: undefined, content: undefined,
comparisonValue: undefined, comparisonValue: undefined,
@ -364,7 +364,7 @@ export class SettingsView extends React.Component<SettingsViewProps, State> {
description: window.i18n('linkPreviewDescription'), description: window.i18n('linkPreviewDescription'),
hidden: false, hidden: false,
type: SessionSettingType.Toggle, type: SessionSettingType.Toggle,
category: SessionSettingCategory.General, category: SessionSettingCategory.Appearance,
setFn: window.toggleLinkPreview, setFn: window.toggleLinkPreview,
content: undefined, content: undefined,
comparisonValue: undefined, comparisonValue: undefined,

1
ts/global.d.ts vendored

@ -6,6 +6,7 @@ interface Window {
deleteAllData: any; deleteAllData: any;
clearLocalData: any; clearLocalData: any;
getAccountManager: any; getAccountManager: any;
getFriendsFromContacts: any;
mnemonic: any; mnemonic: any;
clipboard: any; clipboard: any;
attemptConnection: any; attemptConnection: any;

Loading…
Cancel
Save