feat: add postage stamp guide (#455)

* feat: add postage stamp guide to create new postage stamp

* feat: add the docs to the upload page as well
This commit is contained in:
Vojtech Simetka
2022-06-28 17:29:46 +02:00
committed by GitHub
parent a3c02dbf8a
commit fb8775d0a7
3 changed files with 109 additions and 81 deletions
+11 -1
View File
@@ -49,7 +49,17 @@ export function UploadActionBar({
</SwarmButton> </SwarmButton>
</ExpandableListItemActions> </ExpandableListItemActions>
</Box> </Box>
<DocumentationText>You need a postage stamp to upload.</DocumentationText> <DocumentationText>
You need a postage stamp to upload. Find out more in{' '}
<a
href="https://medium.com/ethereum-swarm/how-to-upload-data-to-the-swarm-network-c0766c3ae381"
target="_blank"
rel="noreferrer"
>
this guide
</a>
.
</DocumentationText>
</> </>
) )
} }
+1 -1
View File
@@ -46,7 +46,7 @@ export default function Index(): ReactElement {
target="_blank" target="_blank"
rel="noreferrer" rel="noreferrer"
> >
this guide. this guide
</a> </a>
. .
</Typography> </Typography>
+19 -1
View File
@@ -70,6 +70,21 @@ export function PostageStampCreation({ onFinished }: Props): ReactElement {
} }
return ( return (
<>
<Box mb={4}>
<Typography>
To upload data to Swarm network, you will need to purchase a postage stamp. If you&apos;re not familiar with
this, please read{' '}
<a
href="https://medium.com/ethereum-swarm/how-to-upload-data-to-the-swarm-network-c0766c3ae381"
target="_blank"
rel="noreferrer"
>
this guide
</a>
.
</Typography>
</Box>
<Formik <Formik
initialValues={initialFormValues} initialValues={initialFormValues}
onSubmit={async (values: FormValues, actions: FormikHelpers<FormValues>) => { onSubmit={async (values: FormValues, actions: FormikHelpers<FormValues>) => {
@@ -123,7 +138,9 @@ export function PostageStampCreation({ onFinished }: Props): ReactElement {
<Box mt={0.25} sx={{ bgcolor: '#f6f6f6' }} p={2}> <Box mt={0.25} sx={{ bgcolor: '#f6f6f6' }} p={2}>
<Grid container justifyContent="space-between"> <Grid container justifyContent="space-between">
<Typography>Corresponding file size</Typography> <Typography>Corresponding file size</Typography>
<Typography>{!errors.depth && values.depth ? getFileSize(parseInt(values.depth, 10)) : '-'}</Typography> <Typography>
{!errors.depth && values.depth ? getFileSize(parseInt(values.depth, 10)) : '-'}
</Typography>
</Grid> </Grid>
</Box> </Box>
</Box> </Box>
@@ -162,5 +179,6 @@ export function PostageStampCreation({ onFinished }: Props): ReactElement {
</Form> </Form>
)} )}
</Formik> </Formik>
</>
) )
} }