Add About Readest window

This commit is contained in:
chrox
2024-11-26 18:38:27 +01:00
parent d7601d025e
commit 571baf98f2
6 changed files with 77 additions and 2 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@readest/readest-app",
"version": "0.1.0",
"version": "0.7.5",
"private": true,
"scripts": {
"dev": "next dev",
Binary file not shown.

After

Width:  |  Height:  |  Size: 304 KiB

+1 -1
View File
@@ -1,7 +1,7 @@
{
"$schema": "../node_modules/@tauri-apps/cli/config.schema.json",
"productName": "Readest",
"version": "0.7.2",
"version": "../package.json",
"identifier": "com.bilingify.readest",
"build": {
"frontendDist": "../out",
@@ -1,6 +1,7 @@
import React from 'react';
import MenuItem from '@/components/MenuItem';
import { setAboutDialogVisible } from '@/components/AboutWindow';
import useBooksManager from '../../hooks/useBooksManager';
interface BookMenuProps {
@@ -18,6 +19,7 @@ const BookMenu: React.FC<BookMenuProps> = ({ setIsDropdownOpen }) => {
setIsDropdownOpen?.(false);
};
const showAboutReadest = () => {
setAboutDialogVisible(true);
setIsDropdownOpen?.(false);
};
+2
View File
@@ -7,6 +7,7 @@ import { useEnv } from '@/context/EnvContext';
import { useLibraryStore } from '@/store/libraryStore';
import ReaderContent from './components/ReaderContent';
import { AboutWindow } from '@/components/AboutWindow';
import { useSettingsStore } from '@/store/settingsStore';
const ReaderPage = () => {
@@ -36,6 +37,7 @@ const ReaderPage = () => {
<div className='reader-page bg-base-100 text-base-content min-h-screen select-none'>
<Suspense>
<ReaderContent settings={settings} />
<AboutWindow />
</Suspense>
</div>
)
@@ -0,0 +1,71 @@
import React from 'react';
import Image from 'next/image';
import packageJson from '../../package.json';
import WindowButtons from './WindowButtons';
export const setAboutDialogVisible = (visible: boolean) => {
const dialog = document.getElementById('about_window');
if (visible) {
(dialog as HTMLDialogElement)?.showModal();
} else {
(dialog as HTMLDialogElement)?.close();
}
};
export const AboutWindow = () => {
return (
<dialog id='about_window' className='modal'>
<form method='dialog' className='modal-box w-96 max-w-lg p-4'>
<div className='dialog-header bg-base-100 sticky top-0 z-10 flex items-center justify-center p-2'>
<WindowButtons
className='window-buttons absolute right-0 flex h-full items-center'
showMinimize={false}
showMaximize={false}
onClose={() => setAboutDialogVisible(false)}
/>
</div>
<div className='flex flex-col items-center px-8'>
<div className='mb-4'>
<Image src='/icon.png' alt='App Logo' className='h-24 w-24' width={64} height={64} />
</div>
<h2 className='text-2xl font-bold'>Readest</h2>
<p className='text-neutral-content text-sm'>Bilingify LLC</p>
<span className='badge badge-primary mt-2'>Version {packageJson.version}</span>
</div>
<div className='divider'></div>
<div className='flex flex-col items-center px-4 text-center'>
<p className='text-neutral-content text-sm'>
© {new Date().getFullYear()} Bilingify LLC. All rights reserved.
</p>
<p className='text-neutral-content mt-2 text-xs'>
This software is licensed under the{' '}
<a
href='https://www.gnu.org/licenses/agpl-3.0.html'
target='_blank'
rel='noopener noreferrer'
className='text-blue-500 underline'
>
GNU Affero General Public License v3.0
</a>
. You are free to use, modify, and distribute this software under the terms of the AGPL
v3 license. Please see the license for more details.
</p>
<p className='text-neutral-content mt-2 text-xs'>
Source code is available at{' '}
<a
href='https://github.com/chrox/readest'
target='_blank'
rel='noopener noreferrer'
className='text-blue-500 underline'
>
GitHub
</a>
.
</p>
</div>
</form>
</dialog>
);
};