Skip to content

Commit 167690c

Browse files
authored
Merge pull request #13 from CodeDead/feature/refactoring
Fixed missing OK translation, code refactoring
2 parents cf20a0d + 9f7dae3 commit 167690c

File tree

12 files changed

+26
-17
lines changed

12 files changed

+26
-17
lines changed

src/components/App/index.jsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,13 @@ const App = () => {
8181
});
8282
};
8383

84+
/**
85+
* Close the alert dialog
86+
*/
87+
const closeAlertDialog = () => {
88+
d1(setError(null));
89+
};
90+
8491
useEffect(() => {
8592
// eslint-disable-next-line no-underscore-dangle
8693
if (autoUpdate && window.__TAURI__) {
@@ -116,8 +123,8 @@ const App = () => {
116123
title={language.error}
117124
content={error}
118125
agreeLabel={language.ok}
119-
onOk={() => d1(setError(null))}
120-
onClose={() => d1(setError(null))}
126+
onOk={closeAlertDialog}
127+
onClose={closeAlertDialog}
121128
/>
122129
) : null}
123130
{update && update.updateAvailable ? (

src/components/ClippedDrawer/index.jsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as React from 'react';
1+
import React, { useContext } from 'react';
22
import Box from '@mui/material/Box';
33
import Drawer from '@mui/material/Drawer';
44
import Toolbar from '@mui/material/Toolbar';
@@ -15,7 +15,6 @@ import LightbulbIcon from '@mui/icons-material/Lightbulb';
1515
import InfoIcon from '@mui/icons-material/Info';
1616
import SettingsIcon from '@mui/icons-material/Settings';
1717
import AttachMoneyIcon from '@mui/icons-material/AttachMoney';
18-
import { useContext } from 'react';
1918
import { useNavigate } from 'react-router-dom';
2019
import { MainContext } from '../../contexts/MainContextProvider';
2120
import { openWebSite } from '../../reducers/MainReducer/Actions';

src/components/MuiVirtualizedTable/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as React from 'react';
1+
import React from 'react';
22
import clsx from 'clsx';
33
import TableCell from '@mui/material/TableCell';
44
import { AutoSizer, Column, Table } from 'react-virtualized';

src/components/TopBar/index.jsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
import * as React from 'react';
1+
import React, { useContext } from 'react';
22
import AppBar from '@mui/material/AppBar';
33
import Toolbar from '@mui/material/Toolbar';
44
import Typography from '@mui/material/Typography';
5-
import { useContext } from 'react';
65
import IconButton from '@mui/material/IconButton';
76
import Brightness5Icon from '@mui/icons-material/Brightness5';
87
import Brightness7Icon from '@mui/icons-material/Brightness7';

src/languages/en_us.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,5 +76,6 @@
7676
"plainText": "Plain text",
7777
"notFound": "There's really nothing here except for some top secret stuff (maybe).",
7878
"notFoundGoHome": "Would you like to go back to the home page?",
79-
"home": "Home"
79+
"home": "Home",
80+
"ok": "OK"
8081
}

src/languages/fr_fr.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,5 +76,6 @@
7676
"plainText": "Texte brut",
7777
"notFound": "Il n'y a rien ici",
7878
"notFoundGoHome": "Retour à l'accueil ?",
79-
"home": "Accueil"
79+
"home": "Accueil",
80+
"ok": "OK"
8081
}

src/languages/nl_nl.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,5 +76,6 @@
7676
"plainText": "Tekst",
7777
"notFound": "Er is hier niets te zien.",
7878
"notFoundGoHome": "Naar de startpagina gaan?",
79-
"home": "Startpagina"
79+
"home": "Startpagina",
80+
"ok": "Oké"
8081
}

src/routes/About/index.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import packageJson from '../../../package.json';
1010

1111
const About = () => {
1212
const [state, d1] = useContext(MainContext);
13+
1314
const { languageIndex } = state;
1415
const language = state.languages[languageIndex];
1516

src/routes/Advisor/index.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { setPageIndex } from '../../reducers/MainReducer/Actions';
1212

1313
const Advisor = () => {
1414
const [state, d1] = useContext(MainContext);
15+
1516
const { languageIndex } = state;
1617
const language = state.languages[languageIndex];
1718

src/routes/Generate/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import Container from '@mui/material/Container';
33
import Button from '@mui/material/Button';
44
import { createWorkerFactory, useWorker } from '@shopify/react-web-worker';
55
import { styled } from '@mui/material/styles';
6-
import { Paper } from '@mui/material';
6+
import Paper from '@mui/material/Paper';
77
import { save } from '@tauri-apps/api/dialog';
88
import { invoke } from '@tauri-apps/api/tauri';
99
import { MainContext } from '../../contexts/MainContextProvider';

0 commit comments

Comments
 (0)