Merge pull request 'v0.7 - Restore direct links' (#6) from version/0.7 into master

Reviewed-on: #6
This commit is contained in:
lamacchinadesiderante 2023-01-30 21:46:33 +00:00
commit 19711c178b
5 changed files with 14 additions and 12 deletions

View File

@ -4,7 +4,7 @@
Un motore di ricerca libri basato su protocollo IPFS. 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). Il progetto è partito come un fork di [Book Searcher](https://github.com/book-searcher-org/book-searcher).

1
frontend/.gitignore vendored
View File

@ -1,5 +1,6 @@
# Logs # Logs
logs logs
json
*.log *.log
npm-debug.log* npm-debug.log*
yarn-debug.log* yarn-debug.log*

View File

@ -1,7 +1,7 @@
{ {
"name": "frontend", "name": "frontend",
"private": true, "private": true,
"version": "v0.6.0", "version": "v0.7.0",
"type": "module", "type": "module",
"repository": "https://git.lamacchinadesiderante.org/lamacchinadesiderante/millelibri", "repository": "https://git.lamacchinadesiderante.org/lamacchinadesiderante/millelibri",
"scripts": { "scripts": {

View File

@ -19,12 +19,12 @@ interface IProps {
const BookDetailsCard: React.FC<IProps> = (props) => { const BookDetailsCard: React.FC<IProps> = (props) => {
// const downloadLinkFromIPFS = (gateway: string, book: Book) => { const downloadLinkFromIPFS = (gateway: string, book: Book) => {
// return ( return (
// `https://${gateway}/ipfs/${book.ipfs_cid}?filename=` + `https://${gateway}/ipfs/${book.ipfs_cid}?filename=` +
// encodeURIComponent(`${book.title}_${book.author}.${book.extension}`) encodeURIComponent(`${book.title}_${book.author}.${book.extension}`)
// ); );
// } }
const { t } = useTranslation(); const { t } = useTranslation();
@ -54,7 +54,7 @@ const BookDetailsCard: React.FC<IProps> = (props) => {
<Divider /> <Divider />
<CardBody> <CardBody>
<SimpleGrid columns={{ sm: 1, md: 3, lg: 4 }} spacing={{ base: 2, md: 4 }}> <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 }}> <GridItem colSpan={{ sm: 1, md: 2, lg: 3 }}>
<Description name={`${t('book.ipfs_cid') ?? 'IPFS CID'}: `}> <Description name={`${t('book.ipfs_cid') ?? 'IPFS CID'}: `}>
{ipfs_cid} {ipfs_cid}
@ -88,7 +88,7 @@ const BookDetailsCard: React.FC<IProps> = (props) => {
</CardBody> </CardBody>
<CardFooter flexDirection="column"> <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) => ( {ipfsGateways.map((gateway) => (
<Button <Button
as={ExternalLink} as={ExternalLink}
@ -100,9 +100,9 @@ const BookDetailsCard: React.FC<IProps> = (props) => {
</Button> </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"> <Flex justify="flex-end">
<Button <Button

View File

@ -5,6 +5,7 @@ interface TauriConfig {
export const ipfsGateways: string[] = [ export const ipfsGateways: string[] = [
'cloudflare-ipfs.com', 'cloudflare-ipfs.com',
'ipfs.2read.net',
'dweb.link', 'dweb.link',
'ipfs.io', 'ipfs.io',
'gateway.pinata.cloud' 'gateway.pinata.cloud'