Skip to content

Commit

Permalink
add page, fix links
Browse files Browse the repository at this point in the history
  • Loading branch information
KishiTheMechanic committed Nov 9, 2024
1 parent 1388ee7 commit 2ea1709
Show file tree
Hide file tree
Showing 13 changed files with 160 additions and 6 deletions.
2 changes: 2 additions & 0 deletions components/utils/img.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,5 @@ export const EPICS_DAO_PRODUCT_IMG = '/img/daos/EpicsDAO.jpg'

export const ICON_OPOS_COMPRESSED_COIL = '/img/icon/opos/CompressedCoil.png'
export const ICON_OPOS_SAGA_PHONE = '/img/icon/opos/SagaPhone.png'

export const SOLANA_BLINKS_IMG = '/img/icon/solana/SolanaBlinks.webp'
1 change: 1 addition & 0 deletions constants/links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export const EAST_VENTURES_LINK = 'https://east.vc/'
export const MIRAISE_LINK = 'https://miraise.vc/'
export const PRISMA_LINK = 'https://prisma.io/'
export const EXPO_LINK = 'https://expo.dev/'
export const SOLANA_ACTIONS_WEB_LINK = 'https://solana.com/solutions/actions'

export const SOLANA_VALIDATOR_LINK =
'https://docs.solanalabs.com/operations/requirements'
Expand Down
6 changes: 4 additions & 2 deletions islands/layouts/default/DefaultFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
import { useTranslation } from '@/hooks/i18n/useTranslation.ts'
import Link from '@/components/utils/Link.tsx'
import { usePathname } from '@/hooks/i18n/usePathname.ts'
import { ERPC_WEB_LINK } from '@/constants/links.ts'

