@@ -2,6 +2,7 @@ import { ChangeEvent, useEffect, useState } from 'react';
22import './App.css' ;
33
44type Config = {
5+ platform ?: string ;
56 color ?: string ;
67 font ?: string ;
78 speedPx ?: number ;
@@ -15,10 +16,14 @@ function App() {
1516 const [ status , setStatus ] = useState < string > ( ) ;
1617 const [ presenter , setPresenter ] = useState < number | null > ( ) ;
1718
19+ const platforms : Config [ 'platform' ] [ ] = [ 'gslide' ] ;
1820 const fonts = [ 'メイリオ' , 'MS ゴシック' , 'MS 明朝' , 'HGS行書体' , 'HGP創英角ポップ体' ] ;
1921
2022 const claps = [ 'none' , 'black' , 'white' , 'pink' ] ;
2123
24+ const handlePlatformChange = ( event : ChangeEvent < HTMLSelectElement > ) => {
25+ setConfig ( ( prev ) => ( { ...prev , platform : event . target . value } ) ) ;
26+ } ;
2227 const handleColorChange = ( event : ChangeEvent < HTMLInputElement > ) => {
2328 setConfig ( ( prev ) => ( { ...prev , color : event . target . value } ) ) ;
2429 } ;
@@ -46,7 +51,7 @@ function App() {
4651 }
4752
4853 chrome . storage . sync . set ( { config } ) ;
49- chrome . tabs . sendMessage ( tab . id , { command : 'Load' } , ( res ) => {
54+ chrome . tabs . sendMessage ( tab . id , { command : 'Load' , platform : config ?. platform } , ( res ) => {
5055 setStatus ( res . message ) ;
5156 if ( res . screenType === 'presenter' ) {
5257 chrome . storage . sync . set ( { presenter : tab . id } ) ;
@@ -106,6 +111,23 @@ function App() {
106111 < p > Click "Start" on both the slide side and the presenter user tools side</ p >
107112 < form >
108113 < div className = "pseudo-table" >
114+ < div className = "pseudo-row" >
115+ < label htmlFor = "platform" className = "pseudo-cell" >
116+ Subscribe Platform:{ ' ' }
117+ </ label >
118+ < div className = "pseudo-cell" >
119+ < select value = { config ?. platform || 'gslide' } onChange = { handlePlatformChange } >
120+ { platforms . map ( ( platform ) => {
121+ return (
122+ < option key = { platform } value = { platform } >
123+ { platform }
124+ </ option >
125+ ) ;
126+ } ) }
127+ </ select >
128+ </ div >
129+ </ div >
130+
109131 < div className = "pseudo-row" >
110132 < label htmlFor = "color" className = "pseudo-cell" >
111133 Comment Color:{ ' ' }
0 commit comments