Skip to content

Commit

Permalink
chore: prettier fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
letehaha authored and dr497 committed Nov 15, 2023
1 parent a05ad98 commit 48fed2a
Show file tree
Hide file tree
Showing 34 changed files with 109 additions and 109 deletions.
2 changes: 1 addition & 1 deletion src/components/CreateSubdomainModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export const CreateSubdomainModal = ({
},
() => {
closeModal("CreateSubdomain");
}
},
);
refresh();
} catch (err) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/DeleteModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const DeleteModal = ({
NAME_PROGRAM_ID,
getDomainKeySync(domain).pubkey,
publicKey,
publicKey
publicKey,
);
const sig = await sendTx(connection, publicKey, [ix], signTransaction);
console.log(sig);
Expand Down
2 changes: 1 addition & 1 deletion src/components/DomainRowRecord.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const DomainRowRecord = ({
const connection = useSolanaConnection();
const picRecord = useProfilePic(connection!, domain);
const [picPlaceholderColor, setPicPlaceholderColor] = useState(
tw.color("brand-accent")
tw.color("brand-accent"),
);

useEffect(() => {
Expand Down
18 changes: 9 additions & 9 deletions src/components/EditPicture.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export const EditPicture = ({
const ixs: TransactionInstruction[] = [];
const { pubkey, parent } = getDomainKeySync(
Record.Pic + "." + domain,
true
true,
);

try {
Expand All @@ -75,7 +75,7 @@ export const EditPicture = ({
const ix = await registerFavourite(
pubkey,
new PublicKey(publicKey),
NAME_OFFERS_ID
NAME_OFFERS_ID,
);
ixs.push(...ix);
}
Expand All @@ -85,7 +85,7 @@ export const EditPicture = ({
if (!info?.data) {
const space = 2_000;
const lamports = await connection.getMinimumBalanceForRentExemption(
space + NameRegistryState.HEADER_LEN
space + NameRegistryState.HEADER_LEN,
);
const ix = await createNameRegistry(
connection,
Expand All @@ -95,14 +95,14 @@ export const EditPicture = ({
new PublicKey(publicKey),
lamports,
undefined,
parent
parent,
);
ixs.push(ix);
} else {
// Zero the data stored
const { registry } = await NameRegistryState.retrieve(
connection,
pubkey
pubkey,
);

if (!registry.owner.equals(new PublicKey(publicKey))) {
Expand All @@ -114,7 +114,7 @@ export const EditPicture = ({
registry.owner,
undefined,
parent,
new PublicKey(publicKey)
new PublicKey(publicKey),
);
ixs.push(ix);
}
Expand All @@ -127,7 +127,7 @@ export const EditPicture = ({
pubkey,
new Numberu32(0),
zero,
new PublicKey(publicKey)
new PublicKey(publicKey),
);
ixs.push(ix);
}
Expand All @@ -139,15 +139,15 @@ export const EditPicture = ({
pubkey,
new Numberu32(0),
data,
new PublicKey(publicKey)
new PublicKey(publicKey),
);
ixs.push(ix);

const sig = await sendTx(
connection,
new PublicKey(publicKey),
ixs,
signTransaction
signTransaction,
);
console.log(sig);

Expand Down
2 changes: 1 addition & 1 deletion src/components/SearchModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const SearchModal = ({

const list = useMemo(
() => domains?.filter((e) => e.domain.includes(search)),
[search]
[search],
);

return (
Expand Down
2 changes: 1 addition & 1 deletion src/components/Skeleton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const Skeleton = ({
useNativeDriver: false,
easing: Easing.ease,
}),
])
]),
).start();
}, [translateX]);

Expand Down
6 changes: 3 additions & 3 deletions src/components/TokenizeModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export const TokenizeModal = ({

const [mintKey] = PublicKey.findProgramAddressSync(
[MINT_PREFIX, pubkey.toBuffer()],
NAME_TOKENIZER_ID
NAME_TOKENIZER_ID,
);

const ata = await getAssociatedTokenAddress(mintKey, publicKey);
Expand All @@ -73,7 +73,7 @@ export const TokenizeModal = ({
const closeAtaIx = createCloseAccountInstruction(
ata,
publicKey,
publicKey
publicKey,
);

ixs.push(closeAtaIx);
Expand All @@ -96,7 +96,7 @@ export const TokenizeModal = ({
publicKey,
ata,
publicKey,
mintKey
mintKey,
);
ixs.push(ix);
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/TransferModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export const TransferModal = ({
newOwner,
publicKey,
undefined,
ROOT_DOMAIN_ACCOUNT
ROOT_DOMAIN_ACCOUNT,
);

const sig = await sendTx(connection, publicKey, [ix], signTransaction);
Expand Down
2 changes: 1 addition & 1 deletion src/contexts/LanguageContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const LanguageProvider = ({
}) => {
// Define a state for the current language
const [currentLanguage, setCurrentLanguage] = useState<string>(
i18n.locale || "en"
i18n.locale || "en",
);

const setLanguage = async (language: string) => {
Expand Down
4 changes: 2 additions & 2 deletions src/hooks/react-native/useKeyboardVisible.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ export const useKeyboardVisible = () => {
"keyboardDidShow",
() => {
setKeyboardVisible(true);
}
},
);
const keyboardDidHideListener = Keyboard.addListener(
"keyboardDidHide",
() => {
setKeyboardVisible(false);
}
},
);

return () => {
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useDomainInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const useDomainInfo = (domain: string) => {
const { pubkey } = getDomainKeySync(domain);
const { registry, nftOwner } = await NameRegistryState.retrieve(
connection,
pubkey
pubkey,
);

const _isTokenized = await isTokenized(connection, pubkey);
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useDomains.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export interface Response {
const get = async (key: string | undefined | null) => {
if (!key) return;
const { data }: { data: Response } = await axios.get(
`https://sns-sdk-proxy.bonfida.workers.dev/domains/${key}`
`https://sns-sdk-proxy.bonfida.workers.dev/domains/${key}`,
);
if (data.s !== "ok") return;
data.result.sort((a, b) => a.domain.localeCompare(b.domain));
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useHandleError.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const useHandleError = () => {
err: any,
{
unknownErrorMessage = "Something went wrong - try again",
}: { unknownErrorMessage?: string } = {}
}: { unknownErrorMessage?: string } = {},
) => {
console.error(err);

Expand Down
4 changes: 2 additions & 2 deletions src/hooks/useSearch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export interface Result {

export const getDomainsResult = async (
connection: Connection,
domains: string[]
domains: string[],
): Promise<Result[]> => {
const keys = domains.map((e) => getDomainKeySync(e).pubkey);
const infos = await connection?.getMultipleAccountsInfo(keys);
Expand Down Expand Up @@ -41,7 +41,7 @@ export const useSearch = (domain: string) => {
const domainsAlternatives = generateRandom(parsedDomain, 10);
const domainsAlternativesResult = await getDomainsResult(
connection,
domainsAlternatives
domainsAlternatives,
);
// if the subdomain doesn't exists check if the domain is available
if (!subdomainInfo?.data) {
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useStorageMap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export interface Actions<K, V> {
// We hide some setters from the returned map to disable autocompletion
type Return<K, V> = [
Omit<Map<K, V>, "set" | "clear" | "delete">,
Actions<K, V>
Actions<K, V>,
];

export function useStorageMap(): Return<string, number> {
Expand Down
18 changes: 9 additions & 9 deletions src/hooks/useSubdomains.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export interface SubdomainResult {

async function findOwnedNameAccountsForUser(
connection: Connection,
userAccount: PublicKey
userAccount: PublicKey,
): Promise<PublicKey[]> {
const filters = [
{
Expand Down Expand Up @@ -57,32 +57,32 @@ export const useSubdomainsFromUser = (owner: string) => {

const ownedAccounts = await findOwnedNameAccountsForUser(
connection,
new PublicKey(owner)
new PublicKey(owner),
);

const nameRegistriesState = (
await NameRegistryState.retrieveBatch(connection, ownedAccounts)
).filter(
(registryState): registryState is NameRegistryState =>
registryState !== undefined
registryState !== undefined,
);

const uniqueRegistryStateParents = nameRegistriesState.filter(
(nameRegistryState, idx) =>
nameRegistriesState.findIndex((e) =>
e.parentName.equals(nameRegistryState.parentName)
) === idx
e.parentName.equals(nameRegistryState.parentName),
) === idx,
);

const userOwnedSubdomainsPromises = uniqueRegistryStateParents.map(
async (registryState) => {
const domain = await reverseLookup(
connection,
registryState.parentName
registryState.parentName,
);
const subdomains = await findSubdomains(
connection,
registryState.parentName
registryState.parentName,
);

const ownedSubdomains: SubdomainResult[] = [];
Expand All @@ -100,12 +100,12 @@ export const useSubdomainsFromUser = (owner: string) => {
}

return ownedSubdomains;
}
},
);

const userSubdomainsResult: SubdomainResult[] = [];
const userOwnedSubdomains = await Promise.allSettled(
userOwnedSubdomainsPromises
userOwnedSubdomainsPromises,
);
userOwnedSubdomains.map((e) => {
if (e.status === "fulfilled") {
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useTopDomainsSales.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const useTopDomainsSales = (allowedToLoad: boolean = true) => {
const {
data: { result },
} = await axios.get<{ result: SearchResponseEntity[] }>(
`${URL}?${searchParams.toString()}`
`${URL}?${searchParams.toString()}`,
);

// All domains returned by the API are available
Expand Down
6 changes: 3 additions & 3 deletions src/hooks/useWallet.android.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const useMobilePlatformWallet = () => {
const { handleError } = useHandleError();

async function signAllTransactions<T extends Tx>(
transactions: T[]
transactions: T[],
): Promise<T[]> {
try {
return transact(async (wallet) => {
Expand All @@ -27,7 +27,7 @@ export const useMobilePlatformWallet = () => {
}

async function signTransaction<T extends Tx>(
transaction: T
transaction: T,
): Promise<T | undefined> {
try {
return transact(async (wallet) => {
Expand All @@ -49,7 +49,7 @@ export const useMobilePlatformWallet = () => {
}

async function signMessage(
message: Uint8Array
message: Uint8Array,
): Promise<Uint8Array | undefined> {
try {
return transact(async (wallet) => {
Expand Down
4 changes: 2 additions & 2 deletions src/hooks/xnft-hooks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ export function usePublicKeys(): Map<string, string> {
if (didLaunch) {
window.xnft.on("publicKeysUpdate", () => {
setPublicKeys(
new Map<string, string>(Object.entries(window.xnft.publicKeys))
new Map<string, string>(Object.entries(window.xnft.publicKeys)),
);
});
setPublicKeys(
new Map<string, string>(Object.entries(window.xnft.publicKeys))
new Map<string, string>(Object.entries(window.xnft.publicKeys)),
);
}
}, [didLaunch, setPublicKeys]);
Expand Down
2 changes: 1 addition & 1 deletion src/locales/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const LANGUAGES: Language[] = [

// format so we can import directly into lingui's i18n.load()
export const allTranslations = Object.fromEntries(
LANGUAGES.map(({ locale, messages }) => [locale, messages])
LANGUAGES.map(({ locale, messages }) => [locale, messages]),
);

// export all available locales for lingui.config.js
Expand Down
Loading

0 comments on commit 48fed2a

Please sign in to comment.