Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
DIYgod committed Mar 11, 2024
2 parents 2a389d8 + 8e0b89a commit 5a2fe79
Show file tree
Hide file tree
Showing 9 changed files with 93 additions and 95 deletions.
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@
"@codemirror/state": "6.4.1",
"@codemirror/theme-one-dark": "6.1.2",
"@codemirror/view": "6.24.1",
"@crossbell/connect-kit": "1.5.25",
"@crossbell/contract": "1.5.25",
"@crossbell/indexer": "1.5.25",
"@crossbell/notification": "1.5.25",
"@crossbell/ui": "1.5.25",
"@crossbell/util-hooks": "1.5.25",
"@crossbell/util-metadata": "1.5.25",
"@crossbell/connect-kit": "1.5.26",
"@crossbell/contract": "1.5.26",
"@crossbell/indexer": "1.5.26",
"@crossbell/notification": "1.5.26",
"@crossbell/ui": "1.5.26",
"@crossbell/util-hooks": "1.5.26",
"@crossbell/util-metadata": "1.5.26",
"@ddietr/codemirror-themes": "1.4.2",
"@dqbd/tiktoken": "1.0.13",
"@emoji-mart/data": "1.1.2",
Expand Down
108 changes: 54 additions & 54 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 4 additions & 21 deletions src/app/[locale]/(home)/about/page.tsx
Original file line number Diff line number Diff line change
@@ -1,34 +1,19 @@
import { getTranslations } from "next-intl/server"
import Link from "next/link"
import { memo } from "react"

import { Logo } from "~/components/common/Logo"
import { BlockNumber } from "~/components/home/BlockNumber"
import { default as OriginEntranceButton } from "~/components/home/EntranceButton"
import { EntranceButton } from "~/components/home/EntranceButton"
import { Integration } from "~/components/home/Integrations"
import { ShowCase } from "~/components/home/Showcase"
import { Button } from "~/components/ui/Button"
import { Image } from "~/components/ui/Image"
import { CSB_SCAN, GITHUB_LINK } from "~/lib/env"
import { getSiteLink } from "~/lib/helpers"

async function Home() {
export default async function Home() {
const t = await getTranslations()

const EntranceButton = memo(function Button() {
return (
<OriginEntranceButton
connectedContent={
<>
<span className="i-mingcute-grid-line text-xl mr-2 inline-block"></span>
<span>{t("Dashboard")}</span>
</>
}
unconnectedContent={t("Get my xLog in 5 minutes")}
/>
)
})

const features: {
title: string
subfeatures: {
Expand Down Expand Up @@ -181,7 +166,7 @@ async function Home() {
}
></div>
<div
className={`block rounded-full w-10 h-10 mx-auto p-2 text-white bg-gradient-to-br text-feature-${feature.title.toLocaleLowerCase()}`}
className={`block rounded-full size-10 mx-auto p-2 text-white bg-gradient-to-br text-feature-${feature.title.toLocaleLowerCase()}`}
>
{index + 1}
</div>
Expand Down Expand Up @@ -325,13 +310,11 @@ async function Home() {
</div>
</div>
<div className="my-20 text-center">
<div className="w-[100px] h-[100px] mx-auto mb-10">
<div className="size-[100px] mx-auto mb-10">
<Logo type="lottie" width={100} height={100} loop={true} />
</div>
<EntranceButton />
</div>
</div>
)
}

export default Home
13 changes: 12 additions & 1 deletion src/components/common/CharacterCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { Titles } from "~/components/common/Titles"
import { Avatar } from "~/components/ui/Avatar"
import { Skeleton } from "~/components/ui/Skeleton"
import { useDate } from "~/hooks/useDate"
import { getSiteLink } from "~/lib/helpers"
import { cn } from "~/lib/utils"
import { useGetCharacterCard } from "~/queries/site"

Expand Down Expand Up @@ -65,7 +66,17 @@ export const CharacterCard = ({
)}
</span>
<span className="flex items-center space-x-1">
<span className="font-bold text-base text-zinc-800">
<span
className="font-bold text-base text-zinc-800 cursor-pointer hover:underline"
onClick={(e) => {
e.preventDefault()
window.open(
`${getSiteLink({
subdomain: siteId || "",
})}`,
)
}}
>
{site?.metadata?.content?.name}
</span>
<Titles characterId={+(site?.characterId || "")} />
Expand Down
4 changes: 2 additions & 2 deletions src/components/dashboard/toolbars/ResizeImage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ const action = (view: EditorView) => {
}

export const ResizeImage: ICommand = {
name: "image-size",
label: "Image Size",
name: "resize-image",
label: "Resize Image",
icon: "i-mingcute-aspect-ratio-line",
execute: ({ view }) => {
action(view)
Expand Down
18 changes: 11 additions & 7 deletions src/components/home/EntranceButton.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
"use client"

import { useTranslations } from "next-intl"
import { useRouter } from "next/navigation"
import React from "react"

import { useAccountState } from "@crossbell/connect-kit"

import { Button } from "~/components/ui/Button"

interface Props {
connectedContent: React.ReactNode
unconnectedContent: React.ReactNode
}

export default function EntranceButton(props: Props) {
export function EntranceButton() {
const router = useRouter()
const t = useTranslations()
const isConnected = useAccountState((s) => !!s.computed.account)

return (
Expand All @@ -23,7 +20,14 @@ export default function EntranceButton(props: Props) {
size="2xl"
variantColor="black"
>
{isConnected ? props.connectedContent : props.unconnectedContent}
{isConnected ? (
<>
<span className="i-mingcute-grid-line text-xl mr-2 inline-block"></span>
<span>{t("Dashboard")}</span>
</>
) : (
<span>{t("Get my xLog in 5 minutes")}</span>
)}
</Button>
)
}
2 changes: 1 addition & 1 deletion src/messages/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
"Link": "リンク",
"Image": "画像",
"Upload Image, Audio or Video": "画像、音声、動画をアップロード",
"ResizeImage": "画像のサイズを変更",
"Resize Image": "画像のサイズを変更",
"Tip: xLog Flavored Markdown": "ヒント:xLog 風のマークダウン",
"Preview": "プレビュー",
"Publish": "公開",
Expand Down
2 changes: 1 addition & 1 deletion src/messages/zh-TW.json
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@
"Link": "連結",
"Image": "圖片",
"Upload Image, Audio or Video": "上傳圖片、音頻或視頻",
"ImageSize": "調整圖片大小",
"Resize Image": "調整圖片大小",
"Preview": "預覽",
"Publish": "發布",
"Update": "更新",
Expand Down
2 changes: 1 addition & 1 deletion src/messages/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@
"Link": "链接",
"Image": "图片",
"Upload Image, Audio or Video": "上传图片、音频或视频",
"ImageSize": "调整图像大小",
"Resize Image": "调整图像大小",
"Mention": "提及",
"Tip: xLog Flavored Markdown": "帮助:xLog 风格的 Markdown",
"Preview": "预览",
Expand Down

0 comments on commit 5a2fe79

Please sign in to comment.