mattermost-mobile/app/screens/settings/display_theme/custom_theme.tsx
Daniel Espino García a27c82da90
Refactor and cleanup of option item (#9067)
* Refactor and cleanup of option item

* Fix tests and minor cleanup

* Fix bug and address feedback
2025-08-19 14:01:56 +02:00

35 lines
1.1 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';
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={'custom'}
label={intl.formatMessage({id: 'settings_display.custom_theme', defaultMessage: 'Custom Theme'})}
selected={theme.type?.toLowerCase() === displayTheme?.toLowerCase()}
testID='theme_display_settings.custom.option'
isRadioCheckmark={true}
/>
</>
);
};
export default CustomTheme;