Customized antd theme.

This commit is contained in:
Daan Vanden Bosch 2019-06-01 17:57:27 +02:00
parent 0c9218be16
commit 6cfcb6fac0
6 changed files with 156 additions and 11 deletions

1
.env.development Normal file
View File

@ -0,0 +1 @@
BROWSER=none

42
antd.customize.less Normal file
View File

@ -0,0 +1,42 @@
@primary-color: hsl(200, 100%, 50%);
@white: #000;
@black: #fff;
@primary-1: fade(@primary-color, 50%);
@primary-2: fade(@primary-color, 40%);
@body-background: hsl(200, 10%, 20%);
@component-background: @body-background;
@text-color: hsl(200, 10%, 90%);
@text-color-secondary: hsl(200, 20%, 80%);
@heading-color: fade(@black, 85%);
@border-radius-base: 2px;
@border-radius-sm: 0px;
@background-color-light: lighten(@body-background, 20%); // background of header and selected item
@background-color-base: fade(@primary-color, 20%); // Default grey background color
@item-active-bg: fade(@primary-color, 20%);
@item-hover-bg: fade(@primary-color, 10%);
@border-color-base: lighten(@body-background, 20%); // base border outline a component
@border-color-split: lighten(@body-background, 10%); // split border inside a component
// Disabled states
@disabled-color: fade(#fff, 50%);
// Input
@input-bg: darken(@body-background, 10%);
// Buttons
@btn-default-bg: lighten(@body-background, 10%);
// Modal
@modal-mask-bg: fade(black, 80%);
// Table
@table-selected-row-bg: @item-active-bg;
@table-row-hover-bg: @item-hover-bg;

5
craco.config.js Normal file
View File

@ -0,0 +1,5 @@
const CracoAntDesignPlugin = require("craco-antd");
module.exports = {
plugins: [{ plugin: CracoAntDesignPlugin }]
};

View File

@ -3,12 +3,14 @@
"version": "0.1.0", "version": "0.1.0",
"private": true, "private": true,
"dependencies": { "dependencies": {
"@craco/craco": "^5.2.1",
"@types/jest": "24.0.13", "@types/jest": "24.0.13",
"@types/lodash": "^4.14.132", "@types/lodash": "^4.14.132",
"@types/react": "16.8.18", "@types/react": "16.8.18",
"@types/react-dom": "16.8.4", "@types/react-dom": "16.8.4",
"@types/text-encoding": "^0.0.35", "@types/text-encoding": "^0.0.35",
"antd": "^3.19.1", "antd": "^3.19.1",
"craco-antd": "^1.11.0",
"lodash": "^4.17.11", "lodash": "^4.17.11",
"mobx": "^5.9.4", "mobx": "^5.9.4",
"mobx-react": "^5.4.4", "mobx-react": "^5.4.4",
@ -21,10 +23,9 @@
"typescript": "3.4.5" "typescript": "3.4.5"
}, },
"scripts": { "scripts": {
"start": "react-scripts start", "start": "craco start",
"build": "react-scripts build", "build": "craco build",
"test": "react-scripts test", "test": "craco test",
"eject": "react-scripts eject",
"updateDropsEphinea": "ts-node --project=tsconfig-scripts.json src/static/updateDropsEphinea.ts" "updateDropsEphinea": "ts-node --project=tsconfig-scripts.json src/static/updateDropsEphinea.ts"
}, },
"eslintConfig": { "eslintConfig": {

View File

@ -50,8 +50,10 @@ export class QuestEditorComponent extends React.Component<{}, {
); );
} }
private saveAsClicked = (filename: string) => { private saveAsClicked = (filename?: string) => {
const name = filename.endsWith('.qst') ? filename.slice(0, -4) : filename; const name = filename
? filename.endsWith('.qst') ? filename.slice(0, -4) : filename
: this.state.saveDialogFilename;
this.setState({ this.setState({
saveDialogOpen: true, saveDialogOpen: true,
@ -74,9 +76,9 @@ export class QuestEditorComponent extends React.Component<{}, {
} }
@observer @observer
class Toolbar extends React.Component<{ onSaveAsClicked: (filename: string) => void }> { class Toolbar extends React.Component<{ onSaveAsClicked: (filename?: string) => void }> {
state = { state = {
filename: 'Choose file...' filename: undefined
} }
render() { render() {
@ -92,7 +94,7 @@ class Toolbar extends React.Component<{ onSaveAsClicked: (filename: string) => v
showUploadList={false} showUploadList={false}
onChange={this.setFilename} onChange={this.setFilename}
> >
<Button icon="file">{this.state.filename}</Button> <Button icon="file">{this.state.filename || 'Choose file...'}</Button>
</Upload> </Upload>
{areas && ( {areas && (
<Select <Select

View File

@ -928,6 +928,15 @@
exec-sh "^0.3.2" exec-sh "^0.3.2"
minimist "^1.2.0" minimist "^1.2.0"
"@craco/craco@^5.2.1":
version "5.2.1"
resolved "https://registry.yarnpkg.com/@craco/craco/-/craco-5.2.1.tgz#d0a8dd7f1eb1c55a7430a5f12534a4ccfbeb8cd0"
integrity sha512-NJfGDeDbDd7yzHvnnf1pTpHg661RtQsC4J5g1qs0lswV+DnVcwG4vrQFdnKm/DkWNzk7lJuG0AdadM2IKMtx+A==
dependencies:
cross-spawn "^6.0.5"
lodash.mergewith "^4.6.1"
webpack-merge "^4.2.1"
"@csstools/convert-colors@^1.4.0": "@csstools/convert-colors@^1.4.0":
version "1.4.0" version "1.4.0"
resolved "https://registry.yarnpkg.com/@csstools/convert-colors/-/convert-colors-1.4.0.tgz#ad495dc41b12e75d588c6db8b9834f08fa131eb7" resolved "https://registry.yarnpkg.com/@csstools/convert-colors/-/convert-colors-1.4.0.tgz#ad495dc41b12e75d588c6db8b9834f08fa131eb7"
@ -2049,6 +2058,14 @@ babel-plugin-dynamic-import-node@2.2.0:
dependencies: dependencies:
object.assign "^4.1.0" object.assign "^4.1.0"
babel-plugin-import@^1.11.0:
version "1.12.0"
resolved "https://registry.yarnpkg.com/babel-plugin-import/-/babel-plugin-import-1.12.0.tgz#12d50950aecfd8de3f10880730221f0f0843a755"
integrity sha512-3Fo7sJ2Hm71y1VJS7eMA/E7J5+roKJmzwia5BxzUQREBs6CRylwtvQq8m39W8nplG4Y7rZwOCndh5MzRTSmHpA==
dependencies:
"@babel/helper-module-imports" "^7.0.0"
"@babel/runtime" "^7.0.0"
babel-plugin-istanbul@^5.1.0: babel-plugin-istanbul@^5.1.0:
version "5.1.4" version "5.1.4"
resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-5.1.4.tgz#841d16b9a58eeb407a0ddce622ba02fe87a752ba" resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-5.1.4.tgz#841d16b9a58eeb407a0ddce622ba02fe87a752ba"
@ -2668,6 +2685,11 @@ clone-deep@^2.0.1:
kind-of "^6.0.0" kind-of "^6.0.0"
shallow-clone "^1.0.0" shallow-clone "^1.0.0"
clone@^2.1.1, clone@^2.1.2:
version "2.1.2"
resolved "https://registry.yarnpkg.com/clone/-/clone-2.1.2.tgz#1b7f4b9f591f1e8f83670401600345a02887435f"
integrity sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18=
co@^4.6.0: co@^4.6.0:
version "4.6.0" version "4.6.0"
resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184"
@ -2955,6 +2977,24 @@ cosmiconfig@^5.0.0, cosmiconfig@^5.2.0:
js-yaml "^3.13.0" js-yaml "^3.13.0"
parse-json "^4.0.0" parse-json "^4.0.0"
craco-antd@^1.11.0:
version "1.11.0"
resolved "https://registry.yarnpkg.com/craco-antd/-/craco-antd-1.11.0.tgz#1be6f674c78d675c13bd606e1cc759378c695c63"
integrity sha512-N5xyCV31bIyLWLeWgZ1sIYF6ut9gNQbU2FggvEU1N7NZeltj116dqtLibkzd/6I9jaynEir68tGdkiCc1cC3+w==
dependencies:
babel-plugin-import "^1.11.0"
craco-less "^1.9.0"
less-vars-to-js "^1.3.0"
craco-less@^1.9.0:
version "1.9.0"
resolved "https://registry.yarnpkg.com/craco-less/-/craco-less-1.9.0.tgz#cef151da42d01c6563e6a7ae49b01bf07004c994"
integrity sha512-lwdjiYVLMemr40ioorYOw1W4u/9cmvZgtlPpEfhAOcXxr93sk+LxpkZMy8uxRAD1FAibKu7ZobX4selXBwqI6A==
dependencies:
less "^3.8.1"
less-loader "^4.1.0"
webpack "4.29.6"
create-ecdh@^4.0.0: create-ecdh@^4.0.0:
version "4.0.3" version "4.0.3"
resolved "https://registry.yarnpkg.com/create-ecdh/-/create-ecdh-4.0.3.tgz#c9111b6f33045c4697f144787f9254cdc77c45ff" resolved "https://registry.yarnpkg.com/create-ecdh/-/create-ecdh-4.0.3.tgz#c9111b6f33045c4697f144787f9254cdc77c45ff"
@ -3704,7 +3744,7 @@ entities@^1.1.1, entities@~1.1.1:
resolved "https://registry.yarnpkg.com/entities/-/entities-1.1.2.tgz#bdfa735299664dfafd34529ed4f8522a275fea56" resolved "https://registry.yarnpkg.com/entities/-/entities-1.1.2.tgz#bdfa735299664dfafd34529ed4f8522a275fea56"
integrity sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w== integrity sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==
errno@^0.1.3, errno@~0.1.7: errno@^0.1.1, errno@^0.1.3, errno@~0.1.7:
version "0.1.7" version "0.1.7"
resolved "https://registry.yarnpkg.com/errno/-/errno-0.1.7.tgz#4684d71779ad39af177e3f007996f7c67c852618" resolved "https://registry.yarnpkg.com/errno/-/errno-0.1.7.tgz#4684d71779ad39af177e3f007996f7c67c852618"
integrity sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg== integrity sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg==
@ -4963,6 +5003,11 @@ ignore@^4.0.6:
resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc"
integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==
image-size@~0.5.0:
version "0.5.5"
resolved "https://registry.yarnpkg.com/image-size/-/image-size-0.5.5.tgz#09dfd4ab9d20e29eb1c3e80b8990378df9e3cb9c"
integrity sha1-Cd/Uq50g4p6xw+gLiZA3jfnjy5w=
immer@1.10.0: immer@1.10.0:
version "1.10.0" version "1.10.0"
resolved "https://registry.yarnpkg.com/immer/-/immer-1.10.0.tgz#bad67605ba9c810275d91e1c2a47d4582e98286d" resolved "https://registry.yarnpkg.com/immer/-/immer-1.10.0.tgz#bad67605ba9c810275d91e1c2a47d4582e98286d"
@ -6120,6 +6165,38 @@ left-pad@^1.3.0:
resolved "https://registry.yarnpkg.com/left-pad/-/left-pad-1.3.0.tgz#5b8a3a7765dfe001261dde915589e782f8c94d1e" resolved "https://registry.yarnpkg.com/left-pad/-/left-pad-1.3.0.tgz#5b8a3a7765dfe001261dde915589e782f8c94d1e"
integrity sha512-XI5MPzVNApjAyhQzphX8BkmKsKUxD4LdyK24iZeQGinBN9yTQT3bFlCBy/aVx2HrNcqQGsdot8ghrjyrvMCoEA== integrity sha512-XI5MPzVNApjAyhQzphX8BkmKsKUxD4LdyK24iZeQGinBN9yTQT3bFlCBy/aVx2HrNcqQGsdot8ghrjyrvMCoEA==
less-loader@^4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/less-loader/-/less-loader-4.1.0.tgz#2c1352c5b09a4f84101490274fd51674de41363e"
integrity sha512-KNTsgCE9tMOM70+ddxp9yyt9iHqgmSs0yTZc5XH5Wo+g80RWRIYNqE58QJKm/yMud5wZEvz50ugRDuzVIkyahg==
dependencies:
clone "^2.1.1"
loader-utils "^1.1.0"
pify "^3.0.0"
less-vars-to-js@^1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/less-vars-to-js/-/less-vars-to-js-1.3.0.tgz#c322cf43a3c8fc3fab655da3e51a14c1499ab571"
integrity sha512-xeiLLn/IMCGtdyCkYQnW8UuzoW2oYMCKg9boZRaGI58fLz5r90bNJDlqGzmVt/1Uqk75/DxIVtQSNCMkE5fRZQ==
dependencies:
strip-json-comments "^2.0.1"
less@^3.8.1:
version "3.9.0"
resolved "https://registry.yarnpkg.com/less/-/less-3.9.0.tgz#b7511c43f37cf57dc87dffd9883ec121289b1474"
integrity sha512-31CmtPEZraNUtuUREYjSqRkeETFdyEHSEPAGq4erDlUXtda7pzNmctdljdIagSb589d/qXGWiiP31R5JVf+v0w==
dependencies:
clone "^2.1.2"
optionalDependencies:
errno "^0.1.1"
graceful-fs "^4.1.2"
image-size "~0.5.0"
mime "^1.4.1"
mkdirp "^0.5.0"
promise "^7.1.1"
request "^2.83.0"
source-map "~0.6.0"
leven@^2.1.0: leven@^2.1.0:
version "2.1.0" version "2.1.0"
resolved "https://registry.yarnpkg.com/leven/-/leven-2.1.0.tgz#c2e7a9f772094dee9d34202ae8acce4687875580" resolved "https://registry.yarnpkg.com/leven/-/leven-2.1.0.tgz#c2e7a9f772094dee9d34202ae8acce4687875580"
@ -6270,6 +6347,11 @@ lodash.merge@^4.4.0:
resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.1.tgz#adc25d9cb99b9391c59624f379fbba60d7111d54" resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.1.tgz#adc25d9cb99b9391c59624f379fbba60d7111d54"
integrity sha512-AOYza4+Hf5z1/0Hztxpm2/xiPZgi/cjMqdnKTUWTBSKchJlxXXuUSxCCl8rJlf4g6yww/j6mA8nC8Hw/EZWxKQ== integrity sha512-AOYza4+Hf5z1/0Hztxpm2/xiPZgi/cjMqdnKTUWTBSKchJlxXXuUSxCCl8rJlf4g6yww/j6mA8nC8Hw/EZWxKQ==
lodash.mergewith@^4.6.1:
version "4.6.1"
resolved "https://registry.yarnpkg.com/lodash.mergewith/-/lodash.mergewith-4.6.1.tgz#639057e726c3afbdb3e7d42741caa8d6e4335927"
integrity sha512-eWw5r+PYICtEBgrBE5hhlT6aAa75f411bgDz/ZL2KZqYV03USvucsxcHUIlGTDTECs1eunpI7HOV7U+WLDvNdQ==
lodash.pick@^4.2.1: lodash.pick@^4.2.1:
version "4.4.0" version "4.4.0"
resolved "https://registry.yarnpkg.com/lodash.pick/-/lodash.pick-4.4.0.tgz#52f05610fff9ded422611441ed1fc123a03001b3" resolved "https://registry.yarnpkg.com/lodash.pick/-/lodash.pick-4.4.0.tgz#52f05610fff9ded422611441ed1fc123a03001b3"
@ -6519,6 +6601,11 @@ mime@1.4.1:
resolved "https://registry.yarnpkg.com/mime/-/mime-1.4.1.tgz#121f9ebc49e3766f311a76e1fa1c8003c4b03aa6" resolved "https://registry.yarnpkg.com/mime/-/mime-1.4.1.tgz#121f9ebc49e3766f311a76e1fa1c8003c4b03aa6"
integrity sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ== integrity sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ==
mime@^1.4.1:
version "1.6.0"
resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1"
integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==
mime@^2.0.3, mime@^2.3.1: mime@^2.0.3, mime@^2.3.1:
version "2.4.2" version "2.4.2"
resolved "https://registry.yarnpkg.com/mime/-/mime-2.4.2.tgz#ce5229a5e99ffc313abac806b482c10e7ba6ac78" resolved "https://registry.yarnpkg.com/mime/-/mime-2.4.2.tgz#ce5229a5e99ffc313abac806b482c10e7ba6ac78"
@ -9130,7 +9217,7 @@ request-promise-native@^1.0.5:
stealthy-require "^1.1.1" stealthy-require "^1.1.1"
tough-cookie "^2.3.3" tough-cookie "^2.3.3"
request@^2.87.0, request@^2.88.0: request@^2.83.0, request@^2.87.0, request@^2.88.0:
version "2.88.0" version "2.88.0"
resolved "https://registry.yarnpkg.com/request/-/request-2.88.0.tgz#9c2fca4f7d35b592efe57c7f0a55e81052124fef" resolved "https://registry.yarnpkg.com/request/-/request-2.88.0.tgz#9c2fca4f7d35b592efe57c7f0a55e81052124fef"
integrity sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg== integrity sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==
@ -10695,6 +10782,13 @@ webpack-manifest-plugin@2.0.4:
lodash ">=3.5 <5" lodash ">=3.5 <5"
tapable "^1.0.0" tapable "^1.0.0"
webpack-merge@^4.2.1:
version "4.2.1"
resolved "https://registry.yarnpkg.com/webpack-merge/-/webpack-merge-4.2.1.tgz#5e923cf802ea2ace4fd5af1d3247368a633489b4"
integrity sha512-4p8WQyS98bUJcCvFMbdGZyZmsKuWjWVnVHnAS3FFg0HDaRVrPbkivx2RYCre8UiemD67RsiFFLfn4JhLAin8Vw==
dependencies:
lodash "^4.17.5"
webpack-sources@^1.1.0, webpack-sources@^1.3.0: webpack-sources@^1.1.0, webpack-sources@^1.3.0:
version "1.3.0" version "1.3.0"
resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-1.3.0.tgz#2a28dcb9f1f45fe960d8f1493252b5ee6530fa85" resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-1.3.0.tgz#2a28dcb9f1f45fe960d8f1493252b5ee6530fa85"