@@ -48,6 +48,9 @@ class ServiceComponent extends React.Component{
4848 switch ( selectId ) {
4949 case 'document' :
5050 cached . document = selectValue ;
51+ if ( selectValue === 'Family Register' ) {
52+ cached . language = '' ;
53+ }
5154 break ;
5255 case 'direction' :
5356 cached . direction = selectValue ;
@@ -59,7 +62,7 @@ class ServiceComponent extends React.Component{
5962 null ;
6063 break ;
6164 }
62- // console.log(cached);
65+ console . log ( cached ) ;
6366 this . setState ( {
6467 selectedVal : cached
6568 } ) ;
@@ -90,20 +93,33 @@ class ServiceComponent extends React.Component{
9093 event . stopPropagation ( ) ;
9194
9295 }
93-
94-
95- render ( ) {
96-
97- const docOpt = this . state . documents . map ( ( doc , index ) => {
98- return (
99- < option value = { doc . docName } key = { index } > { doc . docName } </ option >
96+ docOption ( ) {
97+ return (
98+ this . state . documents . map ( ( doc , index ) => {
99+ return (
100+ < option value = { doc . docName } key = { index } > { doc . docName } </ option >
101+ ) ;
102+ } )
103+ ) ;
104+ }
105+ lanOption ( document ) {
106+ if ( document === 'Family Register' ) {
107+ return (
108+ < option value = 'Japanese' key = { 0 } > Japanese</ option >
100109 ) ;
101- } ) ;
102- const lanOpt = this . state . languages . map ( ( lan , index ) => {
110+ } else {
103111 return (
104- < option value = { lan . language } key = { index } > { lan . language } </ option >
112+ this . state . languages . map ( ( lan , index ) => {
113+ return (
114+ < option value = { lan . language } key = { index } > { lan . language } </ option >
115+ ) ;
116+ } )
105117 ) ;
106- } ) ;
118+ }
119+
120+ }
121+ render ( ) {
122+
107123 return (
108124 < div >
109125 < div className = " jumbotron text-center" >
@@ -112,7 +128,7 @@ class ServiceComponent extends React.Component{
112128 < div className = "form-group " >
113129 < select name = "document" id = "document" className = "form-control" onChange = { this . handleChange } defaultValue = "selected" >
114130 < option value = "selected" > Select a Document</ option >
115- { docOpt }
131+ { this . docOption ( ) }
116132 </ select >
117133 < select name = "direction" id = "direction" className = "form-control" onChange = { this . handleChange } defaultValue = "selected" >
118134 < option value = "selected" > Select Direction </ option >
@@ -121,7 +137,7 @@ class ServiceComponent extends React.Component{
121137 </ select >
122138 < select name = "language" id = "language" className = "form-control" onChange = { this . handleChange } defaultValue = "selected" >
123139 < option value = "selected" > Select a Language</ option >
124- { lanOpt }
140+ { this . lanOption ( this . state . selectedVal . document ) }
125141 </ select >
126142 < button className = "btn btn-primary" onClick = { this . handleRedir } > Quote Now</ button >
127143 </ div >
0 commit comments