Web and lightmode fixes

This commit is contained in:
Paul Frazee
2025-03-25 23:15:45 -07:00
parent c12102e6d0
commit 1d1348a96d
2 changed files with 17 additions and 3 deletions
@@ -7,6 +7,7 @@ import {useLingui} from '@lingui/react'
import {type Gate, useGateDescriptions} from '#/lib/statsig/gates' import {type Gate, useGateDescriptions} from '#/lib/statsig/gates'
import {useGate, useSetLocalGateOverride} from '#/lib/statsig/statsig' import {useGate, useSetLocalGateOverride} from '#/lib/statsig/statsig'
import {logger} from '#/logger' import {logger} from '#/logger'
import {isWeb} from '#/platform/detection'
import {atoms as a, useTheme} from '#/alf' import {atoms as a, useTheme} from '#/alf'
import {Button, ButtonIcon, ButtonText} from '#/components/Button' import {Button, ButtonIcon, ButtonText} from '#/components/Button'
import * as Dialog from '#/components/Dialog' import * as Dialog from '#/components/Dialog'
@@ -49,7 +50,7 @@ export function FeatureGateDialog({
const [isRestarting, setIsRestarting] = useState(false) const [isRestarting, setIsRestarting] = useState(false)
const desc = descriptions[gate] const desc = descriptions[gate]
const onToggleGate = v => { const onToggleGate = (v: boolean) => {
setGateApi(gate, v) setGateApi(gate, v)
setEnabled(v) setEnabled(v)
} }
@@ -96,7 +97,12 @@ export function FeatureGateDialog({
size="large" size="large"
onPress={() => { onPress={() => {
setIsRestarting(true) setIsRestarting(true)
Updates.reloadAsync() if (isWeb) {
/* @ts-ignore web only */
navigation.reload()
} else {
Updates.reloadAsync()
}
}} }}
label={_(msg`Restart to apply changes`)} label={_(msg`Restart to apply changes`)}
disabled={isRestarting}> disabled={isRestarting}>
+9 -1
View File
@@ -67,7 +67,15 @@ function ExperimentButton({gate}: {gate: Gate}) {
{descriptions[gate]?.title} {descriptions[gate]?.title}
</SettingsList.ItemText> </SettingsList.ItemText>
<SettingsList.BadgeText <SettingsList.BadgeText
style={[a.flex_1, enabled && {color: t.palette.positive_400}]}> style={[
a.flex_1,
enabled && {
color:
t.scheme === 'dark'
? t.palette.positive_400
: t.palette.positive_600,
},
]}>
{enabled ? <Trans>Enabled</Trans> : <Trans>Disabled</Trans>} {enabled ? <Trans>Enabled</Trans> : <Trans>Disabled</Trans>}
</SettingsList.BadgeText> </SettingsList.BadgeText>
</SettingsList.PressableItem> </SettingsList.PressableItem>