-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from splaplapla/procon-color
プロコンカラーを設定できるようにする
- Loading branch information
Showing
15 changed files
with
207 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,35 @@ | ||
# procon_bypass_man_setting_editor | ||
* https://github.com/splaplapla/procon_bypass_man で使う、コントローラーへの設定ファイルGUIエディターです | ||
* https://splaplapla.github.io/procon_bypass_man_setting_editor/ で公開しています | ||
|
||
- https://github.com/splaplapla/procon_bypass_man で使う、コントローラーへの設定ファイル GUI エディターです | ||
- https://splaplapla.github.io/procon_bypass_man_setting_editor/ で公開しています | ||
|
||
# 開発 | ||
|
||
## セットアップ | ||
* $ nodenv install | ||
* $ yarn | ||
|
||
- $ nodenv install | ||
- $ yarn | ||
|
||
## 開発用サーバの起動 | ||
* $ yarn server | ||
* Open http://localhost:8080/ | ||
|
||
- $ yarn dev | ||
- Open http://localhost:8080/ | ||
|
||
## test | ||
* yarn test | ||
|
||
- yarn test | ||
|
||
## リリース手順 | ||
* $ yarn release-build | ||
* ./dist/index.html を開いて動作確認をする | ||
* $ yarn deploy | ||
|
||
- $ yarn release-build | ||
- ./dist/index.html を開いて動作確認をする | ||
- $ yarn deploy | ||
|
||
## TODO | ||
* pbm-cloudからimportする機能 | ||
* oauth2で認証する | ||
* importして、pbm-cloudに反映したい | ||
* 他のオプションを列挙する | ||
* open_macro | ||
* 左スティックの感度を設定できるようにする | ||
|
||
- pbm-cloud から import する機能 | ||
- oauth2 で認証する | ||
- import して、pbm-cloud に反映したい | ||
- 他のオプションを列挙する | ||
- open_macro | ||
- 左スティックの感度を設定できるようにする |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
module.exports = { | ||
moduleNameMapper: { | ||
"^src/(.*)$": "<rootDir>/src/$1", | ||
"^components/(.*)$": "<rootDir>/src/components/$1" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,7 +43,7 @@ | |
}, | ||
"scripts": { | ||
"build": "webpack", | ||
"server": "webpack serve", | ||
"dev": "webpack serve", | ||
"deploy": "yarn run release-build && gh-pages -d dist -u 'github-actions-bot <[email protected]>'", | ||
"release-build": "NODE_ENV=production webpack", | ||
"test": "jest", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import React, { useContext } from "react"; | ||
import Form from "react-bootstrap/Form"; | ||
import { SettingContext } from "src/contexts/buttons_setting"; | ||
import { updateProconColor } from "src/reducers/setting_reducer"; | ||
import { ProconColor, colors } from "src/types/procon_color"; | ||
|
||
export const ProconColorForm: React.FC = () => { | ||
const { setting, settingDispatch } = useContext(SettingContext); | ||
|
||
const handleSelect = (event: React.ChangeEvent<HTMLSelectElement>) => { | ||
if (event.target.value === "") { | ||
settingDispatch({ | ||
type: updateProconColor, | ||
payload: { proconColor: null }, | ||
}); | ||
} else { | ||
settingDispatch({ | ||
type: updateProconColor, | ||
payload: { proconColor: event.target.value }, | ||
}); | ||
} | ||
}; | ||
|
||
return ( | ||
<Form.Group className="mt-4 mb-3"> | ||
<Form.Label htmlFor="proconColor">プロコンの色を変更する</Form.Label> | ||
<Form.Select | ||
value={setting.proconColor} | ||
onChange={handleSelect} | ||
id="proconColor" | ||
> | ||
<option value={""}>未選択</option> | ||
{colors.map((color: ProconColor, index) => ( | ||
<option key={index} value={color}> | ||
{color} | ||
</option> | ||
))} | ||
</Form.Select> | ||
</Form.Group> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
export const colors = [ | ||
"red", | ||
"blue", | ||
"yellow", | ||
"green", | ||
"pink", | ||
"cyan", | ||
"white", | ||
] as const; | ||
export type ProconColor = typeof colors[number]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.