export default function DefaultFooter() {
const t = useTranslation()
Expand Down Expand Up @@ -62,14 +63,15 @@ export default function DefaultFooter() {
</div>
<div class='flex w-full flex-col gap-3'>
<a
href={appInfo.loginUrl}
href={ERPC_WEB_LINK}
class={cn(
'py-2 text-sm',
linkBaseColor,
'flex items-center gap-4',
)}
target='_blank'
>
{t('common.aiChat')}
ERPC - Enhanced Solana RPC
</a>
</div>
<div class='flex w-full flex-col gap-3'>
Expand Down
2 changes: 0 additions & 2 deletions islands/layouts/default/DefaultModalNav.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { appInfo } from '@/config.ts'
import LogoHorizontalLink from '@/components/common/LogoHorizontalLink.tsx'
import { cn } from '@/lib/utils.ts'
import { useSignal } from '@preact/signals'
Expand All @@ -19,7 +18,6 @@ import {
import { usePathname } from '@/hooks/i18n/usePathname.ts'
import Link from '@/components/utils/Link.tsx'
import { useTranslation } from '@/hooks/i18n/useTranslation.ts'
import Button from '@/components/ui/Button.tsx'

export default function DefaultModalNav() {
const t = useTranslation()
Expand Down
9 changes: 9 additions & 0 deletions islands/layouts/default/defaultNavs.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
export enum DEFAULT_PATHS {
home = '/',
blinks = '/blinks',
doc = '/doc/general/getting-started',
news = '/news',
privacy = '/legal/privacy-policy',
}

export const defaultHeaderNav = [
{
path: DEFAULT_PATHS.blinks,
label: 'common.nav.blinks',
},
{
path: DEFAULT_PATHS.doc,
label: 'common.nav.doc',
Expand All @@ -17,6 +22,10 @@ export const defaultHeaderNav = [
]

export const defaultFooterNav = [
{
path: DEFAULT_PATHS.blinks,
label: 'common.nav.blinks',
},
{
path: DEFAULT_PATHS.doc,
label: 'common.nav.doc',
Expand Down
4 changes: 4 additions & 0 deletions locales/en/blinks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"title": "Solana Blinks",
"description": "Solana の Blockchain Links (通称: Blinks) を使えば、X や Discord など、インターネット上のあらゆる場所でトランザクションを行うことができます。Blinks はウェブサイトやアプリにも簡単に統合可能です。"
}
2 changes: 2 additions & 0 deletions locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"balance": "Balance",
"updated": "Updated!",
"priceDataFromCoingecko": "※ Price data is retrieved from CoinGecko",
"tryBlinks": "Try Solana Blinks",
"CTARow": {
"title": "Join Our Discord Community",
"body": "Stay informed with the latest updates, news, and exclusive insights by joining our official Discord server.",
Expand Down Expand Up @@ -99,6 +100,7 @@
"subtitle2": "This is a demo of the RC version"
},
"nav": {
"blinks": "Solana Blinks",
"doc": "Doc",
"news": "News",
"privacy": "Privacy Policy"
Expand Down
4 changes: 4 additions & 0 deletions locales/ja/blinks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"title": "Solana Blinks",
"description": "With Solana’s Blockchain Links (commonly known as Blinks), you can perform transactions anywhere on the internet, including platforms like X and Discord. Blinks can be easily integrated into websites and apps."
}
2 changes: 2 additions & 0 deletions locales/ja/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"connectYourWallet": "ウォレットを接続してください",
"balance": "残高",
"updated": "更新完了!",
"tryBlinks": "Solana Blinks を試す",
"priceDataFromCoingecko": "※ 価格データは CoinGecko より取得",
"CTARow": {
"title": "Discord コミュニティに参加しましょう",
Expand Down Expand Up @@ -99,6 +100,7 @@
"subtitle2": "こちらは RC バージョンのデモです"
},
"nav": {
"blinks": "Solana Blinks",
"doc": "ドキュメント",
"news": "ニュース",
"privacy": "プライバシーポリシー"
Expand Down
5 changes: 3 additions & 2 deletions routes/[locale]/(default)/(_rows)/HomeHeroRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import {
SOLANA_LOGO_HORIZONTAL,
SOLANA_LOGO_INVERT_HORIZONTAL,
} from '@/components/utils/img.ts'
import { DEFAULT_PATHS } from '@/islands/layouts/default/defaultNavs.ts'

const logos = [
{
Expand Down Expand Up @@ -132,8 +133,8 @@ export default function HomeHeroRow(
{t('common.HomeHeroRow.subtitle2')}
</p>
<div className='flex flex-wrap items-center justify-center gap-3'>
<a href={appInfo.loginUrl}>
<Button>{t('common.aiChat')}</Button>
<a href={DEFAULT_PATHS.blinks}>
<Button>{t('common.tryBlinks')}</Button>
</a>
<a
href={`https://github.com/${appInfo.githubRepo}`}
Expand Down
102 changes: 102 additions & 0 deletions routes/[locale]/(default)/blinks/(_rows)/BlinksHeroRow.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
'use client'

import { cn } from '@/lib/utils.ts'
import { ExtendedState } from '@/utils/state.ts'
import Image from '@/islands/ui/Image.tsx'
import {
lightTextColor,
mainShardGradation,
} from '@/components/utils/tailwinds.ts'
import { createTranslator } from 'fresh-i18n'
import { asset } from 'fresh/runtime'
import {
ICON_OPOS_COMPRESSED_COIL,
SOLANA_BLINKS_IMG,
SOLANA_LOGO_HORIZONTAL,
SOLANA_LOGO_INVERT_HORIZONTAL,
} from '@/components/utils/img.ts'
import { SOLANA_ACTIONS_WEB_LINK } from '@/constants/links.ts'

const logos = [
{
title: 'Solana',
logo: asset(SOLANA_LOGO_HORIZONTAL),
logoInvert: asset(SOLANA_LOGO_INVERT_HORIZONTAL),
href: SOLANA_ACTIONS_WEB_LINK,
},
]

type Props = {
state: ExtendedState
}

export default function BlinksHeroRow(
{ state }: Props,
) {
const t = createTranslator(state.translationData)
console.log('BlinksHeroRow', state)

return (
<>
<div className='relative mx-auto max-w-7xl p-3'>
<div className='absolute left-0 top-0 opacity-20 dark:opacity-40'>
<img
src={asset(ICON_OPOS_COMPRESSED_COIL)}
alt='Background'
className='h-56 w-56 sm:h-64 sm:w-64 md:h-96 md:w-96 lg:h-[512px] lg:w-[512px]'
/>
</div>

<div className='relative mx-auto grid items-center gap-8 py-24 md:grid-cols-2 md:py-48'>
<div className='grid w-full gap-4 p-4'>
<h2
className={cn(
'py-2',
'font-bold tracking-tighter',
'text-5xl sm:text-7xl lg:text-8xl',
mainShardGradation,
)}
>
{t('blinks.title')}
</h2>
<p
className={cn(
'max-w-96 lg:-mt-2',
'font-medium tracking-tight',
'text-lg sm:max-w-lg sm:text-xl lg:max-w-xl lg:text-2xl',
lightTextColor,
)}
>
{t('blinks.description')}
</p>
<div className='mt-4 flex flex-wrap items-center justify-start gap-4'>
{logos.map((item) => (
<a
key={item.title}
href={item.href}
className='hover:opacity-80'
target='_blank'
rel='noopener noreferrer'
>
<Image
lightSrc={item.logo}
darkSrc={item.logoInvert}
alt={item.title}
className='w-20 sm:w-24 md:w-28'
/>
</a>
))}
</div>
</div>
<div className='mx-auto w-full p-4'>
<img
src={asset(SOLANA_BLINKS_IMG)}
alt='Solana Actions & Blinks'
className='w-full'
/>
</div>
</div>
</div>
</>
)
}
27 changes: 27 additions & 0 deletions routes/[locale]/(default)/blinks/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { define } from '@/utils/state.ts'
import { asset } from 'fresh/runtime'
import { page } from 'fresh'
import CTARow from '@/routes/[locale]/(default)/(_rows)/CTARow.tsx'
import ProductsSlideRow from '@/islands/rows/products/ProductsSlideRow.tsx'
import NewsIndexRow from '@/islands/rows/news/NewsIndexRow.tsx'
import BlinksHeroRow from '@/routes/[locale]/(default)/blinks/(_rows)/BlinksHeroRow.tsx'

export const handler = define.handlers({
GET(ctx) {
ctx.state.title = 'blinks.title'
ctx.state.description = 'blinks.description'
ctx.state.ogImage = new URL(asset('/ogp.jpg'), ctx.url).href
return page()
},
})

export default define.page<typeof handler>(function BlinksPage(props) {
return (
<>
<BlinksHeroRow state={props.state} />
<CTARow state={props.state} />
<ProductsSlideRow />
<NewsIndexRow defaultShowCounts={3} />
</>
)
})
Binary file added static/img/icon/solana/SolanaBlinks.webp
Binary file not shown.

0 comments on commit 2ea1709

Please sign in to comment.