Skip to content

Commit

Permalink
Update OpenWithLearnpackCTA.jsx
Browse files Browse the repository at this point in the history
  • Loading branch information
tommygonzaleza authored Oct 23, 2024
1 parent 0766212 commit 4ec231a
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/js_modules/syllabus/OpenWithLearnpackCTA.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,18 +111,21 @@ function OpenWithLearnpackCTA({ currentAsset, variant }) {
</Text>
<Box mt="10px" display="flex" gap="10px" flexDirection={{ base: 'column', md: 'row' }}>
{[
<Button size="sm" padding="4px 8px" fontSize="14px" fontWeight="500" background="gray.200" color="blue.default" onClick={() => setShowCloneModal(true)}>
{t('learnpack.open-locally')}
</Button>,
<Button size="sm" padding="4px 8px" fontSize="14px" fontWeight="500" background="gray.200" color="blue.default" onClick={() => setShowCloneModal(true)}>
{t('learnpack.open-locally')}
</Button>,
<Popover>
<PopoverTrigger>
<Button size="sm" padding="4px 8px" fontSize="14px" fontWeight="500" background="gray.200" color="blue.default">
{t('learnpack.open-in-learnpack-button.text')}
</Button>
</PopoverTrigger>
<ProvisioningPopover openInLearnpackAction={openInLearnpackAction} provisioningLinks={provisioningLinks} />
</Popover>
].sort((a,b) => a > b ? cohortSession.available_as_saas : -1)}
</Popover>,
].sort((a,b) => {
if(a > b) return cohortSession.available_as_saas;
return -1;
})}
</Box>
</Box>
</Box>
Expand Down Expand Up @@ -175,7 +178,10 @@ function OpenWithLearnpackCTA({ currentAsset, variant }) {
fontSize="17px"
>
{t('common:learnpack.open-locally')}
</Button>].sort((a,b) => a > b ? cohortSession.available_as_saas : -1)
</Button>].sort((a,b) => {
if(a > b) return cohortSession.available_as_saas;
return -1
})
}
</Box>
</Box>
Expand Down

0 comments on commit 4ec231a

Please sign in to comment.