-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #920 from w3bdesign/develop
Refactor input fields to separate file
- Loading branch information
Showing
2 changed files
with
44 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { getCustomNumberValidation } from '../functions/functions'; | ||
|
||
export const INPUT_FIELDS = [ | ||
{ label: 'Fornavn', name: 'firstName' }, | ||
{ label: 'Etternavn', name: 'lastName' }, | ||
{ label: 'Adresse', name: 'address1' }, | ||
{ | ||
label: 'Postnummer', | ||
name: 'postcode', | ||
customValidation: getCustomNumberValidation( | ||
{ | ||
minLength: 'Postnummer må være minimum 4 tall', | ||
maxLength: 'Postnummer må være maksimalt 4 tall', | ||
pattern: 'Postnummer må bare være tall', | ||
}, | ||
4 | ||
), | ||
}, | ||
{ label: 'Sted', name: 'city' }, | ||
{ | ||
label: 'Epost', | ||
name: 'email', | ||
customValidation: getCustomNumberValidation( | ||
{ pattern: 'Du må oppgi en gyldig epost' }, | ||
undefined, | ||
/^[a-z0-9_!#$%&'*+\/=?`{|}~^.-]+@[a-z0-9.-]+$/gim | ||
), | ||
}, | ||
{ | ||
label: 'Telefon', | ||
name: 'phone', | ||
customValidation: getCustomNumberValidation( | ||
{ | ||
minLength: 'Minimum 8 tall i telefonnummeret', | ||
maxLength: 'Maksimalt 8 tall i telefonnummeret', | ||
pattern: 'Ikke gyldig telefonnummer', | ||
}, | ||
8 | ||
), | ||
}, | ||
]; |
87a1f4a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
nextjs-woocommerce – ./
nextjs-woocommerce-git-master-w3bdesign.vercel.app
nextjswoo.vercel.app
nextjs-woocommerce-w3bdesign.vercel.app
next-woocommerce.dfweb.no