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

Added Logo-less mode #105

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
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