Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
danilowoz committed Feb 16, 2022
1 parent ba55ec9 commit 430ba72
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 35 deletions.
1 change: 1 addition & 0 deletions packages/app/src/app/graphql/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ type CurrentUser {
collections(teamId: ID): [Collection!]!
email: String!
firstName: String
beta_access: Boolean
id: ID!
lastName: String
notifications(limit: Int, orderBy: OrderBy, type: [String]): [Notification]
Expand Down
19 changes: 1 addition & 18 deletions packages/app/src/app/pages/Dashboard/Components/Header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { useLocation } from 'react-router-dom';
import { useAppState, useActions } from 'app/overmind';
import { Stack, Text, Button } from '@codesandbox/components';
import css from '@styled-system/css';
import { dashboard as dashboardUrls } from '@codesandbox/common/lib/utils/url-generator';
import { Breadcrumbs } from '../Breadcrumbs';
import { FilterOptions } from '../Filters/FilterOptions';
import { ViewOptions } from '../Filters/ViewOptions';
Expand Down Expand Up @@ -46,7 +45,7 @@ export const Header = ({
actions = [],
}: Props) => {
const location = useLocation();
const { modals, openImportBetaSandboxModal } = useActions();
const { modals } = useActions();
const { dashboard } = useAppState();

return (
Expand Down Expand Up @@ -123,22 +122,6 @@ export const Header = ({
</Button>
))}

{location.pathname.includes(dashboardUrls.beta()) &&
dashboard.viewMode === 'list' && (
<Button
onClick={() => openImportBetaSandboxModal()}
variant="link"
css={css({
fontSize: 2,
color: 'mutedForeground',
padding: 0,
width: 'auto',
})}
>
+ Import Repo
</Button>
)}

<Stack gap={4}>
{showFilters && (
<FilterOptions
Expand Down
8 changes: 2 additions & 6 deletions packages/app/src/app/pages/Dashboard/Header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,7 @@ const SHOW_COMMUNITY_SEARCH = localStorage.SHOW_COMMUNITY_SEARCH;
export const Header: React.FC<HeaderProps> = React.memo(
({ onSidebarToggle }) => {
const { openCreateSandboxModal } = useActions();
const { activeWorkspaceAuthorization, user, dashboard } = useAppState();

const isFeatureFlagBeta = !!dashboard.featureFlags.find(
e => e.name === 'beta'
);
const { activeWorkspaceAuthorization, user } = useAppState();

return (
<Stack
Expand Down Expand Up @@ -84,7 +80,7 @@ export const Header: React.FC<HeaderProps> = React.memo(
<SearchInputGroup />

<Stack align="center" gap={2}>
{isFeatureFlagBeta ? (
{user?.betaAccess ? (
<a
href="/p/dashboard/"
css={css({
Expand Down
13 changes: 2 additions & 11 deletions packages/app/src/app/pages/WaitList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,7 @@ import { GitHubIcon } from '../Sandbox/Editor/Workspace/screens/GitHub/Icons';
import { Survey } from './Survey';

export const WaitListRequest = () => {
const {
hasLogIn,
user,
dashboard,
isAuthenticating,
isLoadingGithub,
} = useAppState();
const { hasLogIn, user, isAuthenticating, isLoadingGithub } = useAppState();
const { sandboxPageMounted } = useActions();

useEffect(() => {
Expand All @@ -43,10 +37,7 @@ export const WaitListRequest = () => {
return <GitHubScope />;
}

const isFeatureFlagBeta = !!dashboard.featureFlags.find(
e => e.name === 'beta'
);
if (isFeatureFlagBeta) {
if (user.betaAccess) {
// TODO: temp dashboard URL
history.replace('/dashboard/beta');
return null;
Expand Down
1 change: 1 addition & 0 deletions packages/common/src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ export type CurrentUser = {
};
curatorAt: string;
badges: Badge[];
betaAccess: boolean;
provider: 'github' | 'google';
integrations: {
zeit: {
Expand Down

0 comments on commit 430ba72

Please sign in to comment.