SelectTheme.js 553 B

123456789101112131415161718192021222324
  1. const themes = {
  2. textmate: "textmate",
  3. monokai: "monokai",
  4. xcode: "xcode",
  5. twilight: "twilight",
  6. terminal: "terminal",
  7. github: "github",
  8. tomorrow: "tomorrow",
  9. kuroir: "kuroir",
  10. solarized_dark: "solarized_dark",
  11. solarized_light: "solarized_light",
  12. };
  13. export const SelectTheme = ({ listObj = themes, onChange, value }) => {
  14. return (
  15. <select value={value} onChange={e => onChange(e.target.value)}>
  16. {Object.entries(listObj).map(([value, text]) => (
  17. <option value={value} key={value}>
  18. {text}
  19. </option>
  20. ))}
  21. </select>
  22. );
  23. };