Skip to content

Commit

Permalink
Fix trim_trailing_whitespace violations
Browse files Browse the repository at this point in the history
  • Loading branch information
emlun committed Feb 21, 2024
1 parent 2240ebd commit cff3556
Show file tree
Hide file tree
Showing 22 changed files with 65 additions and 68 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Our Web Wallet provides a range of features tailored to enhance the credential m
```bash
git clone https://github.com/your-username/wallet-frontend.git
```

- **Option 2: Using SSH**
```bash
git clone [email protected]:your-username/wallet-frontend.git
Expand All @@ -63,12 +63,12 @@ The project uses environment variables to manage different configurations. A `.e
- REACT_APP_WS_URL: The URL of the websocket service.
- REACT_APP_WALLET_BACKEND_URL: The URL of your backend service.
- REACT_APP_LOGIN_WITH_PASSWORD: A Boolean value which show/hide the classic login/signup.
- REACT_APP_FIREBASE_API_KEY: Your API key for Firebase.
- REACT_APP_FIREBASE_API_KEY: Your API key for Firebase.
- REACT_APP_FIREBASE_AUTH_DOMAIN: Your Firebase authentication domain.
- REACT_APP_FIREBASE_PROJECT_ID: Your Firebase project ID.
- REACT_APP_FIREBASE_STORAGE_BUCKET: Your Firebase storage bucket.
- REACT_APP_FIREBASE_MESSAGING_SENDER_ID: Your Firebase Messaging Sender ID.
- REACT_APP_FIREBASE_APP_ID: Your Firebase App ID.
- REACT_APP_FIREBASE_APP_ID: Your Firebase App ID.
- REACT_APP_FIREBASE_MEASUREMENT_ID: Your Firebase Measurement ID.
- REACT_APP_DEV_CONSOLE_TYPES: Enable console logs (info, warn, error) separated by commas or leave empty for none.

Expand Down Expand Up @@ -101,7 +101,7 @@ The PRF (Pseudo Random Function) extension in WebAuthn enables the evaluation of
| Windows ||||| ||
| MacOS |||||||
| Android ||||| ||
| iOS |||||||
| iOS |||||||

### PRF Compatibility Scenarios

Expand All @@ -123,7 +123,7 @@ The PRF (Pseudo Random Function) extension in WebAuthn enables the evaluation of
| iOS | FIDO Security Key | NFC ||


