Skip to content

Commit

Permalink
Merge pull request #123 from HoodBusinesses/SYG-1111
Browse files Browse the repository at this point in the history
Syg 1111
  • Loading branch information
SaidM96 authored Dec 9, 2024
2 parents b6dd929 + 4e36531 commit e645a44
Show file tree
Hide file tree
Showing 9 changed files with 68 additions and 31 deletions.
11 changes: 9 additions & 2 deletions apps/desk/src/renderer/public/locales/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,13 @@
"import": "استيراد",
"sortBy": "ترتيب حسب",
"filter": "تصفية",
"next": "التالي",
"drag": "اسحب ملفك (ملفاتك) لبدء التحميل",
"browseFiles": "تصفح الملفات",
"or" : "أو",
"onlyXls" : "يسمح فقط بملفات .xls"
"or": "أو",
"onlyXls": "يسمح فقط بملفات .xls",
"discard": "تجاهل",
"keepEditing": "استمر في التحرير"
},
"participantsTable": {
"id": "المعرف",
Expand Down Expand Up @@ -327,6 +330,10 @@
"messageLogo": "هل تريد استيراد الشعار؟",
"titleDocument": "استيراد المستند",
"messageDocument": "هل تريد استيراد المستند؟"
},
"unsavedChanges": {
"title" : "تجاهل التغييرات غير المحفوظة؟",
"message": "سيتم فقدان أي تغييرات غير محفوظة. هل أنت متأكد أنك تريد الإلغاء وتجاهل التعديلات الخاصة بك؟"
}
}
}
9 changes: 8 additions & 1 deletion apps/desk/src/renderer/public/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,13 @@
"import": "Import",
"sortBy": "Sort By",
"filter": "Filter",
"next": "Next",
"drag": "Drag your file(s) to start uploading",
"browseFiles": "Browse Files",
"or": "Or",
"onlyXls" : "Only .xls files are allowed"
"onlyXls": "Only .xls files are allowed",
"discard": "Discard",
"keepEditing": "Keep Editing"
},
"participantsTable": {
"id": "ID",
Expand Down Expand Up @@ -327,6 +330,10 @@
"messageLogo": "Are you sure you want to import this data?",
"titleDocument": "Import Document",
"messageDocument": "Are you sure you want to import this document?"
},
"unsavedChanges": {
"title": "Discard Unsaved Changes?",
"message": "Any unsaved changes will be lost. Are you sure you want to cancel and discard your edits?"
}
}
}
9 changes: 8 additions & 1 deletion apps/desk/src/renderer/public/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,13 @@
"import": "Importer",
"sortBy": "Trier par",
"filter": "Filtrer",
"next": "Suivant",
"drag": "Faites glisser votre (vos) fichier(s) pour commencer le téléchargement",
"browseFiles": "Parcourir les fichiers",
"or": "Ou",
"onlyXls": "Seuls les fichiers .xls sont autorisés"
"onlyXls": "Seuls les fichiers .xls sont autorisés",
"discard": "Annuler",
"keepEditing": "Continuer l'édition"
},
"participantsTable": {
"id": "ID",
Expand Down Expand Up @@ -327,6 +330,10 @@
"messageLogo": "Voulez-vous importer le Logo ?",
"titleDocument": "Importer le document",
"messageDocument": "Voulez-vous importer le document ?"
},
"unsavedChanges": {
"title": "Annuler les modifications non enregistrées ?",
"message": "Toutes les modifications non enregistrées seront perdues. Êtes-vous sûr de vouloir annuler et supprimer vos modifications ?"
}
}
}
4 changes: 4 additions & 0 deletions apps/desk/src/renderer/src/assets/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,8 @@ body {

.font-poppins {
font-family: "Poppins", sans-serif;
}

.font-roboto {
font-family: "Roboto", sans-serif;
}
10 changes: 6 additions & 4 deletions apps/desk/src/renderer/src/components/DeleteModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ interface DeleteModalProps {
}

const DeleteModal: FC<DeleteModalProps> = ({ onDelete, DeleteNumber }: DeleteModalProps) => {
const { t } = useTranslate();
const { t , isRtl } = useTranslate();

return (
<Dialog>
Expand All @@ -43,15 +43,17 @@ const DeleteModal: FC<DeleteModalProps> = ({ onDelete, DeleteNumber }: DeleteMod
{t('modals.delete.message')}
</DialogDescription>
</DialogHeader>
<div className="flex justify-end ">
<div className={cn("flex",
isRtl ? "justify-start" : "justify-end"
)}>
<DialogClose className="custom-button text-sm text-gray-500 hover:bg-gray-200 border border-gray-500 mr-2">
Cancel
{t('buttons.cancel')}
</DialogClose>
<DialogClose
onClick={onDelete}
className="custom-button text-sm bg-[#FF0000] hover:bg-red-800"
>
{'Delete'}
{t('buttons.delete')}
</DialogClose>
</div>
</DialogContent>
Expand Down
22 changes: 12 additions & 10 deletions apps/desk/src/renderer/src/components/ExportModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,40 +6,42 @@ import { useTranslate } from '@renderer/hooks/useTranslate';
import Upload from '@renderer/assets/images/Export.png';

const ExportModal = (): JSX.Element => {
const { t } = useTranslate();
const { t ,isRtl } = useTranslate();

const handleExport = () => {
console.log('Export');
};

return (
<Dialog>
<DialogTrigger
className={cn(
buttonVariants(),
'flex items-center gap-2 custom-button bg-blue-600 text-white px-6 py-2 rounded-lg'
'flex flex-1 font-normal font-roboto items-center gap-4 custom-button bg-blue-600 text-white px-6 py-2 rounded-lg'
)}
>
{/* <FiUpload className="h-5 w-5" /> */}
<img src={Upload} alt="Upload" width={20} height={20} />
<img src={Upload} alt="Upload" width={22} height={22} />
{t('buttons.export')}
</DialogTrigger>

<DialogContent className="p-4 bg-white rounded-md shadow-md">
<DialogHeader className=''>

<DialogContent className={"p-4 bg-white rounded-md shadow-md"}>

<DialogHeader className={cn('flex red', isRtl ? "justify-start text-right" : "justify-end text-left")}>
<DialogTitle className='text-xl'>{t('modals.export.title')}</DialogTitle>
<DialogDescription className='text-gray-500'>{t('modals.export.message')}</DialogDescription>
</DialogHeader>
<div className="flex justify-end ">
<div className={cn("flex",
isRtl ? "justify-start" : "justify-end"
)}>
<DialogClose className="custom-button text-gray-500 hover:bg-gray-200 border border-gray-500 text-sm mr-2">
Cancel
{t('buttons.cancel')}
</DialogClose>
<DialogClose
onClick={handleExport}
className="custom-button text-sm bg-blue-600 hover:bg-blue-800"
>
Export
{t('buttons.export')}
</DialogClose>
</div>
</DialogContent>
Expand Down
14 changes: 8 additions & 6 deletions apps/desk/src/renderer/src/components/ImportModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Download from '@renderer/assets/images/Import.png'
import FileUploader from './ui/fileUploader';

const ImportModal = (): JSX.Element => {
const { t } = useTranslate();
const { t , isRtl } = useTranslate();

const handleEImport = (): void => {
console.log('Import');
Expand All @@ -20,11 +20,11 @@ const ImportModal = (): JSX.Element => {
<DialogTrigger
className={cn(
buttonVariants(),
'flex items-center custom-button gap-2 bg-blue-50 text-blue-600 px-6 py-2 rounded-lg'
'flex flex-1 custom-button gap-4 font-normal font-roboto bg-blue-50 text-blue-600 px-6 py-2 rounded-lg'
)}
>
{/* <FiDownload className="h-5 w-5" /> */}
<img src={Download} alt='Upload' width={20} height={20} />
<img src={Download} alt='Upload' width={22} height={22} />
{t('buttons.import')}
</DialogTrigger>

Expand All @@ -41,15 +41,17 @@ const ImportModal = (): JSX.Element => {
<p className='text-gray-500 px-4'>
{t('buttons.onlyXls')}
</p>
<div className="flex justify-end">
<div className={cn("flex",
isRtl ? "justify-start" : "justify-end"
)}>
<DialogClose className="custom-button text-gray-500 hover:bg-gray-200 border border-gray-500 mr-2">
Cancel
{t('buttons.cancel')}
</DialogClose>
<DialogClose
onClick={handleEImport}
className="custom-button bg-blue-600 hover:bg-blue-800"
>
Next
{t('buttons.next')}
</DialogClose>
</div>
</DialogContent>
Expand Down
5 changes: 3 additions & 2 deletions apps/desk/src/renderer/src/components/ListingHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { Button } from './ui/button'
import { FiPlus } from 'react-icons/fi'
import SearchTableInput from './costum-data/search-table-Input'
import { ChangeEventHandler } from 'react'
import Paragraph from './ui/Paragraph'

interface ListingHeaderProps {
headTitle: string;
Expand Down Expand Up @@ -33,9 +34,9 @@ const ListingHeader = ({
{!(headTitle === 'organization.organizations') && (
<Button
onClick={goAdd}
className="flex items-center custom-button gap-2 bg-blue-600 text-blue-50 px-6 py-2 rounded-lg"
className="flex flex-1 custom-button gap-4 font-normal font-roboto bg-blue-600 text-blue-50 px-6 py-2 rounded-lg"
>
<FiPlus className="h-5 w-5" />
<FiPlus className="h-[22px] w-[22px]" />
{t('buttons.add')}
</Button>
)}
Expand Down
15 changes: 10 additions & 5 deletions apps/desk/src/renderer/src/components/unsaved-change-edit.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { useTranslate } from '@renderer/hooks/useTranslate';
import {
Dialog,
DialogClose,
Expand All @@ -6,6 +7,7 @@ import {
DialogTrigger,
} from './ui/dialog';
import { DialogDescription } from '@radix-ui/react-dialog';
import { cn } from './ui/lib/utils';

export default function UnsavedChangeEdit({
open,
Expand All @@ -16,28 +18,31 @@ export default function UnsavedChangeEdit({
ConfermFn: () => void;
KeepEditFn: () => void;
}) {
const { t ,isRtl } = useTranslate();
return (
<Dialog open={open}>
<DialogTrigger asChild></DialogTrigger>

<DialogContent className="p-4 bg-white items-center justify-center rounded-md shadow-md">
<DialogTitle className="text-xl text-gray-800 font-bold">
Discard Unsaved Changes?
{t('modals.unsavedChanges.title')}
</DialogTitle>

<DialogDescription className="text-gray-400">
Lorem ipsum dolor sit amet consectetur adipisicing elit. Impedit natus
{t('modals.unsavedChanges.message')}
</DialogDescription>

<div className="flex justify-end">
<div className={cn("flex",
isRtl ? "justify-start" : "justify-end"
)}>
<DialogClose
onClick={KeepEditFn}
className="custom-button text-gray-500 hover:bg-gray-200 border border-gray-500 mr-2"
>
Keep Editing
{t('buttons.keepEditing')}
</DialogClose>
<DialogClose onClick={ConfermFn} className="custom-button bg-red-500">
Discard
{t('buttons.discard')}
</DialogClose>
</div>
</DialogContent>
Expand Down

0 comments on commit e645a44

Please sign in to comment.