restore direct links
This commit is contained in:
parent
1a0cc1eba3
commit
16c7e6bd35
|
@ -4,7 +4,7 @@
|
|||
|
||||
Un motore di ricerca libri basato su protocollo IPFS.
|
||||
|
||||
Una versione funzionante si trova [qui](https://millelibri.lamacchinadesiderante.org).
|
||||
Una versione funzionante si trova [qui](https://millelibri.copyriot.xyz).
|
||||
|
||||
Il progetto è partito come un fork di [Book Searcher](https://github.com/book-searcher-org/book-searcher).
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
# Logs
|
||||
logs
|
||||
json
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "frontend",
|
||||
"private": true,
|
||||
"version": "v0.6.0",
|
||||
"version": "v0.7.0",
|
||||
"type": "module",
|
||||
"repository": "https://git.lamacchinadesiderante.org/lamacchinadesiderante/millelibri",
|
||||
"scripts": {
|
||||
|
|
|
@ -19,12 +19,12 @@ interface IProps {
|
|||
|
||||
const BookDetailsCard: React.FC<IProps> = (props) => {
|
||||
|
||||
// const downloadLinkFromIPFS = (gateway: string, book: Book) => {
|
||||
// return (
|
||||
// `https://${gateway}/ipfs/${book.ipfs_cid}?filename=` +
|
||||
// encodeURIComponent(`${book.title}_${book.author}.${book.extension}`)
|
||||
// );
|
||||
// }
|
||||
const downloadLinkFromIPFS = (gateway: string, book: Book) => {
|
||||
return (
|
||||
`https://${gateway}/ipfs/${book.ipfs_cid}?filename=` +
|
||||
encodeURIComponent(`${book.title}_${book.author}.${book.extension}`)
|
||||
);
|
||||
}
|
||||
|
||||
const { t } = useTranslation();
|
||||
|
||||
|
@ -54,7 +54,7 @@ const BookDetailsCard: React.FC<IProps> = (props) => {
|
|||
<Divider />
|
||||
<CardBody>
|
||||
<SimpleGrid columns={{ sm: 1, md: 3, lg: 4 }} spacing={{ base: 2, md: 4 }}>
|
||||
{/* <Description name={`${t('book.id') ?? 'zlib/libgen id'}: `}>{id}</Description> */}
|
||||
<Description name={`Id: `}>{id}</Description>
|
||||
<GridItem colSpan={{ sm: 1, md: 2, lg: 3 }}>
|
||||
<Description name={`${t('book.ipfs_cid') ?? 'IPFS CID'}: `}>
|
||||
{ipfs_cid}
|
||||
|
@ -88,7 +88,7 @@ const BookDetailsCard: React.FC<IProps> = (props) => {
|
|||
</CardBody>
|
||||
<CardFooter flexDirection="column">
|
||||
|
||||
{/* <SimpleGrid columns={{ sm: 2, md: 3, lg: 4, xl: 5 }} spacing={{ base: 2, md: 4 }}>
|
||||
<SimpleGrid columns={{ sm: 2, md: 3, lg: 4, xl: 5 }} spacing={{ base: 2, md: 4 }}>
|
||||
{ipfsGateways.map((gateway) => (
|
||||
<Button
|
||||
as={ExternalLink}
|
||||
|
@ -100,9 +100,9 @@ const BookDetailsCard: React.FC<IProps> = (props) => {
|
|||
</Button>
|
||||
))}
|
||||
|
||||
</SimpleGrid> */}
|
||||
</SimpleGrid>
|
||||
|
||||
<Flex><Text fontWeight={'bold'}>{t('disclaimer.nolink_warning')}</Text></Flex>
|
||||
{/* <Flex><Text fontWeight={'bold'}>{t('disclaimer.nolink_warning')}</Text></Flex> */}
|
||||
|
||||
<Flex justify="flex-end">
|
||||
<Button
|
||||
|
|
|
@ -5,6 +5,7 @@ interface TauriConfig {
|
|||
|
||||
export const ipfsGateways: string[] = [
|
||||
'cloudflare-ipfs.com',
|
||||
'ipfs.2read.net',
|
||||
'dweb.link',
|
||||
'ipfs.io',
|
||||
'gateway.pinata.cloud'
|
||||
|
|
Loading…
Reference in New Issue