Skip to content

Commit 91b7686

Browse files
committed
skeleton codepush menu, not working
1 parent ee8f3bd commit 91b7686

File tree

1 file changed

+48
-9
lines changed

1 file changed

+48
-9
lines changed

src/app/utils/DevMenu.tsx

Lines changed: 48 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,12 @@ export const DevMenu = ({ onClose = () => goBack() }: { onClose(): void }) => {
133133
<Separator my="1" />
134134
</Flex>
135135

136+
<CodePushOptions />
137+
138+
<Flex mx={2}>
139+
<Separator my="1" />
140+
</Flex>
141+
136142
<EnvironmentOptions onClose={onClose} />
137143

138144
<Flex mx={2}>
@@ -191,15 +197,6 @@ export const DevMenu = ({ onClose = () => goBack() }: { onClose(): void }) => {
191197
</Flex>
192198
}
193199
/>
194-
<DevMenuButtonItem
195-
title="Code push"
196-
onPress={() => {
197-
codePush.sync()
198-
codePush.getUpdateMetadata(codePush.UpdateState.PENDING).then((metadata) => {
199-
console.log("Codepush data:", metadata)
200-
})
201-
}}
202-
/>
203200
<DevMenuButtonItem
204201
title="Open Art Quiz"
205202
onPress={() => {
@@ -455,6 +452,48 @@ function envMenuOption(
455452
}
456453
}
457454

455+
const CodePushOptions: React.FC = () => {
456+
return (
457+
<CollapseMenu title="Code push">
458+
<DevMenuButtonItem
459+
title="Run canary"
460+
onPress={() => {
461+
codePush.sync({ deploymentKey: Config.CODE_PUSH_CANARY_DEPLOYMENT_KEY })
462+
codePush.getUpdateMetadata(codePush.UpdateState.PENDING).then((metadata) => {
463+
console.log("Codepush data:", metadata)
464+
})
465+
}}
466+
/>
467+
<DevMenuButtonItem
468+
title="Run staging"
469+
onPress={() => {
470+
codePush.sync({ deploymentKey: Config.CODE_PUSH_STAGING_DEPLOYMENT_KEY })
471+
codePush.getUpdateMetadata(codePush.UpdateState.PENDING).then((metadata) => {
472+
console.log("Codepush data:", metadata)
473+
})
474+
}}
475+
/>
476+
<DevMenuButtonItem
477+
title="Run production"
478+
onPress={() => {
479+
codePush.sync({ deploymentKey: Config.CODE_PUSH_PRODUCTION_DEPLOYMENT_KEY })
480+
codePush.getUpdateMetadata(codePush.UpdateState.PENDING).then((metadata) => {
481+
console.log("Codepush data:", metadata)
482+
})
483+
}}
484+
/>
485+
<DevMenuButtonItem
486+
title="Running build"
487+
onPress={() => {
488+
codePush.getUpdateMetadata(codePush.UpdateState.RUNNING).then((metadata) => {
489+
console.log("Codepush data:", metadata)
490+
})
491+
}}
492+
/>
493+
</CollapseMenu>
494+
)
495+
}
496+
458497
const EnvironmentOptions: React.FC<{ onClose: () => void }> = ({ onClose }) => {
459498
const color = useColor()
460499
const { env, localOverrides, strings } = GlobalStore.useAppState(

0 commit comments

Comments
 (0)