2023-01-03 19:55:46 +00:00
|
|
|
// Copyright 2019 Signal Messenger, LLC
|
2020-10-30 20:34:04 +00:00
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
2019-05-16 22:32:11 +00:00
|
|
|
import { connect } from 'react-redux';
|
|
|
|
import { mapDispatchToProps } from '../actions';
|
|
|
|
import { StickerManager } from '../../components/stickers/StickerManager';
|
2021-10-26 19:15:33 +00:00
|
|
|
import type { StateType } from '../reducer';
|
2019-05-16 22:32:11 +00:00
|
|
|
|
|
|
|
import { getIntl } from '../selectors/user';
|
|
|
|
import {
|
|
|
|
getBlessedStickerPacks,
|
|
|
|
getInstalledStickerPacks,
|
2019-05-24 01:27:42 +00:00
|
|
|
getKnownStickerPacks,
|
2019-05-16 22:32:11 +00:00
|
|
|
getReceivedStickerPacks,
|
|
|
|
} from '../selectors/stickers';
|
|
|
|
|
|
|
|
const mapStateToProps = (state: StateType) => {
|
|
|
|
const blessedPacks = getBlessedStickerPacks(state);
|
|
|
|
const receivedPacks = getReceivedStickerPacks(state);
|
|
|
|
const installedPacks = getInstalledStickerPacks(state);
|
2019-05-24 01:27:42 +00:00
|
|
|
const knownPacks = getKnownStickerPacks(state);
|
2019-05-16 22:32:11 +00:00
|
|
|
|
|
|
|
return {
|
|
|
|
blessedPacks,
|
|
|
|
receivedPacks,
|
|
|
|
installedPacks,
|
2019-05-24 01:27:42 +00:00
|
|
|
knownPacks,
|
2019-05-16 22:32:11 +00:00
|
|
|
i18n: getIntl(state),
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
const smart = connect(mapStateToProps, mapDispatchToProps);
|
|
|
|
|
|
|
|
export const SmartStickerManager = smart(StickerManager);
|