Skip to content
This repository has been archived by the owner on Apr 29, 2022. It is now read-only.

Fix minor details across user interface #187

Merged
merged 1 commit into from
Jun 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"menubar": "8.0.2"
},
"devDependencies": {
"@material-ui/core": "4.10.1",
"@material-ui/core": "4.10.2",
"@material-ui/icons": "4.9.1",
"babel-cli": "6.26.0",
"babel-preset-env": "1.7.0",
Expand All @@ -50,7 +50,7 @@
"electron-notarize": "0.3.0",
"eslint": "6.8.0",
"eslint-config-airbnb": "18.1.0",
"eslint-plugin-import": "2.20.2",
"eslint-plugin-import": "2.21.2",
"eslint-plugin-jsx-a11y": "6.2.3",
"eslint-plugin-react": "7.20.0",
"eslint-plugin-react-hooks": "1.7.0",
Expand Down
1 change: 0 additions & 1 deletion public/libs/create-menu.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

const {
Menu,
app,
Expand Down
1 change: 0 additions & 1 deletion public/libs/preferences.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ const resetPreferences = () => {
});
};


module.exports = {
getPreference,
getPreferences,
Expand Down
1 change: 0 additions & 1 deletion src/components/pages/history/search-box.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import Tooltip from '@material-ui/core/Tooltip';
import connectComponent from '../../../helpers/connect-component';
import getLocale from '../../../helpers/get-locale';


import { loadHistory, updateQuery } from '../../../state/pages/history/actions';

const styles = (theme) => ({
Expand Down
4 changes: 4 additions & 0 deletions src/components/pages/home/dictionary.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,26 @@ const styles = (theme) => ({
textTransform: 'uppercase',
color: theme.palette.text.secondary,
marginTop: theme.spacing(2),
userSelect: 'text',
'&:not(:first-child)': {
marginTop: theme.spacing(4),
},
},
word: {
color: theme.palette.text.primary,
lineHeight: 1.3,
userSelect: 'text',
},
translations: {
color: theme.palette.text.secondary,
userSelect: 'text',
'&:not(:last-child)': {
marginBottom: theme.spacing(1.5),
},
},
link: {
color: 'inherit',
userSelect: 'text',
},
});

Expand Down
1 change: 0 additions & 1 deletion src/components/pages/home/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ const styles = (theme) => ({
},
copyright: {
color: theme.palette.text.disabled,
cursor: 'pointer',
fontWeight: 400,
fontSize: '0.8rem',
marginLeft: 12,
Expand Down
2 changes: 0 additions & 2 deletions src/components/pages/language-list/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import { ROUTE_HOME, ROUTE_LANGUAGE_LIST } from '../../../constants/routes';
import LanguageListList from './list';
import SearchBox from './search-box';


const styles = (theme) => ({
container: {
flex: 1,
Expand All @@ -45,7 +44,6 @@ const styles = (theme) => ({
},
});


class LanguageList extends React.Component {
constructor(props) {
super(props);
Expand Down
32 changes: 16 additions & 16 deletions src/components/pages/language-list/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ const langList = getLanguages()
return x.locale.localeCompare(y.locale);
});


const LanguageListList = ({
classes,
mode,
Expand All @@ -64,6 +63,12 @@ const LanguageListList = ({
const isSearch = search && search.length > 0;
const normalizedSearch = isSearch ? search.toLowerCase() : null;

const filteredLangList = langList.filter(({ id, locale }) => {
if (isSearch && locale.toLowerCase().indexOf(normalizedSearch) < 0) return false;
if (mode === 'outputLang' && id === 'auto') return false;
return true;
});

return (
<div className={classes.listContainer}>
{!isSearch && (
Expand All @@ -89,28 +94,23 @@ const LanguageListList = ({
dense
subheader={<ListSubheader disableSticky>{isSearch ? getLocale('searchResults') : getLocale('allLanguages')}</ListSubheader>}
>
{langList.length < 1 ? (
{filteredLangList.length < 1 ? (
<ListItem
button
disabled
>
<ListItemText primary={getLocale('noLanguageFound')} />
</ListItem>
)
: langList.map(({ id, locale }) => {
if (isSearch && locale.toLowerCase().indexOf(normalizedSearch) < 0) return null;
if (mode === 'outputLang' && id === 'auto') return null;

return (
<ListItem
button
key={`lang_${id}`}
onClick={() => onLanguageClick(id)}
>
<ListItemText primary={locale} />
</ListItem>
);
})}
: filteredLangList.map(({ id, locale }) => (
<ListItem
button
key={`lang_${id}`}
onClick={() => onLanguageClick(id)}
>
<ListItemText primary={locale} />
</ListItem>
))}
</List>
</div>
);
Expand Down
1 change: 0 additions & 1 deletion src/components/pages/language-list/search-box.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import Paper from '@material-ui/core/Paper';
import Typography from '@material-ui/core/Typography';
import Tooltip from '@material-ui/core/Tooltip';


import connectComponent from '../../../helpers/connect-component';
import getLocale from '../../../helpers/get-locale';

Expand Down
1 change: 0 additions & 1 deletion src/components/pages/phrasebook/search-box.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import Tooltip from '@material-ui/core/Tooltip';
import connectComponent from '../../../helpers/connect-component';
import getLocale from '../../../helpers/get-locale';


import { loadPhrasebook, updateQuery } from '../../../state/pages/phrasebook/actions';

const styles = (theme) => ({
Expand Down
3 changes: 0 additions & 3 deletions src/components/pages/preferences/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ const Preferences = (props) => {
} = props;

const displayLanguages = getDisplayLanguages();
console.log(displayLanguages);

return (
<div className={classes.container}>
Expand Down Expand Up @@ -277,7 +276,6 @@ const Preferences = (props) => {
</List>
</Paper>


<Typography variant="body2" className={classes.paperTitle}>
{getLocale('advanced')}
</Typography>
Expand Down Expand Up @@ -375,7 +373,6 @@ const Preferences = (props) => {
</List>
</Paper>


<Typography variant="body2" className={classes.paperTitle} />
<Paper elevation={0} className={classes.paper}>
<List dense disablePadding>
Expand Down
1 change: 0 additions & 1 deletion src/helpers/open-file-to-blob-async.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

/* global Blob */

const getFileType = (ext) => {
Expand Down
1 change: 0 additions & 1 deletion src/senders/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

const { ipcRenderer } = window.require('electron');

export const requestOpenInBrowser = (url) => ipcRenderer.send('request-open-in-browser', url);
Expand Down
1 change: 0 additions & 1 deletion src/state/pages/home/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { isInputLanguage, isOutputLanguage } from '../../../helpers/language-uti
import { openAlert } from '../../root/alert/actions';
import { addHistoryItem } from './history/actions';


import { requestSetPreference } from '../../../senders';

export const toggleFullscreenInputBox = () => ({
Expand Down
1 change: 0 additions & 1 deletion src/state/pages/language-list/reducers.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ const search = (state = '', action) => {
}
};


const mode = (state = 'inputLang', action) => {
switch (action.type) {
case UPDATE_LANGUAGE_LIST_MODE: return action.mode;
Expand Down
1 change: 0 additions & 1 deletion src/state/pages/ocr/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ export const loadImage = () => (dispatch, getState) => {
},
});


dispatch(changeRoute(ROUTE_OCR));
});
})
Expand Down
1 change: 0 additions & 1 deletion src/state/root/dialog-about/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {
DIALOG_ABOUT_OPEN,
} from '../../../constants/actions';


export const close = () => ({
type: DIALOG_ABOUT_CLOSE,
});
Expand Down
1 change: 0 additions & 1 deletion src/state/root/dialog-license-registration/actions.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import {
DIALOG_LICENSE_REGISTRATION_CLOSE,
DIALOG_LICENSE_REGISTRATION_FORM_UPDATE,
Expand Down
1 change: 0 additions & 1 deletion src/state/root/preferences/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ export const toggleSetting = (name) => ((dispatch, getState) => {
requestSetPreference(name, value);
});


const runAfterLanguageChange = (language) => ((dispatch, getState) => {
const { preferences } = getState();
const { recentLanguages } = preferences;
Expand Down
Loading