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

Sign final keshav #75

Closed
wants to merge 6 commits into from
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<include name="IDR_BRAVE_REWARDS_UPLOAD_HOVER_LOGO" file="page/assets/uploadHover.svg" type="BINDATA" />
<include name="IDR_BRAVE_REWARDS_PDFMAIN" file="page/assets/pdfMain.png" type="BINDATA" />
<include name="IDR_BRAVE_REWARDS_PINGWATERMARK" file="page/assets/Frame.png" type="BINDATA" />
<include name="IDR_BRAVE_REWARDS_LOADER" file="page/assets/loader.png" type="BINDATA" />
</if>

<!-- WebUI Ping Rewards Internals resources -->
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at https://mozilla.org/MPL/2.0/. */
import * as React from 'react';
import {
StyledErrorPopup,
StyledErrorTitle,
StyledErrorMessage,
StyledErrorButtons,
StyledConfirmButton
} from './styles';
import { ErrorPopupProps } from '../../utils/types';

export const ErrorPopup: React.FC<ErrorPopupProps> = ({ message, onContinue }) => (
<StyledErrorPopup>
<StyledErrorTitle>
Action Incomplete!
</StyledErrorTitle>
<StyledErrorMessage>{message}</StyledErrorMessage>
<StyledErrorButtons>
<StyledConfirmButton onClick={onContinue} $continue>Continue</StyledConfirmButton>
</StyledErrorButtons>
</StyledErrorPopup>
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at https://mozilla.org/MPL/2.0/. */
import styled from "styled-components";

export const StyledErrorPopup = styled('div')`
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background-color: #323639;
border-radius: 24px;
padding: 20px 45px;
width: 595px;
display: flex;
flex-direction: column;
gap: 10px;
height: fit-content;
border: 1px solid #CACACA;
transition: height 0.3s ease;
overflow: hidden;
z-index: 1000;
`

export const StyledErrorTitle = styled('h2')<{ verification?: boolean }>`
color: Red;
font-family: Poppins;
font-size: ${p => p.verification ? '40px' : '45px'};
margin: 12px 0 0 0;
padding: 0;
font-style: normal;
font-weight: 400;
line-height: normal;
`

export const StyledErrorMessage = styled('p')`
color: #FFF;
font-family: Poppins;
font-size: 20px;
font-style: normal;
font-weight: 400;
line-height: normal;
margin-top: -5px;
`

export const StyledErrorName = styled('p')`
color: #FFF;
font-family: Poppins;
font-size: 25px;
font-style: normal;
margin: -10px 0 10px 0;
font-weight: 700;
line-height: normal;
`

export const StyledErrorButtons = styled('div')`
display: flex;
margin-top: 45px;
justify-content: center;
gap: 28px;
margin-left: 350px;
`

export const StyledConfirmButton = styled('button')<{ $continue?: boolean }>`
display: flex;
padding: 15px 35px;
align-items: baseline;
gap: 10px;
background-color: ${p => p.$continue ? '#2BB563' : 'white'};
color: ${p => p.$continue ? 'white' : 'black'};
border: none;
border-radius: 40px;
font-size: 16px;
cursor: pointer;
&:hover {
background-color: ${p => p.$continue ? '#2BB563' : '#2BB563'};
color: white;
}
`
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import uploadLogo from '../../../assets/upload.svg';
import uploadHoverLogo from '../../../assets/uploadHover.svg';
import { AnimatedStatus } from '../AnimatedStatus/AnimatedStatus';
import { HeaderProps } from '../../utils/types';
import { Tooltip } from '../ToolTip/ToolTip';

export const Header: React.FC<HeaderProps> = ({
pdfFileName,
Expand All @@ -57,8 +58,11 @@ export const Header: React.FC<HeaderProps> = ({
statusType,
handleLogoClick,
fileInputRef,
isSigned,
message,
}) => {
const [logoSrc, setLogoSrc] = useState(uploadLogo);

const renderPageNumber = () => (
isEditingPageNumber ? (
<form onSubmit={handlePageNumberSubmit}>
Expand Down Expand Up @@ -92,13 +96,19 @@ export const Header: React.FC<HeaderProps> = ({
<StyledFadeAway fadeAnimation={isStatusVisible}>
<StyledHeaderButton pdfFile={pdfFile} onClick={handleSignButtonClick}>Add signature</StyledHeaderButton>
<StyledHeaderControlsBar />
<StyledHeaderButton
pdfFile={pdfFile}
onClick={handleVerifyButtonClick}
as={isVerified ? StyledVerified : isVerificationFailed ? StyledNotVerified : 'button'}
<Tooltip
text={message}
isVisible={isVerificationFailed}
isError={true}
>
Verify document
</StyledHeaderButton>
<StyledHeaderButton
pdfFile={pdfFile}
onClick={handleVerifyButtonClick}
as={isVerified ? StyledVerified : isVerificationFailed ? StyledNotVerified : 'button'}
>
Verify document
</StyledHeaderButton>
</Tooltip>
<StyledHeaderControlsBar />
</StyledFadeAway>
</>
Expand All @@ -111,39 +121,49 @@ export const Header: React.FC<HeaderProps> = ({
<StyledHeader>
<StyledNavBar>
<StyledPDFLogoContainer>
<StyledPDFLogo
src={logoSrc}
alt="PDF Logo"
onClick={handleLogoClick}
onMouseEnter={() => setLogoSrc(uploadHoverLogo)}
onMouseLeave={() => setLogoSrc(uploadLogo)}
/>
<input
type="file"
ref={fileInputRef}
style={{ display: 'none' }}
/>
<StyledPDFName>{pdfFileName}</StyledPDFName>
<StyledPDFLogo
src={logoSrc}
alt="PDF Logo"
onClick={handleLogoClick}
onMouseEnter={() => setLogoSrc(uploadHoverLogo)}
onMouseLeave={() => setLogoSrc(uploadLogo)}
/>
<input
type="file"
ref={fileInputRef}
style={{ display: 'none' }}
/>
<Tooltip text={pdfFileName}>
<StyledPDFName>
{pdfFileName}
</StyledPDFName>
</Tooltip>
</StyledPDFLogoContainer>
<StyledHeaderControlsContainer>
<StyledHeaderControls>
{renderHeaderControls()}
<StyledPageChangingControls>
<StyledPageControl as="div" direction="previous" pdfFile={pdfFile} onClick={handlePreviousPage}>&lt;</StyledPageControl>
<StyledPageNumber>
{renderPageNumber()}
</StyledPageNumber>
<StyledPageControl as="div" direction="next" pdfFile={pdfFile} onClick={handleNextPage}>&gt;</StyledPageControl>
</StyledPageChangingControls>
</StyledHeaderControls>
<StyledSaveButton onClick={handleDownloadButtonClick} disabled={!pdfFile} pdfFile={pdfFile}>Save</StyledSaveButton>
<StyledHeaderControls>
{renderHeaderControls()}
<StyledPageChangingControls>
<StyledPageControl as="div" direction="previous" pdfFile={pdfFile} onClick={handlePreviousPage}>&lt;</StyledPageControl>
<StyledPageNumber>
{renderPageNumber()}
</StyledPageNumber>
<StyledPageControl as="div" direction="next" pdfFile={pdfFile} onClick={handleNextPage}>&gt;</StyledPageControl>
</StyledPageChangingControls>
</StyledHeaderControls>
<StyledSaveButton isSigned={isSigned} onClick={handleDownloadButtonClick} disabled={!pdfFile} pdfFile={pdfFile}>Save</StyledSaveButton>
</StyledHeaderControlsContainer>
<StyledHelpButtonContainer>
<a href="https://ping-browser.com/help-1" target="_blank" rel="noopener noreferrer">
<StyledHelpButton>?</StyledHelpButton>
</a>
<Tooltip text="Get help">
<a
href="https://ping-browser.com/help-1"
target="_blank"
rel="noopener noreferrer"
>
<StyledHelpButton>?</StyledHelpButton>
</a>
</Tooltip>
</StyledHelpButtonContainer>
</StyledNavBar>
</StyledNavBar>
</StyledHeader>
);
};
Loading
Loading