How to use the mattermost-redux/selectors/entities/preferences.getTheme function in mattermost-redux

To help you get started, we’ve selected a few mattermost-redux examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mattermost / mattermost-mobile / app / components / post_header / index.js View on Github external
const enableTimezone = isTimezoneEnabled(state);
        const userTimezone = enableTimezone ? getUserCurrentTimezone(currentUser.timezone) : '';

        return {
            commentedOnDisplayName: ownProps.commentedOnUserId ? displayUsername(commentedOnUser, teammateNameDisplay) : '',
            commentCount: getCommentCountForPost(state, {post}),
            createAt: post.create_at,
            displayName: displayUsername(user, teammateNameDisplay),
            enablePostUsernameOverride: config.EnablePostUsernameOverride === 'true',
            fromWebHook: post?.props?.from_webhook === 'true', // eslint-disable-line camelcase
            militaryTime,
            isPendingOrFailedPost: isPostPendingOrFailed(post),
            isSystemMessage: isSystemMessage(post),
            fromAutoResponder: fromAutoResponder(post),
            overrideUsername: post?.props?.override_username, // eslint-disable-line camelcase
            theme: getTheme(state),
            username: user.username,
            isBot: user.is_bot || false,
            isGuest: isGuest(user),
            isLandscape: isLandscape(state),
            userTimezone,
        };
    };
}
github mattermost / mattermost-mobile / app / actions / navigation / index.js View on Github external
function getThemeFromState() {
    const state = store.getState();

    return getTheme(state);
}
github mattermost / mattermost-mobile / app / components / autocomplete / at_mention / index.js View on Github external
teamMembers = filterMembersInCurrentTeam(state, matchTerm);
    } else {
        inChannel = filterMembersInChannel(state, matchTerm);
        outChannel = filterMembersNotInChannel(state, matchTerm);
    }

    return {
        currentChannelId,
        currentTeamId: getCurrentTeamId(state),
        defaultChannel: getDefaultChannel(state),
        matchTerm,
        teamMembers,
        inChannel,
        outChannel,
        requestStatus: state.requests.users.autocompleteUsers.status,
        theme: getTheme(state),
        isLandscape: isLandscape(state),
    };
}
github mattermost / mattermost-mobile / app / screens / post_options / index.js View on Github external
return {
            ...getDimensions(state),
            canAddReaction,
            canReply,
            canCopyPermalink,
            canCopyText,
            canEdit,
            canEditUntil,
            canDelete,
            canFlag,
            canPin,
            currentTeamUrl: getCurrentTeamUrl(state),
            currentUserId,
            isMyPost: currentUserId === post.user_id,
            theme: getTheme(state),
            isLandscape: isLandscape(state),
        };
    };
}
github mattermost / mattermost-mobile / app / screens / settings / notification_settings_auto_responder / index.js View on Github external
function mapStateToProps(state) {
    const currentUserId = getCurrentUserId(state);
    const currentUserStatus = getStatusForUserId(state, currentUserId);

    return {
        theme: getTheme(state),
        currentUserStatus,
        isLandscape: isLandscape(state),
    };
}
github mattermost / mattermost-mobile / app / components / profile_picture / index.js View on Github external
function mapStateToProps(state, ownProps) {
    let status = ownProps.status;
    const user = getUser(state, ownProps.userId);
    if (!status && ownProps.userId) {
        status = getStatusForUserId(state, ownProps.userId);
    }

    const isCurrentUser = getCurrentUserId(state) === ownProps.userId;
    let profileImageUri = '';
    if (isCurrentUser) {
        profileImageUri = getProfileImageUri(state);
    }

    return {
        isCurrentUser,
        theme: getTheme(state),
        profileImageUri,
        status,
        user,
    };
}
github mattermost / mattermost-mobile / app / components / autocomplete / index.js View on Github external
function mapStateToProps(state) {
    const {deviceHeight} = getDimensions(state);
    return {
        deviceHeight,
        theme: getTheme(state),
    };
}
github mattermost / mattermost-mobile / app / components / autocomplete / at_mention_item / index.js View on Github external
function mapStateToProps(state, ownProps) {
    const user = getUser(state, ownProps.userId);

    return {
        firstName: user.first_name,
        lastName: user.last_name,
        username: user.username,
        isBot: Boolean(user.is_bot),
        theme: getTheme(state),
    };
}