Skip to content

Commit

Permalink
Merge branch 'feat/optimize-whale' into canary
Browse files Browse the repository at this point in the history
  • Loading branch information
linxin committed Nov 10, 2023
2 parents 70bd53f + d538ece commit 6cb5e85
Show file tree
Hide file tree
Showing 17 changed files with 251 additions and 122 deletions.
1 change: 1 addition & 0 deletions components/dropdown/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import styles from './index.module.scss'
import Icon from '../icon'

type IItem = {
rawValue?: boolean
children?: any
label: string
shortLabel?: string | React.ReactNode
Expand Down
11 changes: 9 additions & 2 deletions components/locale-link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { useTranslation } from 'next-i18next'
import { useEffect, useState } from 'react'

// @ts-ignore
export const LocaleLink = (props: { to?: string; children?: any; pageUrl?: string; [key: string]: any }) => {
const { to, children, pageUrl, ...other } = props
export const LocaleLink = (props: { to?: string; children?: any; pageUrl?: string; rawValue?: boolean;[key: string]: any }) => {
const { to, children, pageUrl , rawValue, ...other } = props
const { i18n } = useTranslation('common')
const localePrefix = i18n.language === 'zh-HK' ? '' : `/${i18n.language}`
const [pageUrlLink, setPageUrlLink] = useState('')
Expand All @@ -24,6 +24,13 @@ export const LocaleLink = (props: { to?: string; children?: any; pageUrl?: strin
)
}

if (rawValue) {
return (
<a href={`${to}`} target="_blank" rel="noreferrer" {...other}>
{children}
</a>
)
}
return (
<a href={pageUrlLink} target="_self">
{children}
Expand Down
29 changes: 19 additions & 10 deletions features/block/top-banner.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Block, BlockBetween, BlockHeader, TopBlock } from '@/components/block'
import DivideDot from '@/components/divide-dot'
import { TalkToUs } from '@/features/talk-to-us'
import { TalkToUs, ContactUs } from '@/features/talk-to-us'
import { LocaleLink } from '@/components/locale-link'
import Button from '@/components/button'
import { Carousel } from 'antd'
Expand Down Expand Up @@ -82,13 +82,13 @@ export const WhiteLabelBanner = ({ img }: { img: string }) => {
export const IndexBanner = () => {
const i18n = useTranslation('common')
const isEn = i18n.i18n.language === 'en'
const bannerMap:any = {
const bannerMap: any = {
'en': 'https://pub.lbkrs.com/files/202307/Nk95eVCroahcrRaP/HOME-BANNER-EN.png',
'zh-CN': 'https://pub.lbkrs.com/files/202307/sJXSzDtouVe9vH3E/HOME-BANNER-CN.png',
'zh-HK': 'https://pub.lbkrs.com/files/202307/9sSnVNABHuv6VARt/HOME-BANNER-HK.png'
'zh-HK': 'https://pub.lbkrs.com/files/202307/9sSnVNABHuv6VARt/HOME-BANNER-HK.png',
}
return (
<Carousel className="bg-cover" autoplay effect="fade">
<Carousel className="bg-cover" effect="fade">
<TopBlock className="bg-repeat-round bg-[#0B0550] relative">
<Block>
<BlockBetween
Expand All @@ -100,9 +100,12 @@ export const IndexBanner = () => {
<div className="text-white text-[54px] leading-[68px]text-left">
<div>{i18n.t('home_top_banner_text_2')}</div>
</div>
<LocaleLink className="flex items-center mt-10" to={'/solutions/virtual-assets'}>
<Button size="medium">{i18n.t('features_solutions_info_introduce_891112')}</Button>
</LocaleLink>
<div className="flex space-x-4">
<LocaleLink className="flex items-center mt-10" to={'/solutions/virtual-assets'}>
<Button size="medium">{i18n.t('features_solutions_info_introduce_891112')}</Button>
</LocaleLink>
<ContactUs />
</div>
</>
}
right={
Expand All @@ -129,9 +132,12 @@ export const IndexBanner = () => {
<div className="text-white text-[48px] leading-[68px] text-left">
<div>{i18n.t('pages_locale_product_portai_891116')}</div>
</div>
<LocaleLink className="flex items-center mt-10" to="/portai">
<Button size="medium">{i18n.t('features_solutions_info_introduce_891112')}</Button>
</LocaleLink>
<div className="flex space-x-4">
<LocaleLink className="flex items-center mt-10" to="/portai">
<Button size="medium">{i18n.t('features_solutions_info_introduce_891112')}</Button>
</LocaleLink>
<ContactUs />
</div>
</>
}
right={
Expand All @@ -156,6 +162,9 @@ export const IndexBanner = () => {
<span>{i18n.t('features_block_top_banner_891147')}</span>
</div>
<p className="mt-4 text-lg xl:mt-6 xl:text-xl">{i18n.t('features_block_top_banner_891148')}</p>
<div className="flex">
<ContactUs />
</div>
</>
}
right={
Expand Down
4 changes: 2 additions & 2 deletions features/common/card-swiper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ const CardSwiper = (props: IProps) => {
? dataSource.map((item, index) => {
return (
<div key={index}>
<ImageAndText {...item.contentInfo} />
<ImageAndText {...item.contentInfo} needContact />
{!!item?.footerList?.length ? (
<>
<hr className="border-border_color" />
<div className="flex justify-between mt-10 flex-wrap gap-y-5">
<div className="flex flex-wrap justify-between mt-10 gap-y-5">
{item.footerList.map((it, i) => {
return (
<div className="w-[100%] min-w-[250px] sm:w-[40%] md:w-[40%] lg:w-[19%]" key={i}>
Expand Down
123 changes: 81 additions & 42 deletions features/footer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,34 @@ const Footer: FC = () => {
return { emailList, telList }
}, [])

const { frontSell, sellEnd } = useMemo(() => {
const frontSell = [
{
label: i18n.t('features_footer_index_891117'),
value: '+852 3851 1713',
type: 'tel:',
},
{
label: i18n.t('features_footer_index_891118'),
value: '[email protected]',
type: 'mailto:',
},
]
const sellEnd = [
{
label: i18n.t('features_footer_index_891117'),
value: '+852 3851 1712',
type: 'tel:',
},
{
label: i18n.t('features_footer_index_891118'),
value: '[email protected]',
type: 'mailto:',
},
]
return { frontSell, sellEnd }
}, [])

const fetchLegalTerms = async () => {
const key = 'legal_terms'
const data = await getSupportLinks()
Expand All @@ -80,59 +108,70 @@ const Footer: FC = () => {
return (
<footer className={classNames(styles.footer, 'main-container')}>
<div className={classNames('main-content-width')}>
<div className="text-text_color_1_supplement text-2xl font-semibold">{i18n.t('features_footer_index_891113')}</div>
<div className="text-text_color_2 text-base mt-2">{i18n.t('features_footer_index_891114')}</div>
<div className="flex items-end justify-between mt-4 sm:mt-10 flex-wrap">
<div className="flex gap-x-24 gap-y-4 sm:gap-y-8 flex-wrap">
<div className="flex flex-col">
<span className="text-sm">{i18n.t('footer_004')}</span>
<div className="flex">
{telList.map(({ value }) => (
<a className="mt-2 font-medium whitespace-nowrap mr-6" href={`tel:${value}`} key={value}>
<div className="flex flex-col space-y-10 md:flex-row md:space-x-10 xl:space-x-40 md:space-y-0">
<div className="text-2xl font-semibold text-text_color_1_supplement">{i18n.t('talk-to-us')}</div>
<div className="flex flex-col flex-1 space-y-10 md:justify-between md:flex-row md:space-y-0">
<div className="">
<div className="text-sm font-medium text-text_color_1_supplement">
{i18n.t('features_footer_index_891119')}
</div>
<div className="mt-1 mb-4 text-xs text-text_color_2">
<div>{i18n.t('features_talk_to_us_891118')}</div>
<div>{i18n.t('features_talk_to_us_891119')}</div>
<div>{i18n.t('features_talk_to_us_891120')}</div>
</div>
<div className="flex flex-col space-y-3">
{frontSell.map(({ label, value, type }) => (
<a className="mt-2 mr-6 text-xs font-normal whitespace-nowrap" href={`${type}${value}`} key={value}>
{label}
{value}
</a>
))}
</div>
</div>
<div className="flex flex-col">
<span className="text-sm">{i18n.t('footer_003')}</span>
<div className="flex flex-wrap">
{emailList.map(({ label, value }) => (
<div key={value} className="flex flex-wrap mt-2 mr-6 flex-nowrap">
<span className="mr-2">{label}:</span>
<a className=" font-medium" href={`mailto:${value}`}>
{value}
</a>
</div>
<div className="">
<div className="text-sm font-medium text-text_color_1_supplement">
{i18n.t('features_footer_index_891121')}
</div>
<div className="mt-1 mb-4 text-xs text-text_color_2">
<div>{i18n.t('features_talk_to_us_891122')}</div>
<div>{i18n.t('features_talk_to_us_891123')}</div>
</div>
<div className="flex flex-col space-y-3">
{sellEnd.map(({ label, value, type }) => (
<a className="mt-2 mr-6 text-xs font-normal whitespace-nowrap" href={`${type}${value}`} key={value}>
{label}
{value}
</a>
))}
</div>
</div>
</div>
{
false && <div>
{
socials.map(({ icon, href }) => {
return (
<a className="inline-block w-5 ml-7 first:ml-0" href={href} key={href}>
<img src={icon} alt="" />
</a>
)
})
}
<div className="">
<div className="mb-1 text-sm font-medium text-text_color_1_supplement">
{i18n.t('features_footer_index_891123')}
</div>
<div>
<a href="https://www.linkedin.com/company/longbridgewhale" target="_blank" rel="noreferrer">
<img className="h-5" alt="" src="https://pub.lbkrs.com/files/202307/dgDMvF2uhbvCAkUf/linkin.svg" />
</a>
</div>
</div>
<div className="">
<div className="mb-1 text-sm font-medium text-text_color_1_supplement">
{i18n.t('features_footer_index_891124')}
</div>
<div>
<img
src="https://assets.lbkrs.com/uploads/ca78ddab-b8a5-4ae8-881b-e08b4a8df37f/whale-official.png"
alt=""
className="w-24"
/>
</div>
</div>
}
<div className='flex mt-4 sm:mt-10 justify-end'>
<a href='https://www.linkedin.com/company/longbridgewhale' target='_blank'>
<img className='h-5' src="https://pub.lbkrs.com/files/202307/dgDMvF2uhbvCAkUf/linkin.svg" />
</a>
<Popover content={<div>
<img src="https://pub.lbkrs.com/files/202307/P5kvx1NsfPmWfqVZ/qrcode.svg" alt="" />
<div className='w-[110px] text-center text-xs text-text_color_2'>Longbridge Whale 公众号</div>
</div>}>
<img className='h-5 ml-6' src="https://assets.lbkrs.com/uploads/b2a6886f-9fdd-4353-a703-c4d19ecb7881/wechat.png" />
</Popover>
</div>
</div>
</div>
<div className={classNames('main-content-width')}>
<hr className="mt-6 border-[#EAEBEC]"></hr>
<div className="flex items-center justify-between mt-6">
<div className="text-xs text-text_color_3_supplement">
Expand Down
27 changes: 22 additions & 5 deletions features/header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { LocaleLink } from '@/components/locale-link'
import { useLocaleNavigate } from '@/hooks/use-locale-navigate'
import { usePurePathname } from '@/hooks/use-pure-pathname'
import { useReports } from '@/hooks/use-reports'
import { getContactFormUrl } from '@/utils/common'
import classNames from 'classnames'
import { t } from 'i18next'
import { FC, MouseEvent, useMemo, useState } from 'react'
Expand Down Expand Up @@ -86,7 +87,7 @@ function useNavs() {
},
{
value: '/solutions/virtual-assets',
label: i18n.t('features_header_index_891113')
label: i18n.t('features_header_index_891113'),
},
// {
// value: '/solutions',
Expand Down Expand Up @@ -123,6 +124,13 @@ function useNavs() {
label: i18n.t('header_nav_007'),
children: [],
},
{
value: getContactFormUrl(i18n.i18n.language),
suffix: '',
label: i18n.t('talk-to-us'),
children: [],
rawValue: true,
},
{
value: '/whale-reports',
suffix: '',
Expand Down Expand Up @@ -182,7 +190,11 @@ const Navs = () => {
items={nav.children}
renderItem={item => {
return (
<LocaleLink to={item.value as string} className="hover:text-white">
<LocaleLink
to={item.value as string}
rawValue={item.rawValue as boolean}
className="hover:text-white"
>
{item.label}
</LocaleLink>
)
Expand All @@ -202,7 +214,12 @@ const Navs = () => {
</Dropdown>
)}
{nav.children.length === 0 && (
<LocaleLink className="flex items-center hover:text-brand_color" to={nav.value} pageUrl={nav.pageUrl}>
<LocaleLink
className="flex items-center hover:text-brand_color"
to={nav.value}
rawValue={nav.rawValue}
pageUrl={nav.pageUrl}
>
<span>{nav.label}</span>
{nav.suffix && <span className="ml-2">{nav.suffix}</span>}
</LocaleLink>
Expand Down Expand Up @@ -236,15 +253,15 @@ const Navs = () => {
{expandKeys.includes(String(item.value)) && (
<div className="flex flex-col xl:pl-2">
{item?.children?.map((i: any) => (
<LocaleLink to={i.value as string} key={i.label} className="py-3">
<LocaleLink to={i.value as string} rawValue={i.rawValue} key={i.label} className="py-3">
{i.label}
</LocaleLink>
))}
</div>
)}
</div>
) : (
<LocaleLink to={item.value as string} key={item.label}>
<LocaleLink to={item.value as string} rawValue={item.rawValue} key={item.label}>
{item.label}
</LocaleLink>
)
Expand Down
2 changes: 1 addition & 1 deletion features/home/home-combination.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const HomeCombination = () => {

return (
<Box>
<ImageAndText {...contentInfo} />
<ImageAndText {...contentInfo} needTalk={false} needContact />
</Box>
)
}
Expand Down
6 changes: 3 additions & 3 deletions features/product/Banner.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import { useTranslation } from 'react-i18next'
import { CDN_IMAGES } from '@/constants'
import { TalkToUs } from '../talk-to-us'
import { TalkToUs, ContactUs } from '../talk-to-us'
import ExperienceDemo from '../experience-demo'
import classnames from 'classnames'
interface Props {
Expand Down Expand Up @@ -63,8 +63,8 @@ export const NewBanner: React.FC<Props> = props => {
})}
</div>
<div className="flex mt-6 space-x-5">
<TalkToUs className="h-10 mt-0" />
<ExperienceDemo className="h-[40px] mt-0" />
<ContactUs className="h-10 mt-0" />
{/* <ExperienceDemo className="h-[40px] mt-0" /> */}
</div>
</div>
</div>
Expand Down
Loading

0 comments on commit 6cb5e85

Please sign in to comment.