Skip to content

Commit

Permalink
fix: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
alexnm committed Oct 24, 2023
1 parent d8666d6 commit a6372cd
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,6 @@ export const ownedTemplates: Query<
export const getTeams: Query<AllTeamsQuery, AllTeamsQueryVariables> = gql`
query AllTeams {
me {
personalWorkspaceId
primaryWorkspaceId
eligibleForTrial
workspaces {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,36 +13,26 @@ import {
Text,
} from '@codesandbox/components';
import { useCreateCheckout, useDismissible } from 'app/hooks';
import { SubscriptionStatus } from 'app/graphql/types';
import track from '@codesandbox/common/lib/utils/analytics';
import { SUBSCRIPTION_DOCS_URLS } from 'app/constants';
import { useWorkspaceSubscription } from 'app/hooks/useWorkspaceSubscription';
import { useDashboardVisit } from 'app/hooks/useDashboardVisit';
import { useAppState } from 'app/overmind';

// When flex wraps and the list of features
// is shown below the call to action.
const WRAP_WIDTH = 1320;

export const UpgradeBanner: React.FC = () => {
const { dashboard } = useAppState();
const [isBannerDismissed, dismissBanner] = useDismissible(
'DASHBOARD_RECENT_UPGRADE'
);
const { isEligibleForTrial, isPro } = useWorkspaceSubscription();

// If user has any pro workspace, don't show the banner
const userIsInProWorkspace = dashboard.teams.some(
team =>
team.subscription?.status === SubscriptionStatus.Active ||
team.subscription?.status === SubscriptionStatus.Trialing
);

const { hasVisited } = useDashboardVisit();

const [checkout, createCheckout, canCheckout] = useCreateCheckout();

if (userIsInProWorkspace || isBannerDismissed || !hasVisited || isPro) {
if (isBannerDismissed || !hasVisited || isPro) {
return null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ export const CollaboratorList = () => {
}
authorization={Authorization.Owner}
permissions={[]}
permissionText="Can Access"
subtext="All team members"
permissionText="Can edit"
subtext="All workspace members"
/>
</Animated>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import { Menu, Icon } from '@codesandbox/components';
import { Authorization } from 'app/graphql/types';

const authToName = {
[Authorization.WriteCode]: 'Can Edit',
[Authorization.Comment]: 'Can Comment',
[Authorization.None]: 'No Access',
[Authorization.Read]: 'Can View',
[Authorization.WriteProject]: 'Edit Sandbox Info',
[Authorization.WriteCode]: 'Can edit',
[Authorization.Comment]: 'Can comment',
[Authorization.None]: 'No access',
[Authorization.Read]: 'Can view',
[Authorization.WriteProject]: 'Edit sandbox info',
};

// Based on the longest option in the mnu
Expand Down
1 change: 0 additions & 1 deletion packages/common/src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,6 @@ export type SandboxAuthor = {
badges: Badge[];
subscriptionSince: string | null;
subscriptionPlan: 'pro' | 'patron';
personalWorkspaceId: string;
};

export type NpmRegistry = {
Expand Down

0 comments on commit a6372cd

Please sign in to comment.