Skip to content

Commit 2026495

Browse files
committed
chore: group activated does not show user CTA even if he has no pro
1 parent 13c4734 commit 2026495

File tree

4 files changed

+22
-10
lines changed

4 files changed

+22
-10
lines changed

ts/components/dialog/SessionProInfoModal.tsx

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,13 @@ export function SessionProInfoModal(props: SessionProInfoState) {
266266
}
267267
const isGroupCta = props.variant === SessionProInfoVariant.GROUP_ACTIVATED;
268268

269+
/**
270+
* Note: the group activated cta is quite custom, but whatever the pro status of the current pro user,
271+
* we do not want to show the CTA for "subscribe to pro".
272+
* An admin have subscribed and that's all that's needed to make this group a Pro group.
273+
*/
274+
const hasNoProAndNotGroupCta = !hasPro && !isGroupCta;
275+
269276
return (
270277
<SessionWrapperModal
271278
onClose={onClose}
@@ -283,14 +290,14 @@ export function SessionProInfoModal(props: SessionProInfoState) {
283290
display: 'grid',
284291
alignItems: 'center',
285292
justifyItems: 'center',
286-
gridTemplateColumns: hasPro ? '1fr' : '1fr 1fr',
293+
gridTemplateColumns: !hasNoProAndNotGroupCta ? '1fr' : '1fr 1fr',
287294
columnGap: 'var(--margins-sm)',
288295
paddingInline: 'var(--margins-md)',
289296
marginBottom: 'var(--margins-md)',
290297
height: 'unset',
291298
}}
292299
>
293-
{!hasPro ? (
300+
{hasNoProAndNotGroupCta ? (
294301
<SessionButtonShiny
295302
{...buttonProps}
296303
shinyContainerStyle={{
@@ -308,24 +315,26 @@ export function SessionProInfoModal(props: SessionProInfoState) {
308315
buttonColor={SessionButtonColor.Tertiary}
309316
onClick={onClose}
310317
dataTestId="modal-session-pro-cancel-button"
311-
style={hasPro ? { ...buttonProps.style, width: '50%' } : buttonProps.style}
318+
style={
319+
!hasNoProAndNotGroupCta ? { ...buttonProps.style, width: '50%' } : buttonProps.style
320+
}
312321
>
313-
{tr(hasPro ? 'close' : 'cancel')}
322+
{tr(!hasNoProAndNotGroupCta ? 'close' : 'cancel')}
314323
</SessionButton>
315324
</ModalActionsContainer>
316325
}
317326
>
318327
<SpacerSM />
319-
<StyledCTATitle reverseDirection={hasPro}>
320-
{tr(hasPro ? (isGroupCta ? 'proGroupActivated' : 'proActivated') : 'upgradeTo')}
328+
<StyledCTATitle reverseDirection={!hasNoProAndNotGroupCta}>
329+
{tr(isGroupCta ? 'proGroupActivated' : hasPro ? 'proActivated' : 'upgradeTo')}
321330
<ProIconButton iconSize={'huge'} dataTestId="invalid-data-testid" onClick={undefined} />
322331
</StyledCTATitle>
323332
<SpacerXL />
324333
<StyledContentContainer>
325334
<StyledScrollDescriptionContainer>
326335
{getDescription(props.variant)}
327336
</StyledScrollDescriptionContainer>
328-
{!hasPro ? (
337+
{hasNoProAndNotGroupCta ? (
329338
<StyledFeatureList>
330339
{getFeatureList(props.variant).map(token => (
331340
<FeatureListItem>{tr(token)}</FeatureListItem>

ts/components/dialog/user-settings/pages/DefaultSettingsPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ export const DefaultSettingPage = () => {
402402
<SessionLucideIconButton
403403
iconSize="small"
404404
unicode={LUCIDE_ICONS_UNICODE.COPY}
405-
iconColor="var(--primary-color)"
405+
iconColor="var(--renderer-span-primary)"
406406
onClick={copyAccountIdToClipboard}
407407
/>
408408
}

ts/components/leftpane/overlay/choose-action/ContactRow.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ const StyledAvatarItem = styled.div`
1313
const AvatarItem = (props: Pick<Props, 'id'>) => {
1414
const { id } = props;
1515

16-
const showUserDetailsFromConversationCb = useShowUserDetailsCbFromConversation(id, true) ?? undefined;
16+
const showUserDetailsFromConversationCb =
17+
useShowUserDetailsCbFromConversation(id, true) ?? undefined;
1718

1819
return (
1920
<StyledAvatarItem>

ts/node/sql.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1859,7 +1859,9 @@ function cleanUpUnreadExpiredDaRMessages() {
18591859
*/
18601860
function cleanUpInvalidConversationIds() {
18611861
const deleteResult = assertGlobalInstance()
1862-
.prepare(`DELETE FROM ${CONVERSATIONS_TABLE} WHERE id = '' OR id IS NULL OR typeof(id) != 'text';`)
1862+
.prepare(
1863+
`DELETE FROM ${CONVERSATIONS_TABLE} WHERE id = '' OR id IS NULL OR typeof(id) != 'text';`
1864+
)
18631865
.run();
18641866

18651867
console.info(`cleanUpInvalidConversationIds removed ${deleteResult.changes} rows`);

0 commit comments

Comments
 (0)