text stringlengths 9 39.2M | dir stringlengths 25 226 | lang stringclasses 163
values | created_date timestamp[s] | updated_date timestamp[s] | repo_name stringclasses 751
values | repo_full_name stringclasses 752
values | star int64 1.01k 183k | len_tokens int64 1 18.5M |
|---|---|---|---|---|---|---|---|---|
```javascript
/* @flow strict-local */
import invariant from 'invariant';
import React, { useContext } from 'react';
import type { Node } from 'react';
import { Text } from 'react-native';
import type { ____TextStyle_Internal } from 'react-native/Libraries/StyleSheet/StyleSheetTypes'; // eslint-disable-line id-match
i... | /content/code_sandbox/src/common/ZulipText.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 545 |
```javascript
/* @flow strict-local */
import React from 'react';
import type { Node } from 'react';
import SectionSeparator from './SectionSeparator';
/*
* Upstream `SectionList` is full of `any`s. This type is incomplete,
* and just captures what we use.
*/
type Props = $ReadOnly<{|
leadingItem: ?{ ... },
le... | /content/code_sandbox/src/common/SectionSeparatorBetween.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 169 |
```javascript
/* @flow strict-local */
import * as React from 'react';
import ZulipText from './ZulipText';
import { openLinkWithUserPreference } from '../utils/openLink';
import { BRAND_COLOR, createStyleSheet } from '../styles';
import { useGlobalSelector } from '../react-redux';
import { getGlobalSettings } from '... | /content/code_sandbox/src/common/WebLink.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 364 |
```javascript
/* @flow strict-local */
import React, { useMemo } from 'react';
import type { Node } from 'react';
import { LogBox, View } from 'react-native';
import type { LocalizableText } from '../types';
import type { RouteProp } from '../react-navigation';
import type { AppNavigationProp } from '../nav/AppNaviga... | /content/code_sandbox/src/common/SelectableOptionsScreen.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 1,091 |
```javascript
/* @flow strict-local */
import React from 'react';
import type { Node } from 'react';
import type { EditingEvent } from 'react-native/Libraries/Components/TextInput/TextInput';
import { View } from 'react-native';
import InputWithClearButton from './InputWithClearButton';
import { createStyleSheet } from... | /content/code_sandbox/src/common/SearchInput.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 370 |
```javascript
/* @flow strict-local */
import React from 'react';
import type { Node } from 'react';
import { View, ActivityIndicator } from 'react-native';
import type { TextStyle, ViewStyle } from 'react-native/Libraries/StyleSheet/StyleSheet';
import ZulipTextIntl from './ZulipTextIntl';
import type { LocalizableRe... | /content/code_sandbox/src/common/ZulipButton.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 1,235 |
```javascript
/* @flow strict-local */
import React, { useContext } from 'react';
import type { Node } from 'react';
import { Image, View, PixelRatio } from 'react-native';
import { useSelector } from '../react-redux';
import { getAuthHeaders } from '../api/transport';
import { getAuth } from '../account/accountsSelec... | /content/code_sandbox/src/common/UserAvatar.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 490 |
```javascript
/* @flow strict-local */
import React, { useContext } from 'react';
import type { Node } from 'react';
import { View } from 'react-native';
import type { SpecificIconType } from './Icons';
import ZulipTextIntl from './ZulipTextIntl';
import ZulipSwitch from './ZulipSwitch';
import styles, { ThemeContext,... | /content/code_sandbox/src/common/SwitchRow.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 376 |
```javascript
/* @flow strict-local */
import React from 'react';
import type { Node } from 'react';
import type { UserId } from '../types';
import { createStyleSheet } from '../styles';
import UserAvatar from './UserAvatar';
import PresenceStatusIndicator from './PresenceStatusIndicator';
import { tryGetUserForId } f... | /content/code_sandbox/src/common/UserAvatarWithPresence.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 370 |
```javascript
/* @flow strict-local */
import React from 'react';
import type { Node } from 'react';
import { Platform, StatusBar, useColorScheme } from 'react-native';
// $FlowFixMe[untyped-import]
import Color from 'color';
import type { ThemeName } from '../types';
import { useGlobalSelector } from '../react-redux... | /content/code_sandbox/src/common/ZulipStatusBar.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 607 |
```javascript
/* @flow strict-local */
import React from 'react';
import type { Node } from 'react';
import { View } from 'react-native';
import type { ViewStyleProp } from 'react-native/Libraries/StyleSheet/StyleSheet';
import type { Style } from '../types';
type Props = $ReadOnly<{|
children: $ReadOnlyArray<Node>... | /content/code_sandbox/src/common/ComponentList.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 337 |
```javascript
/* @flow strict-local */
import React from 'react';
import type { Node } from 'react';
import { Platform, View } from 'react-native';
import type { ViewStyleProp } from 'react-native/Libraries/StyleSheet/StyleSheet';
import { useSafeAreaInsets } from 'react-native-safe-area-context';
import KeyboardAvoid... | /content/code_sandbox/src/common/KeyboardAvoider.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 739 |
```javascript
/* @flow strict-local */
import React from 'react';
import type { Node } from 'react';
import { View } from 'react-native';
type Props = $ReadOnly<{|
width?: number,
height?: number,
|}>;
/**
* An empty layout component used to simplify UI alignment.
* Use when it is easier to use this instead of ... | /content/code_sandbox/src/common/ViewPlaceholder.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 152 |
```javascript
/* @flow strict-local */
import React from 'react';
import type { Node } from 'react';
import subDays from 'date-fns/subDays';
import ZulipBanner from './ZulipBanner';
import { useSelector, useDispatch, useGlobalSelector } from '../react-redux';
import { getAccount, getSilenceServerPushSetupWarnings } f... | /content/code_sandbox/src/common/ServerNotifsExpiringBanner.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 570 |
```javascript
/* @flow strict-local */
import React, { useContext } from 'react';
import type { Node } from 'react';
import { View } from 'react-native';
import { ThemeContext, createStyleSheet } from '../styles';
const componentStyles = createStyleSheet({
lineSeparator: {
height: 1,
margin: 4,
},
});
ex... | /content/code_sandbox/src/common/LineSeparator.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 122 |
```javascript
/* @flow strict-local */
import React from 'react';
import type { Node } from 'react';
import ZulipBanner from './ZulipBanner';
import { useSelector, useGlobalSelector, useDispatch } from '../react-redux';
import { getOwnUser } from '../selectors';
import { getIdentity, getServerVersion } from '../accou... | /content/code_sandbox/src/common/ServerCompatBanner.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 766 |
```javascript
/* @flow strict-local */
import * as React from 'react';
import { View } from 'react-native';
import SwitchRow from './SwitchRow';
import TextRow from './TextRow';
import NavRow from './NavRow';
import type { LocalizableReactText } from '../types';
import { createStyleSheet } from '../styles';
import { ... | /content/code_sandbox/src/common/RowGroup.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 355 |
```javascript
/* @flow strict-local */
import { getStatusBarStyle } from '../ZulipStatusBar';
describe('getStatusBarStyle', () => {
test('return bar style according to given color', () => {
expect(getStatusBarStyle('#fff')).toEqual('dark-content');
expect(getStatusBarStyle('#000')).toEqual('light-content');
... | /content/code_sandbox/src/common/__tests__/getStatusBarStyle-test.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 72 |
```javascript
/* @flow strict-local */
import { getStatusBarColor } from '../ZulipStatusBar';
const themeDark = 'dark';
const themeLight = 'light';
describe('getStatusBarColor', () => {
test('returns specific color when given, regardless of theme', () => {
expect(getStatusBarColor('#fff', themeLight)).toEqual('... | /content/code_sandbox/src/common/__tests__/getStatusBarColor-test.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 147 |
```javascript
/* @flow strict-local */
import React from 'react';
import type { Node } from 'react';
import { View } from 'react-native';
import type { Message, Narrow } from '../types';
import { createStyleSheet } from '../styles';
import LoadingIndicator from '../common/LoadingIndicator';
import SearchEmptyState fr... | /content/code_sandbox/src/search/SearchMessagesCard.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 426 |
```javascript
/* @flow strict-local */
import type { Dispatch, StoreEnhancer } from 'redux';
import { REHYDRATE } from '../actionConstants';
import type { Action, GlobalState as State } from '../types';
import * as logging from '../utils/logging';
const processKey = key => {
const int = parseInt(key, 10);
if (Num... | /content/code_sandbox/src/redux-persist-migrate/index.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 709 |
```javascript
/* @flow strict-local */
import React, { PureComponent } from 'react';
import invariant from 'invariant';
import type { ComponentType } from 'react';
import type { EditingEvent } from 'react-native/Libraries/Components/TextInput/TextInput';
import type { RouteProp } from '../react-navigation';
import typ... | /content/code_sandbox/src/search/SearchMessagesScreen.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 1,673 |
```javascript
/* @flow strict-local */
import type { CaughtUp, CaughtUpState, PerAccountState, Narrow } from '../types';
import { NULL_OBJECT } from '../nullObjects';
import { keyFromNarrow } from '../utils/narrow';
/** The value implicitly represented by a missing entry in CaughtUpState. */
export const DEFAULT_CAUGH... | /content/code_sandbox/src/caughtup/caughtUpSelectors.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 189 |
```javascript
import deepFreeze from 'deep-freeze';
import { getCaughtUpForNarrow } from '../caughtUpSelectors';
import { HOME_NARROW, HOME_NARROW_STR } from '../../utils/narrow';
describe('getCaughtUpForNarrow', () => {
test('if a key with current narrow exists return it', () => {
const state = deepFreeze({
... | /content/code_sandbox/src/caughtup/__tests__/caughtUpSelectors-test.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 214 |
```javascript
/* @flow strict-local */
import type { CaughtUpState, PerAccountApplicableAction } from '../types';
import {
REGISTER_COMPLETE,
MESSAGE_FETCH_START,
MESSAGE_FETCH_ERROR,
MESSAGE_FETCH_COMPLETE,
EVENT_UPDATE_MESSAGE,
EVENT_UPDATE_MESSAGE_FLAGS,
RESET_ACCOUNT_DATA,
} from '../actionConstants';... | /content/code_sandbox/src/caughtup/caughtUpReducer.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 788 |
```javascript
// @flow strict-local
import type { UserId } from '../types';
type NotificationBase = {|
realm_uri: string,
user_id?: UserId,
|};
/**
* The data we need in JS/React code for acting on a notification.
*
* On iOS, these objects are constructed by our JS code from the data the
* Zulip server sends ... | /content/code_sandbox/src/notification/types.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 336 |
```javascript
/* @flow strict-local */
import deepFreeze from 'deep-freeze';
import * as eg from '../../__tests__/lib/exampleData';
import caughtUpReducer from '../caughtUpReducer';
import { MESSAGE_FETCH_ERROR } from '../../actionConstants';
import {
HOME_NARROW,
HOME_NARROW_STR,
keyFromNarrow,
SEARCH_NARROW,... | /content/code_sandbox/src/caughtup/__tests__/caughtUpReducer-test.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 1,662 |
```javascript
/* @flow strict-local */
import PushNotificationIOS from '@react-native-community/push-notification-ios';
import type { Notification } from './types';
import { makeUserId } from '../api/idTypes';
import type { JSONableDict, JSONableInput, JSONableInputDict } from '../utils/jsonable';
import * as logging ... | /content/code_sandbox/src/notification/extract.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 1,623 |
```javascript
/**
* @flow strict-local
*/
import invariant from 'invariant';
import { Platform, PermissionsAndroid } from 'react-native';
import { androidSdkVersion } from '../reactNativeUtils';
/**
* Show dialog requesting POST_NOTIFICATIONS permission if appropriate.
*
* See Android doc:
* path_to_url
*
*... | /content/code_sandbox/src/notification/androidPermission.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 507 |
```javascript
/**
* Opening a notification.
*
* @flow strict-local
*/
import { NativeModules, Platform } from 'react-native';
import PushNotificationIOS from '@react-native-community/push-notification-ios';
import type { Notification } from './types';
import type {
Account,
GlobalThunkAction,
Identity,
Nar... | /content/code_sandbox/src/notification/notifOpen.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 2,180 |
```javascript
/**
* Device tokens for notifications: getting them, reporting them, recording them.
*
* @flow strict-local
*/
import { NativeModules, Platform } from 'react-native';
import PushNotificationIOS from '@react-native-community/push-notification-ios';
import {
GOT_PUSH_TOKEN,
ACK_PUSH_TOKEN,
REGIST... | /content/code_sandbox/src/notification/notifTokens.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 2,539 |
```javascript
/* @flow strict-local */
import { DeviceEventEmitter, Platform, NativeModules, NativeEventEmitter } from 'react-native';
import type { PushNotificationEventName } from '@react-native-community/push-notification-ios';
import PushNotificationIOS from '@react-native-community/push-notification-ios';
import i... | /content/code_sandbox/src/notification/NotificationListener.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 1,219 |
```javascript
/* @flow strict-local */
import * as typing_status from '@zulip/shared/lib/typing_status';
import type { Auth, PerAccountState, Narrow, UserId, ThunkAction } from '../types';
import * as api from '../api';
import { PRESENCE_RESPONSE } from '../actionConstants';
import { getAuth, getServerVersion } from '... | /content/code_sandbox/src/users/usersActions.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 840 |
```javascript
/* @flow strict-local */
import React from 'react';
import type { Node } from 'react';
import { SectionList } from 'react-native';
import { useSelector } from '../react-redux';
import type { UserOrBot } from '../types';
import { createStyleSheet } from '../styles';
import SectionHeader from '../common/Se... | /content/code_sandbox/src/users/UserList.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 608 |
```javascript
/* @flow strict-local */
import type { User, UsersState, PerAccountApplicableAction } from '../types';
import {
REGISTER_COMPLETE,
EVENT_USER_ADD,
EVENT_USER_REMOVE,
EVENT,
RESET_ACCOUNT_DATA,
} from '../actionConstants';
import { EventTypes } from '../api/eventTypes';
import { NULL_ARRAY } from... | /content/code_sandbox/src/users/usersReducer.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 538 |
```javascript
// @flow strict-local
import deepFreeze from 'deep-freeze';
import type { Notification } from '../types';
import type { UserOrBot } from '../../api/modelTypes';
import type { JSONableDict } from '../../utils/jsonable';
import { getNarrowFromNotificationData } from '../notifOpen';
import { topicNarrow, pm... | /content/code_sandbox/src/notification/__tests__/notification-test.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 1,934 |
```javascript
/* @flow strict-local */
import invariant from 'invariant';
import React, { useCallback } from 'react';
import type { Node } from 'react';
import { View } from 'react-native';
import type { UserId, UserOrBot } from '../types';
import ZulipText from '../common/ZulipText';
import Touchable from '../common/... | /content/code_sandbox/src/users/UserItem.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 1,059 |
```javascript
/* @flow strict-local */
// $FlowFixMe[untyped-import]
import uniq from 'lodash.uniq';
import * as typeahead from '@zulip/shared/lib/typeahead';
import type {
MutedUsersState,
UserId,
UserGroup,
PresenceState,
PresenceStatus,
UserOrBot,
} from '../types';
import { ensureUnreachable } from '..... | /content/code_sandbox/src/users/userHelpers.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 1,104 |
```javascript
/* @flow strict-local */
import { createSelector } from 'reselect';
import React from 'react';
import type {
CustomProfileField,
PerAccountState,
UserOrBot,
Selector,
User,
UserId,
LocalizableText,
LocalizableReactText,
} from '../types';
import type { MutedUsersState, RealmState } from '... | /content/code_sandbox/src/users/userSelectors.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 3,852 |
```javascript
/* @flow strict-local */
import {
getAllUsersByEmail,
getAllUsersById,
getUsersById,
getUserForId,
getUserIsActive,
getCustomProfileFieldsForUser,
getDisplayEmailForUser,
} from '../userSelectors';
import * as eg from '../../__tests__/lib/exampleData';
import { CustomProfileFieldType } from ... | /content/code_sandbox/src/users/__tests__/userSelectors-test.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 2,871 |
```javascript
/* @flow strict-local */
import deepFreeze from 'deep-freeze';
import * as eg from '../../__tests__/lib/exampleData';
import { UploadedAvatarURL } from '../../utils/avatar';
import { EVENT_USER_ADD, EVENT } from '../../actionConstants';
import { EventTypes, type RealmUserUpdateEvent } from '../../api/eve... | /content/code_sandbox/src/users/__tests__/usersReducer-test.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 1,239 |
```javascript
/* @flow strict-local */
import deepFreeze from 'deep-freeze';
import Immutable from 'immutable';
import {
sortUserList,
filterUserList,
getAutocompleteSuggestion,
getAutocompleteUserGroupSuggestions,
filterUserStartWith,
filterUserThatContains,
filterUserMatchesEmail,
groupUsersByStatus,... | /content/code_sandbox/src/users/__tests__/userHelpers-test.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 3,674 |
```javascript
/* @flow strict-local */
import React, { useCallback } from 'react';
import type { Node } from 'react';
import type { RouteProp } from '../react-navigation';
import type { AppNavigationProp } from '../nav/AppNavigator';
import { useGlobalSelector, useSelector } from '../react-redux';
import Screen from ... | /content/code_sandbox/src/settings/LegalScreen.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 553 |
```javascript
/* @flow strict-local */
import type { ColorSchemeName } from 'react-native/Libraries/Utilities/NativeAppearance';
import type { ThemeSetting, ThemeName } from '../reduxTypes';
export const getThemeToUse = (theme: ThemeSetting, osScheme: ?ColorSchemeName): ThemeName =>
theme === 'default' ? 'light' : '... | /content/code_sandbox/src/settings/settingsSelectors.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 78 |
```javascript
/* @flow strict-local */
import messagesByLanguage from '../i18n/messagesByLanguage';
export type Language = {|
tag: $Keys<typeof messagesByLanguage>,
name: string,
selfname: string,
|};
/**
* The list of languages we offer in the language settings screen.
*
* The translation data files in `sta... | /content/code_sandbox/src/settings/languages.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 1,403 |
```javascript
/* @flow strict-local */
import React, { useCallback } from 'react';
import type { Node } from 'react';
import invariant from 'invariant';
import type { AppNavigationMethods } from '../nav/AppNavigator';
import { useDispatch, useGlobalSelector, useSelector } from '../react-redux';
import { getAuth, getS... | /content/code_sandbox/src/settings/PerAccountNotificationSettingsGroup.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 2,086 |
```javascript
/* @flow strict-local */
import invariant from 'invariant';
import * as React from 'react';
import { Platform, View, ScrollView, NativeModules } from 'react-native';
import { SafeAreaView } from 'react-native-safe-area-context';
import Clipboard from '@react-native-clipboard/clipboard';
import * as MailC... | /content/code_sandbox/src/settings/NotifTroubleshootingScreen.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 5,657 |
```javascript
/* @flow strict-local */
import type { AccountIndependentAction, GlobalSettingsState } from '../types';
import { SET_GLOBAL_SETTINGS } from '../actionConstants';
export const setGlobalSettings = (
update: $Shape<$Exact<GlobalSettingsState>>,
): AccountIndependentAction => ({
type: SET_GLOBAL_SETTINGS... | /content/code_sandbox/src/settings/settingsActions.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 69 |
```javascript
/* @flow strict-local */
import React, { useCallback, useContext } from 'react';
import type { Node } from 'react';
import { Alert } from 'react-native';
import invariant from 'invariant';
import type { RouteProp } from '../react-navigation';
import type { AppNavigationProp } from '../nav/AppNavigator';... | /content/code_sandbox/src/settings/NotificationsScreen.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 1,076 |
```javascript
/* @flow strict-local */
import type { GlobalSettingsState, PerAccountSettingsState } from '../reduxTypes';
import type { SettingsState, Action } from '../types';
import {
RESET_ACCOUNT_DATA,
SET_GLOBAL_SETTINGS,
REGISTER_COMPLETE,
EVENT_UPDATE_GLOBAL_NOTIFICATIONS_SETTINGS,
EVENT,
} from '../ac... | /content/code_sandbox/src/settings/settingsReducer.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 883 |
```javascript
/* @flow strict-local */
import React, { useCallback } from 'react';
import type { Node } from 'react';
import { nativeApplicationVersion } from 'expo-application';
import invariant from 'invariant';
import type { RouteProp } from '../react-navigation';
import type { AppNavigationProp } from '../nav/App... | /content/code_sandbox/src/settings/SettingsScreen.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 1,456 |
```javascript
/* @flow strict-local */
import invariant from 'invariant';
import { createSelector } from 'reselect';
import type { PerAccountState, PmMessage, PmConversationData, Selector } from '../types';
import { getPrivateMessages } from '../message/messageSelectors';
import { getAllUsersById, getOwnUserId } from ... | /content/code_sandbox/src/pm-conversations/pmConversationsSelectors.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 1,262 |
```javascript
/* @flow strict-local */
import deepFreeze from 'deep-freeze';
import type { SettingsState } from '../../types';
import {
SET_GLOBAL_SETTINGS,
EVENT_UPDATE_GLOBAL_NOTIFICATIONS_SETTINGS,
EVENT,
} from '../../actionConstants';
import type { InitialData } from '../../api/initialDataTypes';
import typ... | /content/code_sandbox/src/settings/__tests__/settingsReducer-test.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 1,578 |
```javascript
/* @flow strict-local */
import React, { useCallback, useMemo } from 'react';
import type { Node } from 'react';
import { FlatList } from 'react-native';
import { useDispatch, useSelector } from '../react-redux';
import type { PmConversationData, UserOrBot } from '../types';
import { type PmKeyUsers } fr... | /content/code_sandbox/src/pm-conversations/PmConversationList.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 522 |
```javascript
/* @flow strict-local */
import React, { useCallback, useContext } from 'react';
import type { Node } from 'react';
import { View } from 'react-native';
import { useSelector } from '../react-redux';
import type { UserOrBot } from '../types';
import styles, { createStyleSheet } from '../styles';
import Gr... | /content/code_sandbox/src/pm-conversations/GroupPmConversationItem.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 599 |
```javascript
/* @flow strict-local */
import React, { useContext } from 'react';
import type { Node } from 'react';
import { View } from 'react-native';
import { SafeAreaView } from 'react-native-safe-area-context';
import type { RouteProp } from '../react-navigation';
import type { MainTabsNavigationProp } from '..... | /content/code_sandbox/src/pm-conversations/PmConversationsScreen.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 573 |
```javascript
/* @flow strict-local */
import Immutable from 'immutable';
import { usersOfKey, keyOfExactUsers, reducer } from '../pmConversationsModel';
import * as eg from '../../__tests__/lib/exampleData';
import { makeUserId } from '../../api/idTypes';
import { randString } from '../../utils/misc';
describe('user... | /content/code_sandbox/src/pm-conversations/__tests__/pmConversationsModel-test.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 1,520 |
```javascript
/* @flow strict-local */
import Immutable from 'immutable';
import invariant from 'invariant';
import {
EVENT_NEW_MESSAGE,
MESSAGE_FETCH_COMPLETE,
REGISTER_COMPLETE,
RESET_ACCOUNT_DATA,
} from '../actionConstants';
import { makeUserId } from '../api/idTypes';
import type { PerAccountApplicableAct... | /content/code_sandbox/src/pm-conversations/pmConversationsModel.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 1,849 |
```javascript
/* @flow strict-local */
import Immutable from 'immutable';
import { getRecentConversations } from '../pmConversationsSelectors';
import { keyOfExactUsers } from '../pmConversationsModel';
import { ALL_PRIVATE_NARROW_STR } from '../../utils/narrow';
import * as eg from '../../__tests__/lib/exampleData';
... | /content/code_sandbox/src/pm-conversations/__tests__/pmConversationsSelectors-test.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 1,780 |
```javascript
/* @flow strict-local */
import invariant from 'invariant';
import {
EVENT,
REGISTER_COMPLETE,
LOGIN_SUCCESS,
ACCOUNT_SWITCH,
ACK_PUSH_TOKEN,
UNACK_PUSH_TOKEN,
LOGOUT,
DISMISS_SERVER_PUSH_SETUP_NOTICE,
ACCOUNT_REMOVE,
SET_SILENCE_SERVER_PUSH_SETUP_WARNINGS,
DISMISS_SERVER_NOTIFS_EXP... | /content/code_sandbox/src/account/accountsReducer.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 1,532 |
```javascript
/* @flow strict-local */
import * as NavigationService from '../nav/NavigationService';
import type { PerAccountAction, AllAccountsAction, GlobalThunkAction, Identity } from '../types';
import {
ACCOUNT_SWITCH,
ACCOUNT_REMOVE,
LOGIN_SUCCESS,
DISMISS_SERVER_PUSH_SETUP_NOTICE,
SET_SILENCE_SERVER_P... | /content/code_sandbox/src/account/accountActions.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 862 |
```javascript
/* @flow strict-local */
import * as NavigationService from '../nav/NavigationService';
import type { PerAccountAction, AllAccountsAction, ThunkAction } from '../types';
import { LOGOUT, RESET_ACCOUNT_DATA } from '../actionConstants';
import { resetToAccountPicker } from '../nav/navActions';
/**
* Reset... | /content/code_sandbox/src/account/logoutActions.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 201 |
```javascript
/* @flow strict-local */
import React, { useContext, useCallback } from 'react';
import type { Node } from 'react';
import invariant from 'invariant';
import { fetchServerSettings } from '../message/fetchActions';
import { TranslationContext } from '../boot/TranslationProvider';
import type { RouteProp ... | /content/code_sandbox/src/account/AccountPickScreen.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 1,199 |
```javascript
/* @flow strict-local */
import { createSelector } from 'reselect';
import invariant from 'invariant';
import type {
Account,
Auth,
PerAccountState,
GlobalState,
Identity,
Selector,
GlobalSelector,
} from '../types';
import { dubPerAccountState, assumeSecretlyGlobalState } from '../reduxTyp... | /content/code_sandbox/src/account/accountsSelectors.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 2,046 |
```javascript
/* @flow strict-local */
import React from 'react';
import type { Node } from 'react';
import { View, FlatList } from 'react-native';
import ViewPlaceholder from '../common/ViewPlaceholder';
import AccountItem from './AccountItem';
import type { AccountStatus } from './AccountPickScreen';
type Props = $... | /content/code_sandbox/src/account/AccountList.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 232 |
```javascript
/* @flow strict-local */
import type { Account, Auth, Identity } from '../types';
const identitySlice = ({ realm, email }): Identity => ({ realm, email });
export const identityOfAuth: Auth => Identity = identitySlice;
export const identityOfAccount: ($ReadOnly<{ ...Identity, ... }>) => Identity = iden... | /content/code_sandbox/src/account/accountMisc.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 148 |
```javascript
import deepFreeze from 'deep-freeze';
import { getAuth } from '../accountsSelectors';
describe('getAuth', () => {
test('throws when no accounts', () => {
const state = deepFreeze({
accounts: [],
});
expect(() => {
getAuth(state);
}).toThrow();
});
test('throws when no... | /content/code_sandbox/src/account/__tests__/accountsSelectors-test.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 230 |
```javascript
/* @flow strict-local */
import React from 'react';
import type { Node } from 'react';
import { Alert, Pressable, View } from 'react-native';
// $FlowFixMe[untyped-import]
import Color from 'color';
import { BRAND_COLOR, createStyleSheet } from '../styles';
import ZulipText from '../common/ZulipText';
im... | /content/code_sandbox/src/account/AccountItem.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 1,630 |
```javascript
/* @flow strict-local */
import deepFreeze from 'deep-freeze';
import {
ACCOUNT_SWITCH,
LOGIN_SUCCESS,
LOGOUT,
ACCOUNT_REMOVE,
EVENT,
} from '../../actionConstants';
import { randString } from '../../utils/misc';
import accountsReducer from '../accountsReducer';
import { ZulipVersion } from '.... | /content/code_sandbox/src/account/__tests__/accountsReducer-test.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 3,004 |
```javascript
// @flow strict-local
import deepFreeze from 'deep-freeze';
import * as resolved_topic from '@zulip/shared/lib/resolved_topic';
import { HOME_NARROW } from '../../utils/narrow';
import * as eg from '../../__tests__/lib/exampleData';
import {
constructMessageActionButtons,
constructTopicActionButtons,... | /content/code_sandbox/src/action-sheets/__tests__/action-sheet-test.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 1,793 |
```javascript
/* @flow strict-local */
// eslint-disable-next-line id-match
import type { ____Styles_Internal } from 'react-native/Libraries/StyleSheet/StyleSheetTypes';
import composeBoxStyles from './composeBoxStyles';
import { statics as miscStyles } from './miscStyles';
import { statics as navStyles } from './navS... | /content/code_sandbox/src/styles/index.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 633 |
```javascript
/* @flow strict-local */
import { Platform } from 'react-native';
import type { MaterialTopTabBarOptions } from '@react-navigation/material-top-tabs';
import type { BottomTabBarOptions } from '@react-navigation/bottom-tabs';
import { BRAND_COLOR } from './constants';
export const bottomTabNavigatorConfi... | /content/code_sandbox/src/styles/tabs.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 685 |
```javascript
/* @flow strict-local */
// $FlowFixMe[untyped-import]
import Color from 'color';
export const CONTROL_SIZE = 44;
export const NAVBAR_SIZE = 58;
// The value `hsl(222, 99%, 69%)` is chosen to match `rgb(100, 146, 253.5)`,
// which is the sRGB midpoint of the Zulip logo's gradient.
//
// Note this color ... | /content/code_sandbox/src/styles/constants.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 262 |
```javascript
/* @flow strict-local */
export default {
// Padding
padding: {
padding: 16,
},
paddingVertical: {
paddingVertical: 16,
},
paddingHorizontal: {
paddingHorizontal: 16,
},
paddingTop: {
paddingTop: 16,
},
paddingBottom: {
paddingBottom: 16,
},
paddingLeft: {
... | /content/code_sandbox/src/styles/utilityStyles.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 400 |
```javascript
/* @flow strict-local */
import { CONTROL_SIZE } from './constants';
export const statics = {
largerText: {
fontSize: 20,
},
row: {
flexDirection: 'row',
alignItems: 'center',
},
listItem: {
flexDirection: 'row',
alignItems: 'center',
paddingVertical: 8,
paddingHoriz... | /content/code_sandbox/src/styles/miscStyles.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 191 |
```javascript
/* @flow strict-local */
import React from 'react';
import type { Context } from 'react';
import type { ThemeName } from '../reduxTypes';
export type ThemeData = {|
themeName: ThemeName,
color: string,
backgroundColor: string,
cardColor: string,
dividerColor: string,
|};
export const themeDat... | /content/code_sandbox/src/styles/theme.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 314 |
```javascript
/* @flow strict-local */
export default {
disabledComposeBox: {
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'space-around',
backgroundColor: 'gray',
paddingHorizontal: 16,
paddingVertical: 8,
},
disabledComposeButton: {
padding: 12,
},
disabledCompose... | /content/code_sandbox/src/styles/composeBoxStyles.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 91 |
```javascript
/* @flow strict-local */
import { BRAND_COLOR } from './constants';
export const statics = {
navWrapper: {
flex: 1,
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'flex-start',
},
navSubtitle: {
fontSize: 13,
},
navTitle: {
color: BRAND_COLOR,
textAlign:... | /content/code_sandbox/src/styles/navStyles.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 93 |
```javascript
// @flow strict-local
import * as React from 'react';
import { Platform } from 'react-native';
import { WebView } from 'react-native-webview';
import * as logging from '../utils/logging';
import { tryParseUrl } from '../utils/url';
import type { ElementConfigFull } from '../reactUtils';
/**
* Return a ... | /content/code_sandbox/src/webview/SinglePageWebView.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 880 |
```javascript
/* @flow strict-local */
// $FlowFixMe[untyped-import]
import isEqual from 'lodash.isequal';
import type { Auth, FlagsState } from '../types';
import type { Props } from './MessageList';
import type { ScrollStrategy } from '../message/scrollStrategy';
import messageListElementHtml from './html/messageLis... | /content/code_sandbox/src/webview/generateInboundEvents.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 1,223 |
```javascript
/* @flow strict-local */
import { Share, Alert } from 'react-native';
import Clipboard from '@react-native-clipboard/clipboard';
import invariant from 'invariant';
import * as resolved_topic from '@zulip/shared/lib/resolved_topic';
import type {
Auth,
Dispatch,
FlagsState,
GetText,
Message,
M... | /content/code_sandbox/src/action-sheets/index.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 8,143 |
```javascript
/* @flow strict-local */
// $FlowFixMe[untyped-import]
import isEqual from 'lodash.isequal';
import invariant from 'invariant';
import type { MessageListElement, GetText } from '../types';
import { ensureUnreachable } from '../generics';
import type { BackgroundData } from './backgroundData';
import mess... | /content/code_sandbox/src/webview/generateInboundEventEditSequence.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 1,930 |
```javascript
// @flow strict-local
import type {
AlertWordsState,
Auth,
FlagsState,
GlobalSettingsState,
ImageEmoji,
MuteState,
MutedUsersState,
PerAccountState,
Subscription,
Stream,
UserId,
User,
UserOrBot,
} from '../types';
import type { UnreadState } from '../unread/unreadModelTypes';
i... | /content/code_sandbox/src/webview/backgroundData.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 851 |
```javascript
/* @flow strict-local */
import { Alert } from 'react-native';
import Clipboard from '@react-native-clipboard/clipboard';
import * as api from '../api';
import config from '../config';
import type { UserId } from '../types';
import type { JSONableDict } from '../utils/jsonable';
import { showConfirmation... | /content/code_sandbox/src/webview/handleOutboundEvents.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 2,470 |
```javascript
/* @flow strict-local */
import template from './template';
const messageLoadingHtml = template`
<div class="loading">
<div class="loading-avatar"></div>
<div class="loading-content">
<div class="loading-subheader">
<div class="block name"></div>
<div class="block msg-timestamp show">... | /content/code_sandbox/src/webview/html/htmlBody.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 473 |
```javascript
/* @flow strict-local */
import type { GetText, MessageListElement } from '../../types';
import { ensureUnreachable } from '../../generics';
import type { BackgroundData } from '../backgroundData';
import message from './message';
import header from './header';
import time from './time';
export default ... | /content/code_sandbox/src/webview/html/messageListElementHtml.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 175 |
```javascript
/* @flow strict-local */
import type { FlagsState } from '../../types';
/* eslint-disable */
/*
* The bulk of this code is taken verbatim from the webapp:
* path_to_url
* in order to avoid multiple implementations of this rather tricky logic.
* To permit that, we disable ESLint and Prettier.
*
* ... | /content/code_sandbox/src/webview/html/processAlertWords.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 675 |
```javascript
/* @flow strict-local */
// $FlowFixMe[untyped-import]
import escape from 'lodash.escape';
/**
* As an ES6 template tag, escapes HTML in interpolated values,
* except where marked.
*
* To mark a value as HTML to be included raw, use '$!$' instead of '$':
* template`Hello ${&<world}` -> 'Hello &... | /content/code_sandbox/src/webview/html/template.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 300 |
```javascript
/* @flow strict-local */
import template from './template';
import type { TimeMessageListElement } from '../../types';
import { humanDate } from '../../utils/date';
/**
* The HTML string for a message-list element of the "time" type.
*
* This is a private helper of messageListElementHtml.
*/
export d... | /content/code_sandbox/src/webview/html/time.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 138 |
```javascript
/* @flow strict-local */
import * as React from 'react';
import { useContext, useState } from 'react';
import { Platform, NativeModules } from 'react-native';
import { WebView } from 'react-native-webview';
// $FlowFixMe[untyped-import]
import { useActionSheet } from '@expo/react-native-action-sheet';
im... | /content/code_sandbox/src/webview/MessageList.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 3,508 |
```javascript
/* @flow strict-local */
import template from './template';
import type { Auth, ThemeName } from '../../types';
import css from '../css/css';
import htmlBody from './htmlBody';
import script from '../js/script';
import type { ServerEmojiData } from '../../api/modelTypes';
type InitOptionsType = {|
scro... | /content/code_sandbox/src/webview/html/html.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 477 |
```javascript
/* @flow strict-local */
import { PixelRatio } from 'react-native';
import template from './template';
import type { UserOrBot } from '../../types';
const typingAvatar = (realm: URL, user: UserOrBot): string => template`
<div class="avatar">
<img
class="avatar-img"
data-sender-id="${user.user_... | /content/code_sandbox/src/webview/html/messageTypingAsHtml.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 207 |
```javascript
/* @flow strict-local */
import invariant from 'invariant';
import template from './template';
import { ensureUnreachable } from '../../types';
import type { GetText, HeaderMessageListElement } from '../../types';
import type { BackgroundData } from '../backgroundData';
import {
streamNarrow,
topicNa... | /content/code_sandbox/src/webview/html/header.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 1,002 |
```javascript
/* @flow strict-local */
import * as eg from '../../../__tests__/lib/exampleData';
import header from '../header';
import type { BackgroundData } from '../../backgroundData';
import { makeMuteState } from '../../../mute/__tests__/mute-testlib';
import { mock_ } from '../../../__tests__/lib/intl';
const ... | /content/code_sandbox/src/webview/html/__tests__/header-test.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 282 |
```javascript
/* @flow strict-local */
// $FlowFixMe[untyped-import]
import escape from 'lodash.escape';
import template from '../template';
describe('template', () => {
const evil = '<alert />&';
const escaped = escape(evil);
test('interpolates', () => {
expect(template``).toEqual('');
expect(templ... | /content/code_sandbox/src/webview/html/__tests__/template-test.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 200 |
```javascript
/* @flow strict-local */
import messageTypingAsHtml from '../messageTypingAsHtml';
import * as eg from '../../../__tests__/lib/exampleData';
describe('typing', () => {
it('escapes &< (e.g., in `avatar_url` and `email`', () => {
const name = '&<name';
const user = eg.makeUser({ full_name: name, ... | /content/code_sandbox/src/webview/html/__tests__/render-test.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 118 |
```javascript
/* @flow strict-local */
import { PixelRatio } from 'react-native';
import invariant from 'invariant';
import formatDistanceToNow from 'date-fns/formatDistanceToNow';
import * as poll_data from '@zulip/shared/lib/poll_data';
import template from './template';
import type {
AggregatedReaction,
FlagsSt... | /content/code_sandbox/src/webview/html/message.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 2,718 |
```javascript
/* @flow strict-local */
export default `
body {
color: hsl(210, 11%, 85%);
background: hsl(212, 28%, 18%);
}
.poll-vote {
color: hsl(210, 11%, 85%);
}
.topic-header {
background: hsl(212, 13%, 38%);
}
.msg-timestamp {
background: hsl(212, 28%, 25%);
}
.highlight {
background-color: hsla(51, ... | /content/code_sandbox/src/webview/css/cssNight.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 140 |
```javascript
import processAlertWords from '../processAlertWords';
const alertWords = ['alertone', 'alerttwo', 'alertthree', 'al*rt.*s', '.+', 'emoji'];
describe('processAlertWords', () => {
test('if msg id is not in has_alert_word flags, return original content', () => {
const flags = {
has_alert_word: ... | /content/code_sandbox/src/webview/html/__tests__/processAlertWords-test.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 719 |
```javascript
/* @flow strict-local */
import { Platform } from 'react-native';
import type { ThemeName } from '../../types';
import cssPygments from './cssPygments';
import cssEmojis from './cssEmojis';
import cssNight from './cssNight';
import type { ServerEmojiData } from '../../api/modelTypes';
/**
* Fix KaTeX fr... | /content/code_sandbox/src/webview/css/css.js | javascript | 2016-05-08T05:41:48 | 2024-08-15T07:25:47 | zulip-mobile | zulip/zulip-mobile | 1,274 | 350 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.