@@ -12,7 +12,6 @@ import {
1212 useVersion ,
1313 DEFAULT_PLATFORM ,
1414 getBestNumericVersion ,
15- versionAndPlatformAreCompatible ,
1615} from "../../context/VersionContext" ;
1716
1817const VERSIONS_LIST = publicRuntimeConfig . VERSIONS_LIST ;
@@ -36,32 +35,6 @@ const VersionSelector = ({
3635 ) ;
3736
3837 const [ widgetPlatform , setWidgetPlatform ] = useState ( compatiblePlatform ) ;
39-
40- // const handleSelectPlatform = useCallback(
41- // (selectedPlatform) => {
42- // if (
43- // selectedPlatform != platformContext &&
44- // versionAndPlatformAreCompatible(
45- // // versionContext can be DEFAULT_VERSION (null) or "1.40.0" (even if that's the latest).
46- // versionContext,
47- // selectedPlatform,
48- // )
49- // ) {
50- // // Navigate to new version and platform.
51- // setVersionAndPlatform({
52- // newVersion: versionContext,
53- // newPlatform: selectedPlatform,
54- // functionName: functionObject ? functionObject.name : "",
55- // });
56- // } else {
57- // // Just set the widget to the selected platform but dont navigate anywhere.
58- // // The user should pick a version first.
59- // setWidgetPlatform(selectedPlatform);
60- // }
61- // },
62- // [functionObject],
63- // );
64-
6538 const handleSelectPlatform = useCallback (
6639 ( selectedPlatform ) => {
6740 setWidgetPlatform ( selectedPlatform ) ;
@@ -127,7 +100,7 @@ const VersionSelector = ({
127100 < RadioGroup . Root
128101 className = { styles . VersionListRoot }
129102 defaultValue = {
130- availablePlatform == widgetPlatform
103+ availablePlatform == platformContext
131104 ? numericVersion
132105 : null
133106 }
@@ -170,87 +143,10 @@ const VersionSelector = ({
170143 </ ScrollArea . Root >
171144 </ Tabs . Content >
172145 ) ) }
173- { /* <Tabs.Content className="TabsContent" value="oss">
174- <form>
175- <legend>Show exceptions for:</legend>
176- <RadioGroup.Root
177- className={styles.RadioGroupRoot}
178- defaultValue={widgetPlatform}
179- aria-label="streamlit platform"
180- onValueChange={handleSelectPlatform}
181- >
182- {Object.keys(PLATFORMS).map((platform) => (
183- <div key={platform}>
184- <RadioGroup.Item
185- className={styles.RadioGroupItem}
186- value={platform}
187- id={platform}
188- >
189- <RadioGroup.Indicator
190- className={styles.RadioGroupIndicator}
191- />
192- </RadioGroup.Item>
193- <label className={styles.RadioLabel} htmlFor={platform}>
194- {PLATFORMS[platform]}
195- </label>
196- </div>
197- ))}
198- </RadioGroup.Root>
199- </form>
200- </Tabs.Content>
201- <Tabs.Content className="TabsContent" value="sis"> */ }
202- { /* <ScrollArea.Root className={styles.ScrollAreaRoot}>
203- <div className={styles.FadeTop}></div>
204- <ScrollArea.Viewport className={styles.ScrollAreaViewport}>
205- <RadioGroup.Root
206- className={styles.VersionListRoot}
207- defaultValue={numericVersion}
208- aria-label="streamlit version"
209- onValueChange={handleSelectVersion}
210- >
211- {validVersionForWidgetPlatform
212- .toReversed()
213- .map((validVersion) => (
214- <div key={validVersion}>
215- <RadioGroup.Item
216- className={styles.VersionListItem}
217- value={validVersion}
218- id={validVersion}
219- >
220- <RadioGroup.Indicator
221- className={classNames(
222- "material-icons-sharp",
223- styles.VersionListIndicator,
224- )}
225- />
226- </RadioGroup.Item>
227- <label
228- className={styles.VersionLabel}
229- htmlFor={validVersion}
230- >
231- Version {validVersion}
232- </label>
233- </div>
234- ))}
235- </RadioGroup.Root>
236- </ScrollArea.Viewport>
237- <div className={styles.FadeBottom}></div>
238- <ScrollArea.Scrollbar
239- className={styles.ScrollAreaScrollbar}
240- orientation="vertical"
241- >
242- <ScrollArea.Thumb className={styles.ScrollAreaThumb} />
243- </ScrollArea.Scrollbar>
244- </ScrollArea.Root> */ }
245- { /* </Tabs.Content>
246- <Tabs.Content className="TabsContent" value="na">
247- <p>Test</p>
248- </Tabs.Content> */ }
249146 </ Tabs . Root >
250147 < Popover . Close className = { styles . PopoverClose } aria-label = "Close" >
251148 < i className = "material-icons-sharp" > close</ i >
252149 </ Popover . Close >
253- < Popover . Arrow className = { styles . PopoverArrow } />
254150 </ Popover . Content >
255151 </ Popover . Portal >
256152 </ Popover . Root >
0 commit comments