Skip to content

Commit 1b7be6a

Browse files
fix axe error, update validation (#60)
1 parent d20bf8e commit 1b7be6a

File tree

7 files changed

+12
-6
lines changed

7 files changed

+12
-6
lines changed

src/AddressFields.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ export const AddressFields: React.FC<CheckoutParams> = (props) => {
112112

113113
const handleClearSearch = () => {
114114
resetForm({});
115+
setCheckedItem(-1);
115116
if (addressData && addressData.length > 0) {
116117
setEditing(false);
117118
}

src/AppHeader.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export const AppHeader: React.FC = () => {
4444
<LanguageDropdown />
4545
</div>
4646
<div className="appheader__moltincartcontainer">
47-
<button className="appheader__cartbtn epbtn --bordered" onClick={handleCartModal}>
47+
<button className="appheader__cartbtn epbtn --bordered" aria-label={t('cart')} onClick={handleCartModal}>
4848
<span className="appheader__cartbtntxt">
4949
{t('cart')}
5050
{' ('}

src/CartItemList.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,11 @@ export const CartItemList: React.FC<CartItemListParams> = (props) => {
8282
</div>
8383
<div className="cartitemlist__quantitywrap">
8484
<div className="cartitemlist__quantity">
85-
<button className="cartitemlist__arrow --top" onClick={() => {handleUpdate(item.id, item.quantity + 1)}} />
85+
<button className="cartitemlist__arrow --top" aria-label={t('add-item')} onClick={() => {handleUpdate(item.id, item.quantity + 1)}} />
8686
<p className='cartitemlist__count'>
8787
{item.quantity}
8888
</p>
89-
<button className="cartitemlist__arrow --bottom" disabled={item.quantity === 1} onClick={() => {handleUpdate(item.id, item.quantity - 1)}} />
89+
<button className="cartitemlist__arrow --bottom" aria-label={t('remove-item')} disabled={item.quantity === 1} onClick={() => {handleUpdate(item.id, item.quantity - 1)}} />
9090
</div>
9191
</div>
9292
</div>

src/CartModal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ export const CartModal: React.FC<CartModalParams> = (props) => {
192192
<div className="cartmodal__body">
193193
<StripeProvider apiKey={config.stripeKey}>
194194
<Elements>
195-
<Checkout shippingAddress={shippingAddress} onPayOrder={onPayOrder} isDisabled={!billingAddress.last_name || !email || emailError !== ''} />
195+
<Checkout shippingAddress={shippingAddress} onPayOrder={onPayOrder} isDisabled={!billingAddress.last_name || (!isLoggedIn && !email) || (!isLoggedIn && emailError !== '')} />
196196
</Elements>
197197
</StripeProvider>
198198
</div>

src/SearchBar.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ export const SearchBar: React.FC<SearchBoxProps> = () => {
9898
<button
9999
className="searchbar__open"
100100
onClick={handleInputToggle}
101+
aria-label={t('search')}
101102
>
102103
<MagnifyingGlassIcon />
103104
</button>

src/locales/en.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,5 +175,7 @@
175175
"start-typing-an-address": "Start typing an address",
176176
"search-for-your-address": "Search for your {route} address",
177177
"item": "item",
178-
"items": "items"
178+
"items": "items",
179+
"add-item": "Add another item",
180+
"remove-item": "Remove one item"
179181
}

src/locales/fr.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,5 +175,7 @@
175175
"start-typing-an-address": "ŠŠţååŕţ ţţýþîîñĝ ååñ ååððŕŕéšš",
176176
"search-for-your-address": "ŠŠéåŕŕçĥ ƒƒöŕ ýýöûŕ {route} ååððŕŕéšš",
177177
"item": "îîţéɱ",
178-
"items": "îîţééɱš"
178+
"items": "îîţééɱš",
179+
"add-item": "ÅÅðð ååñöţţĥéŕ îîţéɱ",
180+
"remove-item": "ŔŔéɱööṽé ööñé îîţéɱ"
179181
}

0 commit comments

Comments
 (0)