You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
783 B

3 years ago
3 years ago
3 years ago
3 years ago
  1. import React, {useContext, useEffect} from "react";
  2. import {Page} from "../primitives/Layout";
  3. import DataContext from "../contexts/DataContext";
  4. import {IconElement} from "../primitives/Elements";
  5. import DialogContext from "../contexts/DialogContext";
  6. import {DialogType} from "../models/Dialog";
  7. const SettingsPage: React.FC = () => {
  8. const {setDialog} = useContext(DialogContext);
  9. const {colorPresets} = useContext(DataContext);
  10. useEffect(() => {
  11. }, []);
  12. return (
  13. <Page title="Oppsett">
  14. <h1>Definerte farger</h1>
  15. {colorPresets.map(cp => (
  16. <IconElement key={cp.id} color={cp.value} caption={cp.name}/>
  17. ))}
  18. <button onClick={() => setDialog({type: DialogType.AddColor})}>Add</button>
  19. </Page>
  20. );
  21. };
  22. export default SettingsPage;