@@ -34,6 +34,7 @@ import PosthogTrackers from "../../../PosthogTrackers";
3434import StyledRadioButton from '../elements/StyledRadioButton' ;
3535import { Theme } from '../../../settings/enums/Theme' ;
3636import { UserNameColorMode } from '../../../settings/enums/UserNameColorMode' ;
37+ import { BorderRadius } from '../../../settings/enums/BorderRadius' ;
3738
3839interface IProps {
3940}
@@ -42,6 +43,7 @@ interface IThemeState {
4243 lightTheme : string ;
4344 darkTheme : string ;
4445 themeInUse : Theme ;
46+ borderRadius : BorderRadius ;
4547}
4648
4749export interface CustomThemeMessage {
@@ -68,6 +70,7 @@ export default class ThemeChoicePanel extends React.Component<IProps, IState> {
6870 lightTheme : SettingsStore . getValue ( "light_theme" ) ,
6971 darkTheme : SettingsStore . getValue ( "dark_theme" ) ,
7072 themeInUse : SettingsStore . getValue ( "theme_in_use" ) ,
73+ borderRadius : SettingsStore . getValue ( "borderRadius" ) ,
7174 customThemeUrl : "" ,
7275 customThemeMessage : { isError : false , text : "" } ,
7376 showAdvancedThemeSettings : false ,
@@ -120,6 +123,12 @@ export default class ThemeChoicePanel extends React.Component<IProps, IState> {
120123 dis . dispatch < RecheckThemePayload > ( { action : Action . RecheckTheme } ) ;
121124 } ;
122125
126+ private onBorderRadiusChange = ( e : React . ChangeEvent < HTMLInputElement > ) : void => {
127+ const borderRadius = e . target . value as BorderRadius ;
128+ this . setState ( { borderRadius : borderRadius } ) ;
129+ SettingsStore . setValue ( "borderRadius" , null , SettingLevel . DEVICE , borderRadius ) ;
130+ } ;
131+
123132 private onAddCustomTheme = async ( ) : Promise < void > => {
124133 let currentThemes : string [ ] = SettingsStore . getValue ( "custom_themes" ) ;
125134 if ( ! currentThemes ) currentThemes = [ ] ;
@@ -271,6 +280,49 @@ export default class ThemeChoicePanel extends React.Component<IProps, IState> {
271280 }
272281 </ div > ;
273282
283+ const borderRadiusSection = < div className = "mx_SettingsTab_inlineRadioSelectors" >
284+ < label >
285+ < StyledRadioButton
286+ name = "border_radius"
287+ value = { BorderRadius . Default }
288+ checked = { this . state . borderRadius === BorderRadius . Default }
289+ onChange = { this . onBorderRadiusChange }
290+ >
291+ { _t ( "Default" ) }
292+ </ StyledRadioButton >
293+ </ label >
294+ < label >
295+ < StyledRadioButton
296+ name = "border_radius"
297+ value = { BorderRadius . Round }
298+ checked = { this . state . borderRadius === BorderRadius . Round }
299+ onChange = { this . onBorderRadiusChange }
300+ >
301+ { _t ( "Round" ) }
302+ </ StyledRadioButton >
303+ </ label >
304+ < label >
305+ < StyledRadioButton
306+ name = "border_radius"
307+ value = { BorderRadius . ExtraRound }
308+ checked = { this . state . borderRadius === BorderRadius . ExtraRound }
309+ onChange = { this . onBorderRadiusChange }
310+ >
311+ { _t ( "Extra round" ) }
312+ </ StyledRadioButton >
313+ </ label >
314+ < label >
315+ < StyledRadioButton
316+ name = "border_radius"
317+ value = { BorderRadius . Mixed }
318+ checked = { this . state . borderRadius === BorderRadius . Mixed }
319+ onChange = { this . onBorderRadiusChange }
320+ >
321+ { _t ( "Mixed" ) }
322+ </ StyledRadioButton >
323+ </ label >
324+ </ div > ;
325+
274326 let customThemeForm : JSX . Element ;
275327 if ( SettingsStore . getValue ( "feature_custom_themes" ) ) {
276328 let messageElement = null ;
@@ -364,6 +416,10 @@ export default class ThemeChoicePanel extends React.Component<IProps, IState> {
364416 < span className = "mx_SettingsTab_subheading" > { _t ( "Theme in use" ) } </ span >
365417 { themeInUseSection }
366418 </ div >
419+ < div className = "mx_SettingsTab_section mx_ThemeChoicePanel_borderRadiusSection" >
420+ < span className = "mx_SettingsTab_subheading" > { _t ( "Corners" ) } </ span >
421+ { borderRadiusSection }
422+ </ div >
367423 < div className = "mx_SettingsTab_section mx_ThemeChoicePanel_Advanced" >
368424 { toggle }
369425 { advanced }
0 commit comments