@@ -29,6 +29,7 @@ const Demo = () => {
2929 const [ copied , setCopied ] = useState < boolean > ( false ) ;
3030 const [ preview , setPreview ] = useState < boolean > ( false ) ;
3131 const [ dropdown , setDropdown ] = useState < boolean > ( true ) ;
32+ const [ distinct , setDistinct ] = useState < boolean > ( false ) ;
3233 const [ disabled , setDisabled ] = useState < boolean > ( false ) ;
3334 const [ parentheses , setParentheses ] = useState ( true ) ;
3435
@@ -50,6 +51,7 @@ const Demo = () => {
5051
5152 const code = useMemo ( ( ) => {
5253 let code = "<PhoneInput\n" ;
54+ if ( distinct ) code += " distinct\n" ;
5355 if ( disabled ) code += " disabled\n" ;
5456 if ( arrow ) code += " enableArrow\n" ;
5557 if ( search && dropdown ) code += " enableSearch\n" ;
@@ -58,7 +60,7 @@ const Demo = () => {
5860 if ( code === "<PhoneInput\n" ) code = "<PhoneInput />" ;
5961 else code += "/>" ;
6062 return code ;
61- } , [ disabled , arrow , search , dropdown , parentheses ] )
63+ } , [ distinct , disabled , arrow , search , dropdown , parentheses ] )
6264
6365 return (
6466 < ThemeProvider theme = { theme } >
@@ -85,53 +87,64 @@ const Demo = () => {
8587 < div style = { { gap : 24 , display : "flex" , alignItems : "center" } } >
8688 < FormControlLabel
8789 control = { < Switch
90+ defaultChecked
8891 color = "primary"
89- onChange = { changeTheme }
92+ onChange = { ( ) => setDropdown ( ! dropdown ) }
9093 /> }
9194 labelPlacement = "start"
9295 style = { { margin : 0 } }
93- label = "Theme "
96+ label = "Dropdown "
9497 />
9598 < FormControlLabel
9699 control = { < Switch
100+ defaultChecked
97101 color = "primary"
98- onChange = { ( ) => setStrict ( ! strict ) }
102+ onChange = { ( ) => setParentheses ( ! parentheses ) }
99103 /> }
100104 labelPlacement = "start"
101105 style = { { margin : 0 } }
102- label = "Validation"
103- defaultChecked
106+ label = "Parentheses"
104107 />
108+ </ div >
109+ < div style = { { gap : 24 , display : "flex" , alignItems : "center" } } >
105110 < FormControlLabel
106111 control = { < Switch
107112 color = "primary"
108- onChange = { ( ) => setDisabled ( ! disabled ) }
113+ onChange = { changeTheme }
109114 /> }
110115 labelPlacement = "start"
111116 style = { { margin : 0 } }
112- label = "Disabled"
117+ label = "Theme"
118+ />
119+ < FormControlLabel
120+ control = { < Switch
121+ color = "primary"
122+ onChange = { ( ) => setStrict ( ! strict ) }
123+ /> }
124+ labelPlacement = "start"
125+ style = { { margin : 0 } }
126+ label = "Validation"
127+ defaultChecked
113128 />
114129 </ div >
115130 < div style = { { gap : 24 , display : "flex" , alignItems : "center" } } >
116131 < FormControlLabel
117132 control = { < Switch
118- defaultChecked
119133 color = "primary"
120- onChange = { ( ) => setDropdown ( ! dropdown ) }
134+ onChange = { ( ) => setDisabled ( ! disabled ) }
121135 /> }
122136 labelPlacement = "start"
123137 style = { { margin : 0 } }
124- label = "Dropdown "
138+ label = "Disabled "
125139 />
126140 < FormControlLabel
127141 control = { < Switch
128- defaultChecked
129142 color = "primary"
130- onChange = { ( ) => setParentheses ( ! parentheses ) }
143+ onChange = { ( ) => setDistinct ( ! distinct ) }
131144 /> }
132145 labelPlacement = "start"
133146 style = { { margin : 0 } }
134- label = "Parentheses "
147+ label = "Distinct "
135148 />
136149 </ div >
137150 < div style = { { gap : 24 , display : "flex" , alignItems : "center" } } >
@@ -183,6 +196,7 @@ const Demo = () => {
183196 < PhoneInput
184197 { ...phoneProps }
185198 error = { error }
199+ distinct = { distinct }
186200 disabled = { disabled }
187201 onChange = { onChange }
188202 enableArrow = { arrow }
0 commit comments