import React from "react" import * as antd from "antd" import { UnsplashBrowser } from "./components" import "./index.less" export default [ { "id": "compactWidth", "title": "Compact Width", "description": "Sets the width of the app to a compact width to facilitate the vision of components.", "component": "Switch", "icon": "MdCompress", "group": "layout", "experimental": true, "storaged": true }, { "id": "reduceAnimations", "storaged": true, "group": "aspect", "component": "Switch", "icon": "MdOutlineAnimation", "title": "Reduce animation", "experimental": true }, { "id": "auto_darkMode", "experimental": true, "storaged": true, "group": "aspect", "component": "Switch", "icon": "Moon", "title": "Auto dark mode", "emitEvent": "style.autoDarkModeToogle", }, { "experimental": true, "dependsOn": { "auto_darkMode": false }, "id": "darkMode", "storaged": true, "group": "aspect", "component": "Switch", "icon": "Moon", "title": "Dark mode", "emitEvent": "theme.applyVariant", "emissionValueUpdate": (value) => { return value ? "dark" : "light" }, }, { "id": "primaryColor", "storaged": true, "group": "aspect", "component": "SliderColorPicker", "title": "Primary color", "description": "Change primary color of the application.", "emitEvent": "modifyTheme", "reloadValueOnUpdateEvent": "resetTheme", "emissionValueUpdate": (value) => { return { primaryColor: value } } }, { "id": "backgroundImage", "storaged": true, "group": "aspect", "title": "Background image", "description": "Change background image of the application. You can use a local image or a remote image (URL).", "component": (props) => { const [validUrl, setValidUrl] = React.useState(true) const submitUrl = (e) => { const url = e.target.value // validate if value recived is url if (!url.match(/^(http(s)?:\/\/)?(www\.)?[a-zA-Z0-9]+\.[a-zA-Z]+(\.[a-zA-Z]+)?(\/.*)?$/)) { setValidUrl(false) antd.message.error("Invalid URL") return } props.ctx.dispatchUpdate(url) } const onClickSearchUnsplash = () => { antd.message.warn("This feature is not implemented yet.") return false window.app.SidedrawerController.open("unsplashBrowser", UnsplashBrowser) } return