Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions src/cloud/components/atoms/AnnouncementAlert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,8 @@ const AnnouncementAlert = () => {
your plan.
</p>

{permissions.filter((p) => p.role !== 'viewer').length >= 1 && (
{permissions.filter((p) => p.role !== 'viewer').length >
freePlanMembersLimit && (
<p>
You can continue for free if you demote your other members to
a{' '}
Expand Down Expand Up @@ -274,7 +275,8 @@ const AnnouncementAlert = () => {
Your space is not eligible for a free trial anymore. Please tell
your admins to upgrade your plan.
</p>
{permissions.filter((p) => p.role !== 'viewer').length >= 1 && (
{permissions.filter((p) => p.role !== 'viewer').length >
freePlanMembersLimit && (
<p>
If you wish to continue for free, they can also demote you or
other members to a{' '}
Expand All @@ -287,6 +289,21 @@ const AnnouncementAlert = () => {
role.
</p>
)}
<ButtonGroup className='alert__footer' layout='spread'>
<Button
variant='secondary'
onClick={() => {
const newPreferences = Object.assign({}, teamPreferences)
delete newPreferences.showTrialAlert
setToLocalStorage(
currentUserPermissions.teamId,
newPreferences
)
}}
>
Dismiss
</Button>
</ButtonGroup>
</div>
</div>
</Container>
Expand Down
20 changes: 0 additions & 20 deletions src/cloud/pages/settings/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@ import { LoadingButton } from '../../../shared/components/atoms/Button'
import ButtonGroup from '../../../shared/components/atoms/ButtonGroup'
import styled from '../../../shared/lib/styled'
import OnboardingLayout from '../../components/organisms/Onboarding/layouts/OnboardingLayout'
import UsageFormRow, {
SpaceUsageIntent,
} from '../../components/organisms/Onboarding/molecules/UsageFormRow'
import { trackEvent } from '../../api/track'
import { MixpanelActionTrackTypes } from '../../interfaces/analytics/mixpanel'

const SettingsPage = ({ currentUser }: SettingsPageResponseBody) => {
const [displayName, setDisplayName] = useState<string>(
Expand All @@ -38,7 +33,6 @@ const SettingsPage = ({ currentUser }: SettingsPageResponseBody) => {
setPartialGlobalData,
} = useGlobalData()
const [iconFile, setIconFile] = useState<File | null>(null)
const [intent, setIntent] = useState<SpaceUsageIntent>()
const [fileUrl, setFileUrl] = useState<string | null>(
currentUser.icon != null ? buildIconUrl(currentUser.icon.location) : null
)
Expand Down Expand Up @@ -79,22 +73,13 @@ const SettingsPage = ({ currentUser }: SettingsPageResponseBody) => {
? getTeamURL(teams[0])
: `/cooperate`

if (intent != null) {
await trackEvent(
intent === 'personal'
? MixpanelActionTrackTypes.UserIntentPersonal
: MixpanelActionTrackTypes.UserIntentTeam
)
}

push(finalRedirect)
} catch (error) {
setError(error)
}
setSending(false)
},
[
intent,
currentUser,
displayName,
teams,
Expand Down Expand Up @@ -136,11 +121,6 @@ const SettingsPage = ({ currentUser }: SettingsPageResponseBody) => {
}}
/>
</FormRow>
<UsageFormRow
intent={intent}
inSpaceForm={false}
setIntent={setIntent}
/>
<FormRow>{error != null && <ErrorBlock error={error} />}</FormRow>
<FormRow fullWidth={true} className='end__row'>
<ButtonGroup layout='column' display='flex' flex='1 1 auto'>
Expand Down