Skip to content

Commit

Permalink
Fixed bugs and suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
AceHunterr committed Jan 18, 2025
1 parent 3944ced commit 975c0eb
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 12 deletions.
2 changes: 1 addition & 1 deletion public/locales/fr/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -812,7 +812,7 @@
"title": "Paramètres",
"general": "Général",
"actionItemCategories": "Catégories d'éléments d'action",
"updateOrganization": "Mettre à jour l'organisation",
"updateOrganization": "Modifier l'organisation",
"seeRequest": "Voir la demande",
"noData": "Aucune donnée",
"otherSettings": "Autres paramètres",
Expand Down
2 changes: 1 addition & 1 deletion public/locales/hi/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -812,7 +812,7 @@
"title": "सेटिंग्स",
"general": "सामान्य",
"actionItemCategories": "कार्य आइटम श्रेणियाँ",
"updateOrganization": "संगठन अपडेट करें",
"updateOrganization": "संगठन संपादित करें",
"seeRequest": "अनुरोध देखें",
"noData": "कोई डेटा नहीं",
"otherSettings": "अन्य सेटिंग्स",
Expand Down
2 changes: 1 addition & 1 deletion public/locales/sp/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,7 @@
"title": "Configuración",
"general": "General",
"actionItemCategories": "Categorías de elementos de acción",
"updateOrganization": "Actualizar organización",
"updateOrganization": "Editar organización",
"seeRequest": "Ver solicitud",
"noData": "Sin datos",
"otherSettings": "Otras configuraciones",
Expand Down
2 changes: 1 addition & 1 deletion public/locales/zh/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -812,7 +812,7 @@
"title": "设置",
"general": "一般的",
"actionItemCategories": "行动项目类别",
"updateOrganization": "更新组织",
"updateOrganization": "编辑组织",
"seeRequest": "查看请求",
"noData": "没有数据",
"otherSettings": "其他设置",
Expand Down
14 changes: 10 additions & 4 deletions src/components/OrgSettings/General/OrgUpdate/ImagePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { FaCamera } from 'react-icons/fa';
interface InterfaceImagePickerProps {
defaultImage?: string; // The default image to display in the preview.
onImageSelect: (base64Image: string) => void; // Callback for when an image is selected.
defaultPlaceholderImage: string;
}

/**
Expand All @@ -29,11 +30,16 @@ const ImagePicker: React.FC<InterfaceImagePickerProps> = ({
const handleImageChange = async (

Check warning on line 30 in src/components/OrgSettings/General/OrgUpdate/ImagePicker.tsx

View check run for this annotation

Codecov / codecov/patch

src/components/OrgSettings/General/OrgUpdate/ImagePicker.tsx#L30

Added line #L30 was not covered by tests
e: React.ChangeEvent<HTMLInputElement>,
): Promise<void> => {
const file = e.target.files && e.target.files[0];
const file = e.target.files?.[0];

Check warning on line 33 in src/components/OrgSettings/General/OrgUpdate/ImagePicker.tsx

View check run for this annotation

Codecov / codecov/patch

src/components/OrgSettings/General/OrgUpdate/ImagePicker.tsx#L33

Added line #L33 was not covered by tests
if (file) {
const base64Image = await convertToBase64(file);
setPreviewImage(base64Image);
onImageSelect(base64Image);
try {

Check warning on line 35 in src/components/OrgSettings/General/OrgUpdate/ImagePicker.tsx

View check run for this annotation

Codecov / codecov/patch

src/components/OrgSettings/General/OrgUpdate/ImagePicker.tsx#L35

Added line #L35 was not covered by tests
// setIsLoading(true);
const base64Image = await convertToBase64(file);
setPreviewImage(base64Image);
onImageSelect(base64Image);

Check warning on line 39 in src/components/OrgSettings/General/OrgUpdate/ImagePicker.tsx

View check run for this annotation

Codecov / codecov/patch

src/components/OrgSettings/General/OrgUpdate/ImagePicker.tsx#L37-L39

Added lines #L37 - L39 were not covered by tests
} catch (error) {
console.error('Failed to convert image:', error);

Check warning on line 41 in src/components/OrgSettings/General/OrgUpdate/ImagePicker.tsx

View check run for this annotation

Codecov / codecov/patch

src/components/OrgSettings/General/OrgUpdate/ImagePicker.tsx#L41

Added line #L41 was not covered by tests
}
}
};

Expand Down
5 changes: 1 addition & 4 deletions src/components/ProfileDropdown/ProfileDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ const profileDropdown = (): JSX.Element => {
try {
await revokeRefreshToken();
} catch (error) {
/*istanbul ignore next*/
console.error('Error revoking refresh token:', error);
}
localStorage.clear();
Expand All @@ -54,16 +53,14 @@ const profileDropdown = (): JSX.Element => {
const fullName = `${firstName} ${lastName}`;
const displayedName =
fullName.length > MAX_NAME_LENGTH
? /*istanbul ignore next*/
fullName.substring(0, MAX_NAME_LENGTH - 3) + '...'
? fullName.substring(0, MAX_NAME_LENGTH - 3) + '...'
: fullName;

return (
<Dropdown as={ButtonGroup} variant="none">
<div className={styles.profileContainer}>
<div className={styles.imageContainer}>
{userImage && userImage !== 'null' ? (
/*istanbul ignore next*/
<img
src={userImage}
alt={`profile picture`}
Expand Down

0 comments on commit 975c0eb

Please sign in to comment.