Polish UI, harden company creation, and add error pages
This commit is contained in:
@@ -22,6 +22,7 @@ import { Company, JobApplication } from "../types";
|
||||
import { useToast } from "../toast";
|
||||
import { useCompanies } from "../hooks/useCompanies";
|
||||
import TagsInput from "./TagsInput";
|
||||
import { useI18n } from "../i18n/I18nProvider";
|
||||
|
||||
interface Props {
|
||||
open: boolean;
|
||||
@@ -53,6 +54,7 @@ function parseTags(raw: any): string[] {
|
||||
|
||||
export default function EditJobDialog({ open, jobId, onClose, onSaved }: Props) {
|
||||
const { toast } = useToast();
|
||||
const { t } = useI18n();
|
||||
const [loading, setLoading] = useState(false);
|
||||
const { companies } = useCompanies();
|
||||
|
||||
@@ -144,7 +146,7 @@ export default function EditJobDialog({ open, jobId, onClose, onSaved }: Props)
|
||||
dateApplied: dateApplied || null,
|
||||
jobUrl: jobUrl.trim() || null,
|
||||
});
|
||||
toast("Saved.", "success");
|
||||
toast(t("save"), "success");
|
||||
onSaved();
|
||||
onClose();
|
||||
} catch {
|
||||
@@ -156,7 +158,7 @@ export default function EditJobDialog({ open, jobId, onClose, onSaved }: Props)
|
||||
|
||||
return (
|
||||
<Dialog open={open} onClose={onClose} fullWidth maxWidth="md">
|
||||
<DialogTitle>Edit job</DialogTitle>
|
||||
<DialogTitle>{t("editJobTitle")}</DialogTitle>
|
||||
<DialogContent>
|
||||
<Box sx={{ mt: 1, mb: 2, p: 1.5, borderRadius: 3, border: "1px solid", borderColor: "divider", backgroundColor: "background.paper" }}>
|
||||
<Typography variant="body2" sx={{ color: "text.secondary" }}>
|
||||
@@ -221,8 +223,8 @@ export default function EditJobDialog({ open, jobId, onClose, onSaved }: Props)
|
||||
</Box>
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
<Button onClick={onClose}>Cancel</Button>
|
||||
<Button variant="contained" onClick={save} disabled={!canSave}>Save</Button>
|
||||
<Button onClick={onClose}>{t("cancel")}</Button>
|
||||
<Button variant="contained" onClick={save} disabled={!canSave}>{t("save")}</Button>
|
||||
</DialogActions>
|
||||
</Dialog>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user