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
[ | |
{ | |
"base_asset": "audf", | |
"best_ask": "0", | |
"best_bid": "0", | |
"change_24hours": "0", | |
"exchange": null, | |
"forbidden_country": "US", | |
"incremental_price": "1", | |
"instrument": "audf_jidr_spot", |
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
import { axios } from 'axios' | |
import type { AxiosError } from 'axios' | |
const asyncFetch = async <T = unknown>(url: string, config?: ExtendConfig) => { | |
try { | |
const res = await axios<T>({ | |
url, | |
...config, | |
}) |
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
@tailwind base; | |
@tailwind utilities; | |
@tailwind components; | |
@layer base { | |
h1 { | |
@apply text-4xl font-bold text-theme-800 dark:text-theme-100 md:text-5xl; | |
} | |
h2 { |
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
import Axios, { AxiosRequestConfig } from 'axios' | |
import type { AxiosError } from 'axios' | |
type Method = 'GET' | 'POST' | 'DELETE' | 'PATCH' | 'PUT' | 'OPTIONS' | |
type HttpReturn<T> = Promise<[T | null, null | AxiosError<T, T>]> | |
export const httpInstance = Axios.create({ | |
baseURL: import.meta.env.VITE_APP_API_URL | |
}) |
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
type Value = Record<string, unknown> | |
export const arrayObjSearch = <T extends Value>(arr: Array<T>, key: keyof Array<T>[0], target: string): T | null => { | |
if (!key) throw new TypeError('You should provide what key to find') | |
if (arr.length === 0) return null | |
let i = 0 | |
do { | |
const source = arr[i][key] |
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
module.exports = { | |
semi: false, | |
tabWidth: 2, | |
printWidth: 120, | |
singleQuote: true, | |
jsxSingleQuote: true, | |
trailingComma: 'none', | |
arrowParens: 'always', | |
endOfLine: 'auto', | |
} |
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
{ | |
"recommendations": [ | |
"bradlc.vscode-tailwindcss", | |
"eamodio.gitlens", | |
"dbaeumer.vscode-eslint", | |
"usernamehw.errorlens", | |
"vscode-icons-team.vscode-icons", | |
"mintlify.document", | |
"esbenp.prettier-vscode", | |
"mikestead.dotenv", |
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
export const toElipsis = (str: string, range?: = 10): string => { | |
return str.slice(0, range) + '...' | |
} | |
// usage | |
const elipsis = toElipsis("Please mister, call me Robin, I will be your company while at your trip to Mongo Island", 44) | |
console.info(elipsis) // -> 'Please mister, call me robin, I will be your...' |
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
export async function httpreq(fn: () => Promise<any>): Promise<[any, any]> { | |
try { | |
const res = await fn() | |
return [res, null] | |
} catch(err) { | |
return [null, err] | |
} | |
} | |
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
import Image from "next/image" | |
export function ImageComponent(){ | |
return ( | |
<figure className="relative w-40 h-40 md:w-80 md:h-80"> | |
<Image lazy layout="fill" /> | |
</figure> | |
) | |
} |
NewerOlder