MovieCast / desktop

MovieCast Desktop - The Application of MovieCast
https://moviecast.io
MIT License
10 stars 1 forks source link

[SettingsCategoryListItem] Better configuration for options #10

Closed paulhobbel closed 6 years ago

paulhobbel commented 7 years ago

Description

The SettingsCategoryListItem are very nice, however there is one downside. There is almost no customization available for options for a selectable Settings option.

<SettingsCategoryListItem
  icon={<LanguageIcon />}
  text="Default Language"
  value={settings.ui.language}
  options={['English', 'Dutch']}
  onOptionsClick={(event, index, value) => changeSettings({ ui: { language: value } })}
/>

As seen here the options prop is just an array of values, wouldn't it be better if you could for example send an array of objects.

let options = [
  {
     label: 'English',
     value: 'english'
  }
];

By using new way it would be lot easier to use a value which differs from the text shown to the user. PS: If this would be changed the onOptionsClick wont return an index anymore but just the value.

paulhobbel commented 6 years ago

This has been fixed in 872e6413253955bd6f8c6161e72f7becf43fcc51