-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
591 additions
and
350 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
packages/@justaname.id/react/src/lib/helpers/validateEns.ts
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,15 @@ | ||
import { normalize } from 'viem/ens'; | ||
|
||
export const validateEns = (name: string | undefined): string | undefined => { | ||
if (typeof name !== 'string' || name.trim() === '') { | ||
return; | ||
} | ||
|
||
try { | ||
const normalized = normalize(name); | ||
|
||
return normalized; | ||
} catch (error) { | ||
return; | ||
} | ||
}; |
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
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
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 |
---|---|---|
@@ -1,12 +1,10 @@ | ||
import './polyfills'; | ||
|
||
import { scan } from 'react-scan'; // import this BEFORE react | ||
|
||
if (typeof window !== 'undefined') { | ||
scan({ | ||
enabled: true, | ||
log: true, // logs render info to console (default: false) | ||
}); | ||
} | ||
// if (typeof window !== 'undefined') { | ||
// scan({ | ||
// enabled: true, | ||
// log: true, // logs render info to console (default: false) | ||
// }); | ||
// } | ||
|
||
export const decorators = [(Story) => <Story />]; |
Oops, something went wrong.