Skip to content

Commit

Permalink
reverse useAuth to its initial version
Browse files Browse the repository at this point in the history
  • Loading branch information
ocsiddisco committed May 15, 2024
1 parent 2c29951 commit 15eeccc
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/api/useAuth.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useEffect, useState } from 'react';
import { auth } from './config.js';
import { GoogleAuthProvider, signInWithPopup } from 'firebase/auth';
import { GoogleAuthProvider, signInWithRedirect } from 'firebase/auth';
import { addUserToDatabase } from './firebase.js';

/**
Expand All @@ -10,7 +10,7 @@ import { addUserToDatabase } from './firebase.js';
*/
export const SignIn = () => {
try {
signInWithPopup(auth, new GoogleAuthProvider());
signInWithRedirect(auth, new GoogleAuthProvider());
} catch (error) {
console.log('error', error);
}
Expand Down
6 changes: 4 additions & 2 deletions src/components/DeleteItem.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,14 @@ const DeleteItem = ({ itemName, listPath, itemId }) => {
</Trans>
);

const deleteItemName = t('DeleteItemName', { itemName });

return (
<>
<button
onClick={openConfirm}
aria-label={`Delete ${itemName}`}
title={`Delete ${itemName}`}
aria-label={deleteItemName}
title={deleteItemName}
className="px-2 text-darkPurple rounded-md transition ease-in-out hover:text-alertRed focus:text-alertRed"
>
<i className="fa-solid fa-trash"></i>
Expand Down
6 changes: 1 addition & 5 deletions src/components/DeleteList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,7 @@ const DeleteList = ({ user, email, listPath, listName, setListPath }) => {

const listNameUppercase = listName.toUpperCase();

const buttonTranslated = (
<Trans i18nKey="ButtonDeleteList" listNameUppercase={listNameUppercase}>
Delete {{ listNameUppercase }}
</Trans>
);
const buttonTranslated = t('ButtonDeleteList', { listNameUppercase });

const titleTranslated = (
<Trans i18nKey="ModalDeleteListTitle" listNameUppercase={listNameUppercase}>
Expand Down
2 changes: 2 additions & 0 deletions src/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ const resources = {
ModalDeleteItemTitle: 'Delete {{itemNameUppercase}}',
ModalDeleteItemText:
'Do you really want to delete {{itemNameUppercase}} from this list?',
DeleteItemName: 'Delete {{itemName}}',

// confirm component
Confirm: 'Confirm',
Expand Down Expand Up @@ -166,6 +167,7 @@ const resources = {
ModalDeleteItemTitle: 'Supprimer {{itemNameUppercase}}',
ModalDeleteItemText:
'Souhaitez-vous définitivement supprimer {{itemNameUppercase}} de votre liste ?',
DeleteItemName: 'Supprimer {{itemName}}',

// confirm component
Confirm: 'Confirmer',
Expand Down

0 comments on commit 15eeccc

Please sign in to comment.