Skip to content

Commit

Permalink
fix: optimize variable naming
Browse files Browse the repository at this point in the history
  • Loading branch information
b3aton committed Jul 21, 2022
1 parent 24fa1d0 commit fcf6a7b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions apps/storefront/src/pages/registered/RegisterComplete.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ export default function RegisterComplete(props: RegisterCompleteProps) {
const newPasswordInformation: Array<CustomFieldItems> = []
let emailItem: CustomFieldItems = {}
if (list && list.length) {
const emailFileds = list.find((item: RegisterFields) => item.name === emailName) || {}
emailItem = { ...emailFileds }
const emailFields = list.find((item: RegisterFields) => item.name === emailName) || {}
emailItem = { ...emailFields }
emailItem.label = `${b3Lang('intl.user.register.RegisterComplete.email')}`
emailItem.name = 'email'
emailItem.disabled = true
Expand Down
8 changes: 4 additions & 4 deletions apps/storefront/src/pages/registered/Registered.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,11 @@ export default function Registered(props: RegisteredProps) {
const customAddress = billingAddress.length ? billingAddress.filter((field: RegisterFields) => field.custom) : []
const addressExtraFields: Array<RegisterFields> = conversionDataFormat(customAddress)

const newAddressInformationFields = addressInformationFields(b3Lang).map((addressFileds) => {
if (addressFileds.name === 'country') {
addressFileds.options = countries
const newAddressInformationFields = addressInformationFields(b3Lang).map((addressFields) => {
if (addressFields.name === 'country') {
addressFields.options = countries
}
return addressFileds
return addressFields
})

const filterPasswordInformation = customerAccount.length ? customerAccount.filter((field: RegisterFields) => !field.custom && field.fieldType === 'password') : []
Expand Down
2 changes: 1 addition & 1 deletion apps/storefront/src/pages/registered/RegisteredDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export default function RegisteredDetail(props: RegisteredDetailProps) {

const handleCountryChange = (countryCode: string, stateCode: string = '') => {
const stateList = countryList.find((country: Country) => country.countryCode === countryCode)?.states || []
const stateFields = addressBasicFields.find((formFileds: RegisterFields) => formFileds.name === 'state')
const stateFields = addressBasicFields.find((formFields: RegisterFields) => formFields.name === 'state')

if (stateFields) {
if (stateList.length > 0) {
Expand Down

0 comments on commit fcf6a7b

Please sign in to comment.