Files
mattermost-mobile/app/screens/settings/display_theme/custom_theme.tsx
Elias Nahum 2fc1386b78 feat: Channel notification preferences (#7160)
* feat: Channel notification preferences

* feedback review

* use button color for the icon
2023-02-24 12:41:36 +02:00

37 lines
1.2 KiB
TypeScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import React from 'react';
import {useIntl} from 'react-intl';
import SettingOption from '@components/settings/option';
import SettingSeparator from '@components/settings/separator';
import {useTheme} from '@context/theme';
const radioItemProps = {checkedBody: true};
type CustomThemeProps = {
setTheme: (themeKey: string) => void;
displayTheme: string | undefined;
}
const CustomTheme = ({setTheme, displayTheme}: CustomThemeProps) => {
const intl = useIntl();
const theme = useTheme();
return (
<>
<SettingSeparator isGroupSeparator={true}/>
<SettingOption
action={setTheme}
type='select'
value={theme.type}
label={intl.formatMessage({id: 'settings_display.custom_theme', defaultMessage: 'Custom Theme'})}
selected={theme.type?.toLowerCase() === displayTheme?.toLowerCase()}
radioItemProps={radioItemProps}
testID='theme_display_settings.custom.option'
/>
</>
);
};
export default CustomTheme;