***Note:** In this table, we use the term "FIDO Security Key" to refer to compatible security keys. It's important to understand that any security key should work with the hmac-secret extension, provided it supports this feature.
***Note:** In this table, we use the term "FIDO Security Key" to refer to compatible security keys. It's important to understand that any security key should work with the hmac-secret extension, provided it supports this feature.
For a detailed list of security key models that support hmac-secret, you can refer to the [FIDO MDS Explorer](https://opotonniee.github.io/fido-mds-explorer/), where hmac-secret support is listed under metadataStatement > authenticatorGetInfo > extensions.*
The wwWallet is committed to delivering a secure and adaptable authentication experience with an emphasis on PRF extension compatibility.
Expand Down Expand Up @@ -162,7 +162,7 @@ We welcome contributions from the community to help improve the wwWallet Fronten

1. **Create a New Branch:**
Create a new branch for your feature or bug fix
```bash
```bash
git checkout -b my-feature
```
Replace my-feature with a descriptive name.
Expand All @@ -172,14 +172,14 @@ We welcome contributions from the community to help improve the wwWallet Fronten

3. **Commit Changes:**
Commit your changes with a descriptive commit message:
```bash
```bash
git commit -m "Add new feature"
```
4. **Push Changes:**
Push your changes to your new branrch:
```bash
```bash
git push --set-upstream origin my-feature
```
```
5. **Create a Pull Request:**
Open a pull request on the original repository. Provide a detailed description of your changes and their purpose.

Expand Down
4 changes: 2 additions & 2 deletions src/components/ChistmasAnimation/Snowfalling.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ const Snowfalling = () => {
const checkSeason = () => {
const today = new Date();
const currentYear = today.getFullYear();

const start = new Date(currentYear, 11, 20);
const end = new Date(currentYear + 1, 0, 6);

return today >= start && today <= end;
};

Expand Down
2 changes: 1 addition & 1 deletion src/components/Credentials/CredentialJson.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const CredentialJson = ({ credential }) => {
</button>
</div>

<hr className="my-2 border-t border-gray-500 py-2" />
<hr className="my-2 border-t border-gray-500 py-2" />

{showJsonCredentials && credential ? (
<div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/HandlerNotification.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const HandlerNotification = ({ children }) => {
console.log('Failed to receive message:', err);
setMessageReceived(false); // Set isMessageReceived to false if there's an error
});


return () => {
if (!messageReceived) {
Expand Down
6 changes: 3 additions & 3 deletions src/components/Layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const Layout = ({ children, isPermissionGranted, isPermissionValue,setispermissi
setIsContentVisible(true);
}, 0);
}, []);

return (
<div className="flex min-h-screen">
<Sidebar isOpen={isOpen} toggle={toggleSidebar} />
Expand Down Expand Up @@ -108,13 +108,13 @@ const Layout = ({ children, isPermissionGranted, isPermissionValue,setispermissi
<span className="font-semibold">
allow permission for notifications
</span>{' '}
from your browser.
from your browser.
<a className="ml-2" onClick={requestNotificationPermission}>
<button
className="px-2 py-1 text-white bg-custom-blue hover:bg-custom-blue-hover font-medium rounded-lg text-sm px-4 py-2 text-center dark:bg-custom-blue-hover dark:hover:bg-custom-blue-hover"
onClick={requestNotificationPermission}
>
Allow
Allow
</button>
</a>
</p>
Expand Down
2 changes: 1 addition & 1 deletion src/components/PinInputPopup.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function PinInputPopup({ showPinPopup, setShowPinPopup }) {
inputRefs[index - 1].current.focus();
newPin[index - 1] = '';
} else if (value !== '' && index < 3) {
// Move focus to the next input and clean it
// Move focus to the next input and clean it
const nextInput = inputRefs[index + 1].current;
newPin[index + 1] = '';
setPin(newPin);
Expand Down
2 changes: 1 addition & 1 deletion src/components/Popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function Popup({ showPopup, setShowPopup, setSelectionMap, conformantCredentials
<div className="absolute inset-0 bg-black opacity-50"></div>
<div className="bg-white p-4 rounded-lg shadow-lg w-full max-h-[80vh] lg:w-[33.33%] sm:w-[66.67%] z-10 relative m-4 ">
<h2 className="text-lg font-bold mb-2 text-custom-blue">
<FaShare size={20} className="inline mr-1 mb-1" />
<FaShare size={20} className="inline mr-1 mb-1" />
{t('selectCredentialPopup.title')}
</h2>
<hr className="mb-2 border-t border-custom-blue/80" />
Expand Down
8 changes: 4 additions & 4 deletions src/components/PrivateRoute.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const PrivateRoute = ({ children }) => {
const [loading, setLoading] = useState(false);
const keystore = useLocalStorageKeystore();
const isLoggedIn = api.isLoggedIn() && keystore.isOpen();

const location = useLocation();
const navigate = useNavigate();

Expand Down Expand Up @@ -61,8 +61,8 @@ const PrivateRoute = ({ children }) => {
await api.post('/user/session/fcm_token/add', { fcm_token: fcmToken });
// Set a flag in sessionStorage to indicate that the token has been sent
sessionStorage.setItem('tokenSentInSession', 'true');
console.log('send FCM Token:', fcmToken);
console.log('send FCM Token:', fcmToken);

console.log('FCM Token:', fcmToken);
} catch (error) {
console.error('Error sending FCM token to the backend:', error);
Expand All @@ -72,7 +72,7 @@ const PrivateRoute = ({ children }) => {
}
}
}

sendFcmTokenToBackend();
}, [isPermissionGranted]);

Expand Down
4 changes: 2 additions & 2 deletions src/components/Sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ const Sidebar = ({ isOpen, toggle }) => {
<ul>
<div className='flex items-center space-x-2 mb-4 p-2 rounded-r-xl'>
<FaUserCircle size={30} title={displayName || username}/>
<span
<span
className="text-overflow-ellipsis overflow-hidden whitespace-nowrap md:max-w-[130px]"
title={displayName || username}
title={displayName || username}
>
{displayName || username}
</span>
Expand Down
2 changes: 1 addition & 1 deletion src/components/useCheckURL.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function useCheckURL(urlToCheck: string): {

const res = await api.post('/communication/handle', { url, camera_was_used: (wwwallet_camera_was_used != null && wwwallet_camera_was_used === 'true') });
const { redirect_to, conformantCredentialsMap, verifierDomainName, preauth, ask_for_pin } = res.data;

if (preauth && preauth == true) {
if (ask_for_pin) {
setShowPinPopup(true);
Expand Down
6 changes: 3 additions & 3 deletions src/firebase.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ const requestForToken = async () => {
console.log('ERROR:',err.message,err.code);
if (err.code === 'messaging/permission-blocked') {
console.error('Notification permission was blocked or click close.');
return null;
return null;
}else if (err.message === "Failed to execute 'subscribe' on 'PushManager': Subscription failed - no active Service Worker") {
console.error('Failed beacuse there is no token created yet, so we are going to re-register');

} else {
console.error('An error occurred while retrieving token:',err);
return null;
Expand Down Expand Up @@ -103,7 +103,7 @@ export const fetchToken = async () => {
}
} else {
console.log('Messaging is not initialized.');

}
return null; // Return null in case of failure
};
Expand Down
2 changes: 0 additions & 2 deletions src/functions/DateFormat.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,3 @@ export function formatDate(dateString) {
};
return new Date(dateString).toLocaleString(undefined, options);
};


2 changes: 1 addition & 1 deletion src/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ i18n
resources: {
en: { translation: enTranslation },
},
lng: 'en',
lng: 'en',
interpolation: {
escapeValue: false,
},
Expand Down
2 changes: 1 addition & 1 deletion src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
.custom-scrollbar {
scrollbar-width: thin;
scrollbar-color: #ccc #f0f0f0;
padding-right: 5px;
padding-right: 5px;
}

.custom-scrollbar::-webkit-scrollbar {
Expand Down
1 change: 0 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@ ConsoleBehavior();

const root = createRoot(document.getElementById('root'));
root.render(<App />);

18 changes: 9 additions & 9 deletions src/pages/AddCredentials/AddCredentials.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,19 +88,19 @@ const Issuers = () => {

const handleContinue = () => {
setLoading(true);

console.log('Continue with:', selectedIssuer);

if (selectedIssuer && selectedIssuer.did) {
const payload = {
legal_person_did: selectedIssuer.did,
};

api.post('/communication/handle', payload)
.then((response) => {
const { redirect_to } = response.data;
console.log(redirect_to);

// Redirect to the URL received from the backend
window.location.href = redirect_to;
})
Expand All @@ -109,7 +109,7 @@ const Issuers = () => {
console.error('Error sending request to backend:', error);
});
}

setLoading(false);
setShowPopup(false);
};
Expand Down Expand Up @@ -140,7 +140,7 @@ const Issuers = () => {
</div>
</button>
)}

</div>
<hr className="mb-2 border-t border-custom-blue/80" />
<p className="italic text-gray-700">{t('pageAddCredentials.description')}</p>
Expand Down Expand Up @@ -186,7 +186,7 @@ const Issuers = () => {
) : (
<>
<h2 className="text-lg font-bold mb-2 text-custom-blue">
<FaShare size={20} className="inline mr-1 mb-1" />
<FaShare size={20} className="inline mr-1 mb-1" />
{t('pageAddCredentials.popup.title')} {selectedIssuer?.friendlyName}
</h2>
<hr className="mb-2 border-t border-custom-blue/80" />
Expand All @@ -209,8 +209,8 @@ const Issuers = () => {
{/* QR Code Scanner Modal */}
{isQRScannerOpen && (
<div className="fixed inset-0 z-50 flex items-center justify-center bg-black bg-opacity-75">
<QRCodeScanner
onClose={closeQRScanner}
<QRCodeScanner
onClose={closeQRScanner}
/>
</div>
)}
Expand Down
8 changes: 4 additions & 4 deletions src/pages/History/History.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { BiLeftArrow, BiRightArrow } from 'react-icons/bi';
import { useTranslation } from 'react-i18next';

import Slider from 'react-slick';
import "slick-carousel/slick/slick.css";
import "slick-carousel/slick/slick.css";
import "slick-carousel/slick/slick-theme.css";

import { useApi } from '../../api';
Expand Down Expand Up @@ -106,9 +106,9 @@ const History = () => {

{isImageModalOpen && (
<div className="fixed inset-0 flex items-center justify-center z-50" >
<div className="absolute inset-0 bg-black opacity-50" onClick={() => setImageModalOpen(false)}></div>
<div className="absolute inset-0 bg-black opacity-50" onClick={() => setImageModalOpen(false)}></div>
<div className="bg-white p-4 rounded-lg shadow-lg w-[99%] lg:w-[33.33%] sm:w-[33.33%] max-h-[100vh] z-10 relative mx-6 mx-4">

{/* Popup content */}
<div class="flex items-start justify-between border-b rounded-t dark:border-gray-600">
<h2 className="right text-lg font-bold p-2 mb-2 text-custom-blue">
Expand Down Expand Up @@ -147,7 +147,7 @@ const History = () => {
</Slider>
</div>
</div>
</div>
</div>
)}
</>
);
Expand Down
6 changes: 3 additions & 3 deletions src/pages/Home/CredentialDetail.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ const CredentialDetail = () => {
<div className="flex flex-col sm:flex-row sm:items-center">
<div className="flex items-center">
<Link to="/">
<h1 className="text-2xl mb-2 font-bold text-gray-500">{t('common.navItemCredentials')}</h1>
</Link>
<h1 className="text-2xl mb-2 font-bold text-gray-500">{t('common.navItemCredentials')}</h1>
</Link>
<BiRightArrowAlt className="text-2xl mb-2 text-custom-blue" />
</div>
{credential && (
Expand Down Expand Up @@ -85,7 +85,7 @@ const CredentialDetail = () => {

<div className="flex flex-col lg:flex-row mt-4">
<div className="lg:w-1/2">
<CredentialJson credential={credential} />
<CredentialJson credential={credential} />
</div>
</div>
</div>
Expand Down
Loading

0 comments on commit cff3556

Please sign in to comment.