Skip to content

Commit 702ac58

Browse files
authored
Merge pull request #4 from VPKSoftOrg/addAboutAndMinorFixes
Layout fixes and about popup
2 parents 99cfc3c + 17c6bd9 commit 702ac58

File tree

11 files changed

+319
-12
lines changed

11 files changed

+319
-12
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ A [PWA](https://en.wikipedia.org/wiki/Progressive_web_app) dictionary software u
33

44
Keeps a dictionary with user-specified entries for searching, editing and saving. Data can also be exported to or imported from JSON file. The data can be searched with text. The search uses [Fuse.js](https://www.fusejs.io).
55

6-
The sreenshots of the app using the [sample data](https://github.com/VPKSoftOrg/json-dictionary-browser/blob/develop/sample_data/chat_abbreviations.json) containing chat abbreviations dictionary:
6+
The screenshots of the app using the [sample data](https://github.com/VPKSoftOrg/json-dictionary-browser/blob/develop/sample_data/chat_abbreviations.json) containing chat abbreviations dictionary:
77
![image](https://github.com/user-attachments/assets/d284e847-58e3-4315-8561-c5bfacb1ef1f) ![image](https://github.com/user-attachments/assets/3013cbd4-40b2-4ecd-ae68-6133c26b4861)
88

99
## The data format

package-lock.json

Lines changed: 20 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"name": "json-dictionary-browser",
3+
"description": "JSON Dictionary Browser",
34
"private": true,
4-
"version": "0.0.1",
5+
"version": "0.0.2",
56
"type": "module",
67
"scripts": {
78
"dev": "vite",
@@ -27,6 +28,7 @@
2728
},
2829
"devDependencies": {
2930
"@biomejs/biome": "1.9.4",
31+
"@types/node": "^22.14.1",
3032
"@types/react": "^19.1.0",
3133
"@types/react-dom": "^19.1.1",
3234
"@types/wicg-file-system-access": "^2023.10.6",

src/App.tsx

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as React from "react";
22
import "./App.css";
33
import { faEdit, faFile, faMoon, faSun } from "@fortawesome/free-regular-svg-icons";
4-
import { faDownload, faPlus } from "@fortawesome/free-solid-svg-icons";
4+
import { faDownload, faInfo, faPlus } from "@fortawesome/free-solid-svg-icons";
55
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
66
import { Button, Input, Switch, Table, Tooltip } from "antd";
77
import type { Key } from "antd/es/table/interface";
@@ -12,6 +12,7 @@ import { DragDropOpenFileAreaButton } from "./Components/DragDropOpenFileArea.ts
1212
import { useAntdTheme, useAntdToken } from "./Context/AntdThemeContext.tsx";
1313
import { useNotify } from "./Hooks/Notify.ts";
1414
import { useDynamicDownload } from "./Hooks/UseDynamicDownload.ts";
15+
import { AboutPopup } from "./Popups/AboutPopup.tsx";
1516
import { AddEditRowDataPopup } from "./Popups/AddEditRowDataPopup.tsx";
1617
import { FieldSelectPopup } from "./Popups/FieldSelectPopup.tsx";
1718
import { PwaBadge } from "./PwaBadge.tsx";
@@ -38,6 +39,7 @@ let App = ({ className }: Props) => {
3839
const [editAddEntry, setEditAddEntry] = React.useState<DictionaryEntry | undefined>(undefined);
3940
const [editEntryNewMode, setEditEntryNewMode] = React.useState(true);
4041
const [selectedRowKeys, setSelectedRowKeys] = React.useState<Array<Key>>([]);
42+
const [aboutPopupVisible, setAboutPopupVisible] = React.useState(false);
4143

4244
// Persistent state
4345
const [keys, setKeys] = React.useState<Array<string>>(getItem<Array<string>>("keys", []));
@@ -239,6 +241,10 @@ let App = ({ className }: Props) => {
239241
};
240242
}, [onSelectionChange]);
241243

244+
const showAboutClick = React.useCallback(() => {
245+
setAboutPopupVisible(true);
246+
}, []);
247+
242248
return (
243249
<div id="App" className={classNames(className, App.name)}>
244250
{contextHolder}
@@ -252,11 +258,13 @@ let App = ({ className }: Props) => {
252258
onSearch={onSearch}
253259
className="App-toolbar-search"
254260
/>
255-
<Button //
256-
icon={<FontAwesomeIcon icon={faDownload} />}
257-
onClick={downloadClick}
258-
className="Toolbar-button"
259-
/>
261+
<Tooltip title="Save the dictionary">
262+
<Button //
263+
icon={<FontAwesomeIcon icon={faDownload} />}
264+
onClick={downloadClick}
265+
className="Toolbar-button"
266+
/>
267+
</Tooltip>
260268
<Switch
261269
className="App-toolbar-switch"
262270
checkedChildren={<FontAwesomeIcon icon={faMoon} />}
@@ -265,6 +273,13 @@ let App = ({ className }: Props) => {
265273
checked={darkMode}
266274
onChange={onLightDarkSwitchChangeEventHandler}
267275
/>
276+
<Tooltip title="About">
277+
<Button //
278+
icon={<FontAwesomeIcon icon={faInfo} />}
279+
onClick={showAboutClick}
280+
className="Toolbar-button"
281+
/>
282+
</Tooltip>
268283
</div>
269284
<div className="App-toolbar">
270285
<Tooltip title="New dictionary">
@@ -326,6 +341,12 @@ let App = ({ className }: Props) => {
326341
editAddEntry={editEntryNewMode ? undefined : editAddEntry}
327342
/>
328343

344+
<AboutPopup //
345+
visible={aboutPopupVisible}
346+
onClose={() => setAboutPopupVisible(false)}
347+
darkMode={darkMode}
348+
/>
349+
329350
<PwaBadge />
330351
</div>
331352
);

src/Images/LogoOnly.svg

Lines changed: 85 additions & 0 deletions
Loading

src/Images/NetlifyLogo.svg

Lines changed: 22 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)