Public Access
refactor(limits): server limits in one file, own texts for unknown errors
This commit is contained in:
1 parent
f605917874
commit
24a98062ee
18 files changed
+84
-49
No files matched your search
@@ -11,12 +11,11 @@ import {Select, SelectContent, SelectItem, SelectTrigger, SelectValue} from '@/c
|
||||
import {Textarea} from '@/components/ui/textarea';
|
||||
import {cn} from '@/lib/utils';
|
||||
import {STATUS_META} from './GameStatusBadge.jsx';
|
||||
import {GAME_PRIORITIES, GAME_STATUSES, NO_PRIORITY, saveBacklogEntry, toBacklogRequest} from '../utils/backlog.js';
|
||||
import {NO_PRIORITY, saveBacklogEntry, toBacklogRequest} from '../utils/backlog.js';
|
||||
import {GAME_PRIORITIES, GAME_STATUSES, MAX_NOTES_LENGTH} from '../utils/limits.js';
|
||||
import useSessionExpired from '../hooks/useSessionExpired.js';
|
||||
import {hasSession} from '../utils/auth.js';
|
||||
|
||||
const NOTES_MAX = 2000;
|
||||
|
||||
const toForm = (entry) => ({
|
||||
status: entry.status ?? 'BACKLOG',
|
||||
rating: entry.rating ?? 0,
|
||||
@@ -133,12 +132,12 @@ export default function BacklogCard({game, onSaved}) {
|
||||
<div className="space-y-2">
|
||||
<div className="flex items-baseline justify-between">
|
||||
<Label htmlFor="backlog-notes">{t('BACKLOG.NOTES_LABEL')}</Label>
|
||||
<span className="text-xs text-muted-foreground tabular-nums">{form.notes.length} / {NOTES_MAX}</span>
|
||||
<span className="text-xs text-muted-foreground tabular-nums">{form.notes.length} / {MAX_NOTES_LENGTH}</span>
|
||||
</div>
|
||||
<Textarea
|
||||
id="backlog-notes"
|
||||
rows={3}
|
||||
maxLength={NOTES_MAX}
|
||||
maxLength={MAX_NOTES_LENGTH}
|
||||
placeholder={t('BACKLOG.NOTES_PLACEHOLDER')}
|
||||
value={form.notes}
|
||||
onChange={(e) => set('notes')(e.target.value)}
|
||||
|
||||
Reference in new issue
Block a user