mirror of
https://github.com/Frooodle/Stirling-PDF.git
synced 2026-03-04 02:20:19 +01:00
Various fixes for desktop (#4976)
# Description of Changes - ~Force classic logo~ - Refer to email instead of username in SaaS sign in flow - Allow drag-and-drop files into desktop app - Convert terminology & icons from upload/download to open/save in desktop version
This commit is contained in:
@@ -25,7 +25,9 @@ export const LoginForm: React.FC<LoginFormProps> = ({ serverUrl, isSaaS = false,
|
||||
|
||||
// Validation
|
||||
if (!username.trim()) {
|
||||
setValidationError(t('setup.login.error.emptyUsername', 'Please enter your username'));
|
||||
setValidationError(isSaaS
|
||||
? t('setup.login.error.emptyEmail', 'Please enter your email')
|
||||
: t('setup.login.error.emptyUsername', 'Please enter your username'));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -132,8 +134,12 @@ export const LoginForm: React.FC<LoginFormProps> = ({ serverUrl, isSaaS = false,
|
||||
)}
|
||||
|
||||
<TextInput
|
||||
label={t('setup.login.username.label', 'Username')}
|
||||
placeholder={t('setup.login.username.placeholder', 'Enter your username')}
|
||||
label={isSaaS
|
||||
? t('setup.login.email.label', 'Email')
|
||||
: t('setup.login.username.label', 'Username')}
|
||||
placeholder={isSaaS
|
||||
? t('setup.login.email.placeholder', 'Enter your email')
|
||||
: t('setup.login.username.placeholder', 'Enter your username')}
|
||||
value={username}
|
||||
onChange={(e) => {
|
||||
setUsername(e.target.value);
|
||||
|
||||
15
frontend/src/desktop/hooks/useFileActionIcons.ts
Normal file
15
frontend/src/desktop/hooks/useFileActionIcons.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import FolderOpenOutlinedIcon from '@mui/icons-material/FolderOpenOutlined';
|
||||
import SaveOutlinedIcon from '@mui/icons-material/SaveOutlined';
|
||||
|
||||
/**
|
||||
* File action icons for desktop builds
|
||||
* Overrides core implementation with desktop-appropriate icons
|
||||
*/
|
||||
export function useFileActionIcons() {
|
||||
return {
|
||||
upload: FolderOpenOutlinedIcon,
|
||||
download: SaveOutlinedIcon,
|
||||
uploadIconName: 'folder-rounded' as const,
|
||||
downloadIconName: 'save-rounded' as const,
|
||||
};
|
||||
}
|
||||
22
frontend/src/desktop/hooks/useFileActionTerminology.ts
Normal file
22
frontend/src/desktop/hooks/useFileActionTerminology.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
/**
|
||||
* File action terminology for desktop builds
|
||||
* Overrides core implementation with desktop-appropriate terminology
|
||||
*/
|
||||
export function useFileActionTerminology() {
|
||||
const { t } = useTranslation();
|
||||
|
||||
return {
|
||||
uploadFiles: t('fileUpload.openFiles', 'Open Files'),
|
||||
uploadFile: t('fileUpload.openFile', 'Open File'),
|
||||
upload: t('fileUpload.open', 'Open'),
|
||||
dropFilesHere: t('fileUpload.dropFilesHereOpen', 'Drop files here or click the open button'),
|
||||
uploadFromComputer: t('landing.openFromComputer', 'Open from computer'),
|
||||
download: t('save', 'Save'),
|
||||
downloadAll: t('rightRail.saveAll', 'Save All'),
|
||||
downloadSelected: t('fileManager.saveSelected', 'Save Selected'),
|
||||
downloadUnavailable: t('saveUnavailable', 'Save unavailable for this item'),
|
||||
noFilesInStorage: t('fileUpload.noFilesInStorageOpen', 'No files available in storage. Open some files first.'),
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user