Skip to content

Commit aa1a6c0

Browse files
ButteryCrumpetRokt33r
authored andcommitted
remove references to monthly discount
1 parent 4b948d6 commit aa1a6c0

File tree

2 files changed

+12
-22
lines changed

2 files changed

+12
-22
lines changed

src/cloud/components/Modal/contents/DiscountModal.tsx

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,13 @@ import { mdiExclamation } from '@mdi/js'
1414
import { useI18n } from '../../../lib/hooks/useI18n'
1515
import { lngKeys } from '../../../lib/i18n/types'
1616
import { Translation } from 'react-i18next'
17-
import { SubscriptionPeriod } from '../../../lib/stripe'
1817
import Flexbox from '../../../../design/components/atoms/Flexbox'
19-
import Switch from '../../../../design/components/atoms/Switch'
2018

2119
const DiscountModal = () => {
2220
const { openSettingsTab } = useSettings()
2321
const { closeAllModals } = useModal()
2422
const { team, subscription } = usePage()
2523
const { translate } = useI18n()
26-
const [period, setPeriod] = useState<SubscriptionPeriod>('yearly')
2724

2825
const isTimeEligible = useMemo(() => {
2926
if (team == null) {
@@ -72,29 +69,18 @@ const DiscountModal = () => {
7269
)}
7370
<Flexbox className='plans__period' justifyContent='center'>
7471
<span>Annual</span>
75-
<Switch
76-
checked={period === 'monthly'}
77-
inverted={true}
78-
disabled={setPeriod == null}
79-
onChange={() => {
80-
if (setPeriod != null) {
81-
setPeriod(period === 'yearly' ? 'monthly' : 'yearly')
82-
}
83-
}}
84-
/>
85-
<span>Monthly</span>
8672
</Flexbox>
8773
<PlanTables
8874
team={team}
8975
selectedPlan={'free'}
90-
period={period}
76+
period={'yearly'}
9177
discounted={isTimeEligible}
9278
onStandardCallback={
9379
isTimeEligible
9480
? () => {
9581
openSettingsTab('teamUpgrade', {
9682
initialPlan: 'standard',
97-
initialPeriod: period,
83+
initialPeriod: 'yearly',
9884
tabState: 'form',
9985
})
10086
closeAllModals()
@@ -106,7 +92,7 @@ const DiscountModal = () => {
10692
? () => {
10793
openSettingsTab('teamUpgrade', {
10894
initialPlan: 'pro',
109-
initialPeriod: period,
95+
initialPeriod: 'yearly',
11096
tabState: 'form',
11197
})
11298
closeAllModals()

src/cloud/lib/subscription.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,15 @@ export function teamIsReadonly(
4141
team: SerializedTeam,
4242
subscription?: SerializedSubscription
4343
) {
44-
return (
45-
((subscription == null || subscription.status === 'inactive') &&
46-
remainingTrialInfo(team).remaining < 1) ||
47-
subscription != null
48-
)
44+
if (subscription == null) {
45+
return remainingTrialInfo(team).remaining < 1
46+
}
47+
48+
if (subscription.status === 'inactive') {
49+
return true
50+
}
51+
52+
return false
4953
}
5054

5155
export function remainingTrialInfo(team: SerializedTeam) {

0 commit comments

Comments
 (0)