Skip to content

Commit

Permalink
feat: show user info about file formats (#522)
Browse files Browse the repository at this point in the history
Hoping this will reduce confusion.
  • Loading branch information
aalemayhu authored May 4, 2024
1 parent f2b796a commit 66f594c
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 5 deletions.
18 changes: 18 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.10",
"@reduxjs/toolkit": "^1.9.5",
"@svgr/webpack": "^8.1.0",
"@types/react-query": "^1.2.9",
"babel-jest": "^27.4.2",
"babel-loader": "^8.2.3",
"babel-plugin-named-asset-import": "^0.3.8",
Expand Down
5 changes: 3 additions & 2 deletions src/components/modals/SettingsModal/SettingsModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { get2ankiApi } from '../../../lib/backend/get2ankiApi';
import { getSettingsCardOptions } from '../../../lib/backend/getSettingsCardOptions';

import { getLocalStorageBooleanValue } from '../../../lib/data_layer/getLocalStorageBooleanValue';
import CardOption from '../../../lib/data_layer/model/CardOption';

interface Props {
pageTitle?: string;
Expand Down Expand Up @@ -130,7 +131,7 @@ function SettingsModal({
}
const payload: { [key: string]: string } = {};
if (options) {
options.forEach((option) => {
options.forEach((option: CardOption) => {
payload[option.key] = option.value.toString(); // use string for backwards compat
});
} else {
Expand Down Expand Up @@ -253,7 +254,7 @@ function SettingsModal({
saveValueInLocalStorage('toggle-mode', t, pageId);
}}
/>
{options && options.map((o) => <LocalCheckbox
{options && options.map((o: CardOption) => <LocalCheckbox
key={o.key}
defaultValue={
getLocalStorageBooleanValue(
Expand Down
6 changes: 4 additions & 2 deletions src/lib/text/app.document.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,7 @@
"navigation.logout": "🔒 log out",
"navigation.deleteAccount": "🗑️ Delete account",
"downloads.unfinished.jobs": "It might take a while for your download to be ready.",
"downloads.empty": "You have no downloads!"
}
"downloads.empty": "You have no downloads!",
"upload.page.title": "Upload your notes",
"upload.page.subtitle": "For now only HTML and ZIP files are fully supported."
}
4 changes: 3 additions & 1 deletion src/pages/UploadPage/UploadPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
} from './styled';
import { Main, PageContainer } from '../../components/styled';
import { ErrorHandlerType } from '../../components/errors/helpers/getErrorMessage';
import { getVisibleText } from '../../lib/text/getVisibleText';

interface Props {
setErrorMessage: ErrorHandlerType;
Expand All @@ -35,7 +36,7 @@ export function UploadPage({ setErrorMessage }: Props) {
<Main>
{isDevelopment ? <WarningMessage /> : null}
<FlexColumn>
<ImportTitle>Import</ImportTitle>
<ImportTitle>{getVisibleText('upload.page.title')}</ImportTitle>
<SettingsLink onClick={() => setShowSettings(true)}>
<Link className="link" to="?view=template">
<SettingsIcon />
Expand All @@ -45,6 +46,7 @@ export function UploadPage({ setErrorMessage }: Props) {
</FlexColumn>
<div className="container">
<UploadForm setErrorMessage={setErrorMessage} />
<p>{getVisibleText('upload.page.subtitle')}</p>
<InfoMessage>
All files uploaded here are automatically deleted after 21
minutes.
Expand Down

0 comments on commit 66f594c

Please sign in to comment.