Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove announcement #802

Merged
merged 9 commits into from
Sep 16, 2024
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
90 changes: 0 additions & 90 deletions src/components/TopNav/Announcement.tsx

This file was deleted.

7 changes: 1 addition & 6 deletions src/components/TopNav/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import React, { useContext } from 'react';
import AnnouncementBar from './Announcement';
import React from 'react';
import TopNav from '.';
import { isMobile } from '../Editor/CadenceEditor/ControlPanel/utils';
import { AnnouncementContext } from 'providers/Announcement';

const headerStyle: React.CSSProperties = {
display: 'flex',
Expand All @@ -13,10 +10,8 @@ const headerStyle: React.CSSProperties = {
};

const Header = () => {
const { isVisible: isAnnouncementVisible } = useContext(AnnouncementContext);
return (
<header style={headerStyle}>
{!isMobile() && isAnnouncementVisible && <AnnouncementBar />}
<TopNav />
</header>
);
Expand Down
22 changes: 4 additions & 18 deletions src/containers/Playground/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,13 @@ import { AnimatePresence, motion, MotionStyle } from 'framer-motion';
import CadenceChecker from 'providers/CadenceChecker';
import { ProjectProvider } from 'providers/Project';
import useGetProject, { useProject } from 'providers/Project/projectHooks';
import React, { CSSProperties, useContext } from 'react';
import React, { CSSProperties } from 'react';
import { Box, Button, Spinner, ThemeUICSSObject } from 'theme-ui';
import { userDataKeys, UserLocalStorage } from 'util/localstorage';
import { LOCAL_PROJECT_ID } from 'util/url';
import useToggleExplorer from '../../hooks/useToggleExplorer';
import EditorLayout from './EditorLayout';
import { isMobile } from 'components/Editor/CadenceEditor/ControlPanel/utils';
import {
AnnouncementContext,
AnnouncementProvider,
} from 'providers/Announcement';

export const LEFT_SIDEBAR_WIDTH = 350;

Expand All @@ -44,7 +40,6 @@ const closeLeftSidebarButtonStyle: CSSProperties = {
const getBaseStyles = (
showProjectsSidebar: boolean,
isExplorerCollapsed: boolean,
isAnnouncementVisible: boolean,
): ThemeUICSSObject => {
const fileExplorerWidth = isExplorerCollapsed
? isMobile()
Expand All @@ -62,9 +57,7 @@ const getBaseStyles = (
display: 'grid',
gridTemplateAreas: "'header header' 'sidebar main'",
gridTemplateColumns: `[sidebar] ${fileExplorerWidth} [main] auto`,
gridTemplateRows: isAnnouncementVisible
? ['40px auto', '105px auto']
: ['40px auto', '50px auto'],
gridTemplateRows: ['40px auto', '50px auto'],
overflow: 'hidden',
filter: showProjectsSidebar ? 'blur(1px)' : 'none',
};
Expand All @@ -77,13 +70,8 @@ const leftSidebarTransition = { type: 'spring', bounce: 0.2, duration: 0.25 };
const Content = () => {
const { showProjectsSidebar, toggleProjectsSidebar } = useProject();
const { isExplorerCollapsed, toggleExplorer } = useToggleExplorer();
const { isVisible: isAnnouncementVisible } = useContext(AnnouncementContext);

const baseStyles = getBaseStyles(
showProjectsSidebar,
isExplorerCollapsed,
isAnnouncementVisible,
);
const baseStyles = getBaseStyles(showProjectsSidebar, isExplorerCollapsed);
return (
<>
<AnimatePresence>
Expand Down Expand Up @@ -213,9 +201,7 @@ const Playground = ({ projectId }: PlaygroundProps) => {
return (
<ProjectProvider project={project} isLocal={isLocal} client={client}>
<CadenceChecker>
<AnnouncementProvider>
<Content />
</AnnouncementProvider>
<Content />
</CadenceChecker>
</ProjectProvider>
);
Expand Down
42 changes: 0 additions & 42 deletions src/providers/Announcement/index.tsx

This file was deleted.

2 changes: 1 addition & 1 deletion src/providers/Project/projectDefault.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export function createLocalProject(
const accountEntities: Account[] = accounts.map((_account) => {
return {
__typename: 'Account',
address: `000000000000000${_account}`,
address: _account.padStart(16, "0"),
deployedContracts: [],
state: DEFAULT_ACCOUNT_STATE,
};
Expand Down
Loading