Skip to content

Commit

Permalink
Add warning text messages to en.json
Browse files Browse the repository at this point in the history
  • Loading branch information
gkatrakazas committed Mar 19, 2024
1 parent 4122cdf commit bbbd1f7
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 8 deletions.
20 changes: 17 additions & 3 deletions src/components/Layout.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import React, { useState, useEffect } from 'react';
import Sidebar from './Sidebar';
import { GiHamburgerMenu } from 'react-icons/gi';
import { FaExclamationTriangle, FaTimes } from 'react-icons/fa'; // Import the icons you want to use
import { FaExclamationTriangle, FaTimes } from 'react-icons/fa';
import logo from '../assets/images/wallet_white.png';
import { useLocation, useNavigate } from 'react-router-dom';
import { CSSTransition } from 'react-transition-group';
import { useSessionStorage } from '../components/useStorage';
import { useTranslation } from 'react-i18next';

const Layout = ({ children, isPermissionGranted, tokenSentInSession }) => {
const location = useLocation();
Expand All @@ -15,6 +16,7 @@ const Layout = ({ children, isPermissionGranted, tokenSentInSession }) => {
const toggleSidebar = () => setIsOpen(!isOpen);
const [isMessageNoGrantedVisible, setIsMessageNoGrantedVisible] = useSessionStorage('isMessageNoGrantedVisible', null);
const [isMessageGrantedVisible, setIsMessageGrantedVisible] = useSessionStorage('isMessageGrantedVisible', null);
const { t } = useTranslation();

const handleNavigate = (path) => {
if (location.pathname === path) {
Expand Down Expand Up @@ -88,7 +90,11 @@ const Layout = ({ children, isPermissionGranted, tokenSentInSession }) => {
<>
<div className="flex-grow">
<p className='text-sm'>
To receive real-time updates of <strong>Credentials, reset or allow notifications permission</strong>.
{t('layout.messageAllowPermissionPart1')}
<strong>{
t('layout.messageAllowPermissionPart2')}
</strong>
.
</p>
</div>
<button
Expand All @@ -103,7 +109,15 @@ const Layout = ({ children, isPermissionGranted, tokenSentInSession }) => {
<>
<div className="flex-grow">
<p className='text-sm'>
Something <strong>not working properly with the notifications</strong>, please <strong>reload the page.</strong>.
{t('layout.messageResetPermissionPart1')}
<strong>
{t('layout.messageResetPermissionPart2')}
</strong>
{t('layout.messageResetPermissionPart3')}
<strong>
{t('layout.messageResetPermissionPart4')}
</strong>
.
</p>
</div>
<button
Expand Down
18 changes: 13 additions & 5 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@
"windows": "Chrome, Edge, Opera or Brave on Windows"
}
},
"layout": {
"messageAllowPermissionPart1": "To receive real-time updates of ",
"messageAllowPermissionPart2": "Credentials, allow notifications permission",
"messageResetPermissionPart1": "Something ",
"messageResetPermissionPart2": "not working properly with the notifications",
"messageResetPermissionPart3": ", please ",
"messageResetPermissionPart4": "reload this page"
},
"loginSignup": {
"alreadyHaveAccountQuestion": "Already have an account? ",
"capitalLetter": "At least one capital letter",
Expand Down Expand Up @@ -121,13 +129,13 @@
"addPasskey": "Add passkey",
"deleteAccount": {
"buttonText": "Delete your account",
"deleteButtonTitleLocked":"You cannot delete your account while locked",
"deleteButtonTitleLocked": "You cannot delete your account while locked",
"description": "Once you delete your account, there is no going back. Please be certain.",
"messageDeleteAccount1": "Are you sure you want to delete ",
"messageDeleteAccount2": "your Account",
"title": "Delete account"
},
"deletePasskeyButtonTitleLocked":"You cannot add passkey while locked",
"deletePasskeyButtonTitleLocked": "You cannot add passkey while locked",
"description": "View account information and manage passkeys",
"lockPasskeyManagement": "Lock passkey management",
"noOtherPasskeys": "There are no other passkeys in this account.",
Expand All @@ -138,7 +146,7 @@
"cancelChangesAriaLabel": "Cancel changes to passkey {{passkeyLabel}}",
"created": "Created",
"deleteAriaLabel": "Delete passkey {{passkeyLabel}}",
"deleteButtonTitleLocked":"You cannot delete passkey while locked",
"deleteButtonTitleLocked": "You cannot delete passkey while locked",
"lastUsed": "Last Used",
"messageDeletePasskeyPart1": "Are you sure you want to delete",
"messageDeletePasskeyPart2": "passkey?",
Expand All @@ -147,7 +155,7 @@
"nicknameInputAriaLabel": "Enter new nickname for passkey {{passkeyLabel}}",
"rename": "Rename",
"renameAriaLabel": "Rename passkey {{passkeyLabel}}",
"renameButtonTitleLocked":"You cannot edit passkey while locked",
"renameButtonTitleLocked": "You cannot edit passkey while locked",
"saveChangesAriaLabel": "Save changes to passkey {{passkeyLabel}}",
"unnamed": "Unnamed passkey"
},
Expand Down Expand Up @@ -186,4 +194,4 @@
"navItemLogout": "Logout",
"poweredBy": "Powered by <docLinkWalletGithub>wwWallet</docLinkWalletGithub>"
}
}
}

0 comments on commit bbbd1f7

Please sign in to comment.