-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
frontend rebased on the remote-proof-generation branch
- Loading branch information
Showing
23 changed files
with
3,691 additions
and
632 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,5 +11,17 @@ | |
"packageManager": "[email protected]", | ||
"resolutions": { | ||
"zk-regex-sdk": "portal:/Users/savitar/Projects/opensource/proof-of-twitter/packages/app/zk-regex-sdk" | ||
}, | ||
"devDependencies": { | ||
"autoprefixer": "^10.4.19", | ||
"postcss": "^8.4.40", | ||
"react-router-dom": "^6.26.0", | ||
"tailwindcss": "^3.4.7" | ||
}, | ||
"dependencies": { | ||
"@emotion/react": "^11.13.0", | ||
"@emotion/styled": "^11.13.0", | ||
"@mui/icons-material": "^5.16.6", | ||
"@mui/material": "^5.16.6" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,6 +39,17 @@ | |
window.process = process; | ||
window.setImmediate = setImmediate; | ||
</script> | ||
|
||
|
||
<link rel="preconnect" href="https://fonts.googleapis.com"> | ||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> | ||
<link href="https://fonts.googleapis.com/css2?family=Space+Grotesk:[email protected]&display=swap" rel="stylesheet"> | ||
|
||
<style> | ||
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:[email protected]&display=swap'); | ||
</style> | ||
|
||
|
||
</head> | ||
<body> | ||
<noscript>You need to enable JavaScript to run this app.</noscript> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// src/proofWorker.js | ||
|
||
import { generateProof } from "@zk-email/helpers/dist/zkp"; | ||
|
||
self.onmessage = async (e) => { | ||
const { input, circuitArtifactsUrl, circuitName } = e.data; | ||
|
||
try { | ||
const { proof, publicSignals } = await generateProof( | ||
input, | ||
circuitArtifactsUrl, | ||
circuitName | ||
); | ||
|
||
self.postMessage({ proof, publicSignals }); | ||
} catch (error) { | ||
self.postMessage({ error: error.message }); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
import React, { FC } from 'react'; | ||
import { | ||
Accordion as MuiAccordion, | ||
AccordionSummary, | ||
AccordionDetails, | ||
Typography, | ||
styled, | ||
} from '@mui/material'; | ||
import ExpandMoreIcon from '@mui/icons-material/ExpandMore'; | ||
|
||
// Define the props types | ||
interface AccordionProps { | ||
title: string; | ||
contents: string; | ||
alignment?: 'left' | 'right'; | ||
} | ||
|
||
const CustomAccordion = styled(MuiAccordion)(({ theme }) => ({ | ||
marginBottom: theme.spacing(2), | ||
'&:before': { | ||
display: 'none', | ||
}, | ||
background: 'inherit', | ||
boxShadow: 'none', | ||
borderBottom: '1px solid rgba(0, 0, 0, 0.12)', | ||
'& .MuiAccordionSummary-root': { | ||
backgroundColor: 'rgba(0, 0, 0, 0)', | ||
'&:hover .MuiAccordionSummary-expandIconWrapper': { | ||
color: theme.palette.secondary.main, | ||
}, | ||
}, | ||
'& .MuiAccordionSummary-content': { | ||
margin: 0, | ||
display: 'flex', | ||
alignItems: 'center', | ||
width: '100%', | ||
}, | ||
'& .MuiAccordionSummary-expandIconWrapper': { | ||
marginRight: theme.spacing(1), | ||
transition: 'transform 0.2s', | ||
}, | ||
'& .MuiAccordionSummary-expandIconWrapper.Mui-expanded': { | ||
transform: 'rotate(180deg)', | ||
}, | ||
'& .MuiAccordionDetails-root': { | ||
padding: theme.spacing(2), | ||
}, | ||
})); | ||
|
||
const Accordion: FC<AccordionProps> = ({ title, contents, alignment = 'left' }) => { | ||
return ( | ||
<CustomAccordion> | ||
<AccordionSummary | ||
expandIcon={<ExpandMoreIcon />} | ||
aria-controls="panel-content" | ||
id="panel-header" | ||
sx={{ | ||
flexDirection: alignment === 'right' ? 'row-reverse' : 'row', | ||
justifyContent: alignment === 'right' ? 'space-between' : 'flex-start', | ||
'& .MuiAccordionSummary-expandIconWrapper': { | ||
order: alignment === 'right' ? 2 : 1, | ||
marginRight: alignment === 'right' ? 0 : 1, | ||
marginLeft: alignment === 'right' ? 1 : 0, | ||
}, | ||
width: '100%', | ||
}} | ||
> | ||
<Typography | ||
color="black" | ||
fontWeight="500" | ||
sx={{ | ||
fontSize: { xs: '12px', sm: '15px', md: '19px' }, | ||
textAlign: alignment === 'right' ? 'right' : 'left', | ||
flexGrow: 1, | ||
}} | ||
> | ||
{title} | ||
</Typography> | ||
</AccordionSummary> | ||
<AccordionDetails> | ||
<Typography | ||
sx={{ | ||
paddingLeft: alignment === 'right' ? '0px' : '0px', | ||
paddingRight: alignment === 'right' ? '0px' : '0px', | ||
color: '#666363', | ||
fontSize: { xs: '11px', sm: '14px', md: '16px' }, | ||
textAlign: alignment === 'right' ? 'right' : 'left', | ||
}} | ||
> | ||
{contents} | ||
</Typography> | ||
</AccordionDetails> | ||
</CustomAccordion> | ||
); | ||
}; | ||
|
||
export default Accordion; |
Oops, something went wrong.