Skip to content

Commit

Permalink
Added Logo-less mode (#105)
Browse files Browse the repository at this point in the history
  • Loading branch information
eyal-blockfence committed Aug 22, 2023
1 parent 64c178d commit bdb53c3
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 4 deletions.
4 changes: 4 additions & 0 deletions src/components/Layout.styles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,3 +145,7 @@ export const Banner = styled.div`
user-select: none;
`;

export const Filler = styled.div`
height: 20px;
`;
13 changes: 11 additions & 2 deletions src/components/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export { Banner } from './Layout.styles';
type LayoutProps = {
fullpageMode?: boolean;
showSettings?: boolean;
hideLogo?: boolean;

severity?: types.Severity | undefined;

Expand All @@ -28,11 +29,19 @@ const severityTitle: { [key in types.Severity]: string } = {
HIGH: 'High Risk',
};

export function Layout({ panel, body, footer, severity, fullpageMode = false, showSettings = true }: LayoutProps) {
export function Layout({
panel,
body,
footer,
severity,
fullpageMode = false,
showSettings = true,
hideLogo = false,
}: LayoutProps) {
return (
<Styled.Container>
<Styled.Background severity={severity}>
<Header showSettings={showSettings} />
{hideLogo ? <Styled.Filler></Styled.Filler> : <Header showSettings={showSettings} />}
{/* <AnimateGroup play={fullpageMode}> */}
<AnimatedComputerImage isVisible={fullpageMode} />
<AnimatedPanelHeader severity={severity} />
Expand Down
9 changes: 8 additions & 1 deletion src/pages/Popup/PopupPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import 'overlayscrollbars/overlayscrollbars.css';
import { getPrefferedChinId, setPreferredChainId } from '../../shared/storage';

interface PopupPanelProps {
hideLogo?: boolean;
fullscreen?: boolean;
hideAlpha?: boolean;
hideSettings?: boolean;
Expand All @@ -31,7 +32,12 @@ const emptyState = {
address: '',
};

export function PopupPanel({ hideAlpha = false, hideSettings = false, fullscreen = false }: PopupPanelProps) {
export function PopupPanel({
hideAlpha = false,
hideSettings = false,
fullscreen = false,
hideLogo = false,
}: PopupPanelProps) {
const [compactMode, setCompactMode] = useState(false);
const [searchInput, setSearchInput] = useState<SearchState>(emptyState);

Expand Down Expand Up @@ -93,6 +99,7 @@ export function PopupPanel({ hideAlpha = false, hideSettings = false, fullscreen
showSettings={!hideSettings}
fullpageMode={compactMode}
severity={analyzeResult.result?.severity}
hideLogo={hideLogo}
panel={
compactMode ? (
<NavigationBar
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Standalone/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function App() {
logPageView('Standalone');
}, []);

return <PopupPanel hideAlpha hideSettings fullscreen />;
return <PopupPanel hideAlpha hideSettings fullscreen hideLogo />;
}

const container = window.document.querySelector('#app-container');
Expand Down

0 comments on commit bdb53c3

Please sign in to comment.