From faecb35fe0197ddc025b971aa9538d5ddbdea713 Mon Sep 17 00:00:00 2001 From: Thibaut Girka Date: Mon, 1 Oct 2018 17:40:56 +0200 Subject: Switch from selects to radio buttons for local settings, improve styling --- .../features/local_settings/page/item/index.js | 93 ++++++++++++---------- 1 file changed, 49 insertions(+), 44 deletions(-) (limited to 'app/javascript/flavours/glitch/features/local_settings/page') diff --git a/app/javascript/flavours/glitch/features/local_settings/page/item/index.js b/app/javascript/flavours/glitch/features/local_settings/page/item/index.js index fe237f11e..eacc7419c 100644 --- a/app/javascript/flavours/glitch/features/local_settings/page/item/index.js +++ b/app/javascript/flavours/glitch/features/local_settings/page/item/index.js @@ -48,57 +48,62 @@ export default class LocalSettingsPageItem extends React.PureComponent { if (options && options.length > 0) { const currentValue = settings.getIn(item); - const optionElems = options && options.length > 0 && options.map((opt) => ( - - )); - return ( - + checked={ currentValue === opt.value } + disabled={!enabled} + /> + {opt.message} + + ); + }); + return ( +
+
+ {children} + {optionElems} +
+
); } else if (placeholder) { return ( - +
+ +
); } else return ( - +
+ +
); } -- cgit