chore: setup cspell and fix some typoes (#352)

Co-authored-by: DIYgod <i@diygod.me>
This commit is contained in:
UncleBill
2023-04-16 20:42:00 +01:00
committed by GitHub
co-authored by DIYgod
parent ee08666375
commit d7ca395215
26 changed files with 968 additions and 517 deletions
+6 -6
View File
@@ -1,7 +1,7 @@
import type { AchievementSection } from "~/models/site.model"
import { Image } from "~/components/ui/Image"
import { AchievementModal } from "~/components/common/AchievementModal"
import { useEffect, useState } from "react"
import { useState } from "react"
import { Indicator } from "@mantine/core"
import { useDate } from "~/hooks/useDate"
import { useTranslation } from "next-i18next"
@@ -50,14 +50,14 @@ export const AchievementItem: React.FC<{
? group.items.filter((item) => item.status === "MINTABLE").pop()
: null
const achievementComming = isOwner
? group.items.filter((item) => item.status === "COMMING").pop()
const achievementComing = isOwner
? group.items.filter((item) => item.status === "COMING").pop()
: null
const [opened, setOpened] = useState(false)
if (isOwner) {
if (!achievement && !achievementMintable && !achievementComming) {
if (!achievement && !achievementMintable && !achievementComing) {
return null
}
} else {
@@ -78,7 +78,7 @@ export const AchievementItem: React.FC<{
>
<Badge
media={
(achievement || achievementMintable || achievementComming)!.info
(achievement || achievementMintable || achievementComing)!.info
.media
}
className={`mb-1 ${!achievement && "grayscale"}`}
@@ -122,7 +122,7 @@ export const AchievementItem: React.FC<{
)
.humanize(),
})
: t(achievementMintable ? "Mintable" : "Comming soon")}
: t(achievementMintable ? "Mintable" : "Coming soon")}
</span>
</div>
</div>
+7 -9
View File
@@ -5,7 +5,6 @@ import Tilt from "react-parallax-tilt"
import { Badge } from "~/components/common/AchievementItem"
import { Button } from "~/components/ui/Button"
import { useMintAchievement } from "~/queries/site"
import { useRouter } from "next/router"
import { BlockchainIcon } from "~/components/icons/BlockchainIcon"
import { useDate } from "~/hooks/useDate"
import { useTranslation } from "next-i18next"
@@ -30,15 +29,15 @@ export const AchievementModal: React.FC<{
? group.items.filter((item) => item.status === "MINTABLE").pop()
: null
const achievementComming = isOwner
? group.items.filter((item) => item.status === "COMMING").pop()
const achievementComing = isOwner
? group.items.filter((item) => item.status === "COMING").pop()
: null
const mintAchievement = useMintAchievement()
const mint = async (tokenId: number) => {
if (characterId) {
await mintAchievement.mutate({
mintAchievement.mutate({
characterId,
achievementId: tokenId,
})
@@ -73,8 +72,7 @@ export const AchievementModal: React.FC<{
<div
className="inline-flex flex-col text-center items-center text-white"
key={
(achievement || achievementMintable || achievementComming)!.info
.name
(achievement || achievementMintable || achievementComing)!.info.name
}
>
<Tilt
@@ -93,7 +91,7 @@ export const AchievementModal: React.FC<{
fill
alt="achievement"
src={
(achievement || achievementMintable || achievementComming)!.info
(achievement || achievementMintable || achievementComing)!.info
.media
}
className="relative w-full h-full"
@@ -108,7 +106,7 @@ export const AchievementModal: React.FC<{
</span>
<span className="text-lg text-black capitalize truncate">
{
(achievement || achievementMintable || achievementComming)!.info
(achievement || achievementMintable || achievementComing)!.info
.description
}
</span>
@@ -138,7 +136,7 @@ export const AchievementModal: React.FC<{
</span>
</>
) : (
t(achievementMintable ? "Mintable" : "Comming soon")
t(achievementMintable ? "Mintable" : "Coming soon")
)}
</span>
</div>
+3 -2
View File
@@ -119,6 +119,7 @@ export const Reactions: React.FC<{
window.innerHeight,
},
shapes: ["star"],
// cspell:disable-next-line
colors: ["FFE400", "FFBD00", "E89400", "FFCA6C", "FDFFB8"],
})
}
@@ -329,7 +330,7 @@ export const Reactions: React.FC<{
<Modal
open={isLikeOpen}
setOpen={setIsLikeOpen}
title={t("Like successfull") || ""}
title={t("Like successfully") || ""}
>
<div className="p-5">
<Trans i18nKey="like stored">
@@ -351,7 +352,7 @@ export const Reactions: React.FC<{
<Modal
open={isMintOpen}
setOpen={setIsMintOpen}
title={t("Mint successfull") || ""}
title={t("Mint successfully") || ""}
>
<div className="p-5">
<Trans i18nKey="mint stored">
+1 -1
View File
@@ -1,6 +1,6 @@
import { cn } from "~/lib/utils"
import { useRouter } from "next/router"
import React, { useEffect, useState } from "react"
import React, { useEffect } from "react"
import { DISCORD_LINK, APP_NAME } from "~/lib/env"
import { getSiteLink } from "~/lib/helpers"
+1 -1
View File
@@ -1,4 +1,4 @@
import { APP_NAME, SITE_URL } from "~/lib/env"
import { SITE_URL } from "~/lib/env"
import { UniLink } from "../ui/UniLink"
import { Profile, Note } from "~/lib/types"
import Script from "next/script"
+2 -2
View File
@@ -66,7 +66,7 @@ export const Editor: React.FC<{
for (let i = 0; i < items.length; i++) {
const file = items[i]?.getAsFile()
if (file) {
await handleDropFile?.(file)
handleDropFile?.(file)
}
}
})()
@@ -79,7 +79,7 @@ export const Editor: React.FC<{
{
;(async () => {
for (let i = 0; i < items.length; i++) {
await handleDropFile?.(items[i])
handleDropFile?.(items[i])
}
})()
}
+3 -3
View File
@@ -13,7 +13,7 @@ type InputProps<TMultiline extends boolean> = {
} & React.ComponentPropsWithRef<TMultiline extends true ? "textarea" : "input">
export const Input = forwardRef(function Input<
TMutliline extends boolean = false,
TMultiline extends boolean = false,
>(
{
label,
@@ -25,8 +25,8 @@ export const Input = forwardRef(function Input<
help,
multiline,
...inputProps
}: InputProps<TMutliline>,
ref: TMutliline extends true
}: InputProps<TMultiline>,
ref: TMultiline extends true
? React.ForwardedRef<HTMLTextAreaElement>
: React.ForwardedRef<HTMLInputElement>,
) {
+1 -1
View File
@@ -1,4 +1,4 @@
/** based on prism tomorror */
/** based on prism tomorrow */
pre,
code {
-1
View File
@@ -1,4 +1,3 @@
import { EditorSelection } from "@codemirror/state"
import { ICommand, wrapExecute } from "."
export const Bold: ICommand = {
-1
View File
@@ -1,4 +1,3 @@
import { GetServerSideProps } from "next"
import { fetchGetSite } from "~/queries/site.server"
import { fetchGetPagesBySite } from "~/queries/page.server"
import { PageVisibilityEnum } from "~/lib/types"
+3 -3
View File
@@ -565,7 +565,7 @@ export type AchievementSection = {
items: {
tokenId: number
name: string
status: "INACTIVE" | "MINTABLE" | "MINTED" | "COMMING"
status: "INACTIVE" | "MINTABLE" | "MINTED" | "COMING"
mintedAt: string | null
transactionHash: string | null
info: {
@@ -616,7 +616,7 @@ export async function getAchievements(characterId: string) {
},
tokenId: 0,
name: "showcase-superstar",
status: "COMMING",
status: "COMING",
mintedAt: null,
transactionHash: null,
},
@@ -644,7 +644,7 @@ export async function getAchievements(characterId: string) {
},
tokenId: 0,
name: "mirror-xyz-migrator",
status: "COMMING",
status: "COMING",
mintedAt: null,
transactionHash: null,
},
-1
View File
@@ -4,7 +4,6 @@ import "~/generated/uno.css"
import { Toaster } from "react-hot-toast"
import { createClient, WagmiConfig } from "wagmi"
import { Hydrate, QueryClient } from "@tanstack/react-query"
import { ReactQueryDevtools } from "@tanstack/react-query-devtools"
import { PersistQueryClientProvider } from "@tanstack/react-query-persist-client"
import {
ConnectKitProvider,
+10 -10
View File
@@ -161,7 +161,7 @@ export default function SubdomainEditor() {
}
setValues(newValues)
},
[setValues, values, draftKey, isPost, queryClient, subdomain],
[setValues, values, draftKey, isPost, queryClient, subdomain, t],
)
const createOrUpdatePage = useCreateOrUpdatePage()
@@ -434,30 +434,30 @@ export default function SubdomainEditor() {
const position = computedPosition()
let selfElement
let selfPostion
let selfPosition
let targetElement
let targetPosition
if (area === "preview") {
selfElement = previewRef.current.parentElement
selfPostion = position.previewElementList
selfPosition = position.previewElementList
targetElement = view.scrollDOM
targetPosition = position.editorElementList
} else {
selfElement = view.scrollDOM
selfPostion = position.editorElementList
selfPosition = position.editorElementList
targetElement = previewRef.current.parentElement
targetPosition = position.previewElementList
}
let scrollElementIndex = 0
for (let i = 0; i < selfPostion.length; i++) {
if (scrollTop < selfPostion[i]) {
for (let i = 0; i < selfPosition.length; i++) {
if (scrollTop < selfPosition[i]) {
scrollElementIndex = i - 1
break
}
}
// scroll to buttom
// scroll to bottom
if (scrollTop >= selfElement.scrollHeight - selfElement.clientHeight) {
targetElement.scrollTop =
targetElement.scrollHeight - targetElement.clientHeight
@@ -467,9 +467,9 @@ export default function SubdomainEditor() {
// scroll to position
if (scrollElementIndex >= 0) {
let ratio =
(scrollTop - selfPostion[scrollElementIndex]) /
(selfPostion[scrollElementIndex + 1] -
selfPostion[scrollElementIndex])
(scrollTop - selfPosition[scrollElementIndex]) /
(selfPosition[scrollElementIndex + 1] -
selfPosition[scrollElementIndex])
targetElement.scrollTop =
ratio *
(targetPosition[scrollElementIndex + 1] -
@@ -42,7 +42,7 @@ export default function ImportMarkdownPage() {
const mirrorXyz = useGetMirrorXyz({
address: site.data?.metadata?.owner,
})
const checkeMirror = useCheckMirror(site.data?.metadata?.proof)
const checkMirror = useCheckMirror(site.data?.metadata?.proof)
const notes = mirrorXyz?.data?.map((note) => ({
title: note.title,
@@ -84,7 +84,7 @@ export default function ImportMarkdownPage() {
return (
<DashboardMain title="Import from Mirror.xyz">
{checkeMirror?.data ? (
{checkMirror?.data ? (
<form onSubmit={handleSubmit}>
<div className="min-w-[270px] max-w-screen-lg flex flex-col space-y-4">
<div>
+2 -2
View File
@@ -3,7 +3,7 @@ import { DashboardLayout } from "~/components/dashboard/DashboardLayout"
import { DashboardMain } from "~/components/dashboard/DashboardMain"
import { UniLink } from "~/components/ui/UniLink"
import { Image } from "~/components/ui/Image"
import { DISCORD_LINK, TWITTER_LINK, GITHUB_LINK, APP_NAME } from "~/lib/env"
import { DISCORD_LINK, TWITTER_LINK, GITHUB_LINK } from "~/lib/env"
import { getSiteLink } from "~/lib/helpers"
import type { ReactElement } from "react"
import { useGetSite, useGetStat } from "~/queries/site"
@@ -91,7 +91,7 @@ export default function SubdomainIndex() {
<div className="prose p-6 bg-slate-50 rounded-lg relative">
<Trans
i18nKey="hello.welcome"
defaults="<p>👋 Hello there,</p><p>Welcome to use xLog!</p><p>Here're some useful links to get started:</p>"
defaults="<p>👋 Hello there,</p><p>Welcome to use xLog!</p><p>Here are some useful links to get started:</p>"
components={{
p: <p />,
}}
+2 -2
View File
@@ -6,7 +6,7 @@ import { Button } from "~/components/ui/Button"
import { useAccountState, useConnectedAction } from "@crossbell/connect-kit"
import { useRefCallback } from "@crossbell/util-hooks"
import { useRouter } from "next/router"
import { GITHUB_LINK, APP_NAME, CSB_SCAN, OUR_DOMAIN } from "~/lib/env"
import { GITHUB_LINK, CSB_SCAN } from "~/lib/env"
import { getSiteLink } from "~/lib/helpers"
import { Link, Element } from "react-scroll"
import { Image } from "~/components/ui/Image"
@@ -363,7 +363,7 @@ function Home() {
</p>
</div>
<ul className="pt-10 grid grid-cols-1 sm:grid-cols-3 gap-8">
{feature.subfeatures.map((item, index) => (
{feature.subfeatures.map((item) => (
<li
className="border rounded-xl overflow-hidden bg-white hover:shadow-md hover:scale-105 transition duration-300 cursor-default"
key={item.title}