Skip to content

Commit

Permalink
11/14
Browse files Browse the repository at this point in the history
  • Loading branch information
qinjiangban committed Nov 13, 2024
1 parent 88b09a3 commit 9b064b0
Show file tree
Hide file tree
Showing 67 changed files with 338 additions and 259 deletions.
2 changes: 1 addition & 1 deletion app/(Nav)/home/_contexts/ButtonList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default function ButtonList() {
</Link>
</div> */}
{pathname === '/home/foryou' || pathname === '/home/following' ? '' :
<div className=" flex md:flex-row z-20 h-12 items-center bg-base-100 overflow-y-auto ">
<div className=" flex md:flex-row z-20 h-10 items-center bg-base-100 overflow-y-auto ">
{orderOptions.map((option) => (
<div className='m-1 ' key={option.key}>
<button
Expand Down
8 changes: 4 additions & 4 deletions app/(Nav)/home/article/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default function Page() {
where: {
publicationTypes: [ExplorePublicationType.Post],
metadata: {
mainContentFocus: [PublicationMetadataMainFocusType.TextOnly,PublicationMetadataMainFocusType.Article,PublicationMetadataMainFocusType.Story]
mainContentFocus: [PublicationMetadataMainFocusType.TextOnly, PublicationMetadataMainFocusType.Article, PublicationMetadataMainFocusType.Story]
}
}
})) as any
Expand All @@ -56,12 +56,12 @@ export default function Page() {
<div className="flex flex-wrap flex-col justify-normal lg:justify-center lg:w-full w-[100vw]">


{loadingMusicPubs && <LoadingSpinner /> }
{loadingMusicPubs && <LoadingSpinner />}


{musicPubs?.map(mpub => (
<div
className="bg-base-100 hover:bg-[--link-hover-background] w-dvw lg:max-w-4xl p-4 py-2 mt-2 "
className="bg-base-100 hover:bg-[--link-hover-background] w-dvw md: p-4 py-2 mt-2 "
key={mpub.id}
/* onClick={() => router.push(`https://share.lens.xyz/p/${mpub.id}`)} */
>
Expand All @@ -74,7 +74,7 @@ export default function Page() {
/>
<AvatarName
localName={mpub.by && mpub.by.handle ? mpub.by.handle.localName : mpub.by.id}
displayName={mpub.by?.metadata?.displayName}
displayName={mpub.by?.metadata?.displayName}
namespace={mpub.by && mpub.by.handle ? mpub.by.handle.namespace : ''}
id={mpub}
createdAt={mpub.createdAt} />
Expand Down
6 changes: 3 additions & 3 deletions app/(Nav)/home/following/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ export default function page() {


return (
<div className="flex flex-wrap flex-col justify-normal lg:justify-center lg:w-full w-[100vw]">
{loading && <LoadingSpinner /> }
<div className="flex flex-wrap flex-col justify-normal lg:justify-center lg:w-full w-dvw">
{loading && <LoadingSpinner />}
{data?.map((pub) => (
<div className=" bg-base-100 hover:bg-[--link-hover-background] w-dvw lg:max-w-4xl p-4 py-2 mt-2" key={`${pub.root.id}`}>
<div className=" bg-base-100 hover:bg-[--link-hover-background] w-dvw max-w-3xl lg:p-4 py-2 mt-2" key={`${pub.root.id}`}>


{/* 帖子主内容 */}
Expand Down
4 changes: 2 additions & 2 deletions app/(Nav)/home/foryou/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default function page() {
);
}
if (sesssion && sesssion.type === SessionType.WithProfile) {
const { data, loading,hasMore, observeRef } = useInfiniteScroll(useFeedHighlights({
const { data, loading, hasMore, observeRef } = useInfiniteScroll(useFeedHighlights({

where: {
for: profileId(sesssion.profile.id)
Expand All @@ -38,7 +38,7 @@ export default function page() {
<div className="flex flex-wrap flex-col justify-normal lg:justify-center lg:w-full w-[100vw]">
{loading && <LoadingSpinner />}
{data?.map((pub, idx) => (
<div className=" bg-base-100 hover:bg-[--link-hover-background] w-dvw lg:max-w-4xl p-4 py-2 mt-2" key={`${pub.id}-${idx}`}>
<div className=" bg-base-100 hover:bg-[--link-hover-background] w-dvw max-w-3xl lg:p-4 py-2 mt-2" key={`${pub.id}-${idx}`}>


{/* 帖子主内容 */}
Expand Down
2 changes: 1 addition & 1 deletion app/(Nav)/home/image/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export default function Page() {

{musicPubs?.map(mpub => (
<div
className="bg-base-100 hover:bg-[--link-hover-background] w-dvw lg:max-w-4xl p-4 py-2 mt-2 "
className="bg-base-100 hover:bg-[--link-hover-background] w-dvw lg:max-w-3xl p-4 py-2 mt-2 "
key={mpub.id}
/* onClick={() => router.push(`https://share.lens.xyz/p/${mpub.id}`)} */
>
Expand Down
97 changes: 75 additions & 22 deletions app/(Nav)/home/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
'use client'
import Link from 'next/link'
import { usePathname } from 'next/navigation'
import { RiBardLine, RiFileTextLine, RiImageLine, RiMusic2Line, RiShapesLine, RiUserFollowLine, RiVideoLine } from 'react-icons/ri'
import { usePathname, useRouter } from 'next/navigation'
import { RiBardLine, RiFileTextLine, RiImageLine, RiMenuLine, RiMusic2Line, RiSearchLine, RiShapesLine, RiUserFollowLine, RiVideoLine } from 'react-icons/ri'
import { OrderByProvider } from './_contexts/OrderByContext';
import ButtonList from './_contexts/ButtonList';
import CreatePos from '@/components/lnes/PosCreate/CreatePos';
import { useState } from 'react';
import Image from "next/image";
import { motion } from 'framer-motion';


export default function HomeLayout({ children }) {
const pathname = usePathname();

const router = useRouter();
const linknav = [
{
href: "/home/following",
name: "关注",
logo: <RiUserFollowLine />
},
{
href: "/home/foryou",
name: "给你",
logo: <RiBardLine />
logo: <RiBardLine />
},
{
href: "/home/following",
name: "关注",
logo: <RiUserFollowLine />
},
{
href: "/home",
Expand Down Expand Up @@ -47,16 +51,32 @@ export default function HomeLayout({ children }) {
}
]
return (
<div className="mx-auto max-w-4xl lg:justify-center pb-14 flex flex-col ">


<div className="mx-auto max-w-3xl lg:justify-center pb-14 flex flex-col ">

<div className=" fixed md:hidden flex flex-row w-full max-w-3xl z-50 h-12 items-center ">
<div className="navbar w-full min-h-12 p-0 px-2 bg-base-100 z-50">
<div className="navbar-start gap-1"></div>
<div className="navbar-center">
<Link href={`/`} >
<motion.div whileHover={{ scale: 1.05 }} whileTap={{ scale: 0.95 }}>
<img src='/favicon.ico' className="w-8 h-8 rounded-full " alt='Coolha' />
</motion.div>
</Link>
</div>
<div className="navbar-end">
<button className="btn btn-square btn-ghost" onClick={() => router.push(`/search`)}>
<RiSearchLine className="w-6 h-6 " />
</button>
</div>
</div>
</div>

{/* 类型 */}
<div className="flex flex-row w-full max-w-4xl z-20 h-8 xs:h-16 items-center">
{linknav.map((item) => (
<div className='mx-auto flex-col sm:flex-row justify-around w-[20%] flex z-20 ' key={item.href}>
<div className="flex flex-row-reverse w-full max-w-3xl z-40 h-10 md:h-12 mt-12 md:mt-0 items-center ">
{linknav.slice(0, 3).map((item) => (
<div className='mx-auto w-1/3 z-20 flex flex-row-reverse ' key={item.href}>

<Link href={item.href} className={`z-20 flex items-center justify-center w-[100%] h-8 xs:h-16 flex-col sm:flex-row text-[#878787] border-b-0 bg-base-100 hover:bg-[--link-hover-background] ${pathname === item.href ? 'text-info border-b-info border-b-2' : ''}`}>
<Link href={item.href} className={`z-20 flex flex-row items-center justify-center w-full h-10 md:h-12 text-[#878787] border-b-0 bg-base-100 hover:bg-[--link-hover-background] ${pathname === item.href ? 'text-info border-b-info border-b-2' : ''}`}>
<div className=' justify-center text-base xs:text-2xl sm:text-3xl z-20'> {item.logo} </div>
<p className="text-sm text-inherit z-20 text-center md:text-base md:ml-1 hidden xs:flex ">{item.name}</p>
</Link>
Expand All @@ -65,16 +85,49 @@ export default function HomeLayout({ children }) {
))}
</div>

{/* 小屏幕显示的菜单按钮 */}
{/* <div className=" lg:hidden flex-row max-w-3xl h-8 xs:h-16 items-center ">
<button
className="lg:hidden bg-base-100 text-info p-2 rounded-full"
onClick={() => setSidebarOpen(!sidebarOpen)}
>
<RiMenuLine className="text-2xl" />
</button>
</div>
<div className=''>
<OrderByProvider>
<ButtonList />
{children}
</OrderByProvider>
</div>
<aside id="logo-sidebar" aria-label="Sidebar"
className={`fixed top-16 left-0 z-40 h-screen transition-transform lg:translate-x-0 ${sidebarOpen ? 'translate-x-0' : '-translate-x-full '} `}>
<div className="h-full xl:px-1 py-2 overflow-y-auto bg-base-100 ">
<ul className=" menu">
{linknav.map((item) => (
<li key={item.href}>
<Link
href={item.href}
onClick={() => setSidebarOpen(false)} // 点击后自动关闭侧边栏
className={`flex items-center my-1 flex-col sm:flex-row text-[#878787] ${pathname === item.href ? 'text-primary' : ''}`}
>
<div className=' justify-center text-base xs:text-2xl sm:text-3xl z-20'> {item.logo} </div>
<span className=" hidden lg:flex text-sm text-inherit z-20 text-center md:text-base md:ml-1 ">{item.name}</span>
</Link>
</li>
))}
</ul>
</div>
</aside> */}



<OrderByProvider>
<ButtonList />
<div className='w-full'>
{children}
</div>
</OrderByProvider>
{/* <CreatePos /> */}


</div>
Expand Down
2 changes: 1 addition & 1 deletion app/(Nav)/home/music/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export default function Page() {

{musicPubs?.map(mpub => (
<div
className="bg-base-100 hover:bg-[--link-hover-background] w-dvw lg:max-w-4xl p-4 py-2 mt-2 "
className="bg-base-100 hover:bg-[--link-hover-background] w-dvw lg:max-w-3xl p-4 py-2 mt-2 "
key={mpub.id}

>
Expand Down
4 changes: 2 additions & 2 deletions app/(Nav)/home/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ export default function Page() {



<div className="flex flex-wrap flex-col justify-normal">
<div className="flex flex-wrap flex-col justify-normal lg:justify-center lg:w-full w-dvw">
{loadingPubs && <LoadingSpinner /> }

{publications?.map((pub: any) => (
<div className=" bg-base-100 hover:bg-[--link-hover-background] md:max-w-4xl p-4 py-2 mt-2" key={pub.id}>
<div className=" bg-base-100 hover:bg-[--link-hover-background] w-dvw md:max-w-3xl p-4 py-2 mt-2" key={pub.id}>
{/* 帖子主内容 */}
<div className=" flex ">
<div className="flex " onClick={(e) => e.stopPropagation()}>
Expand Down
2 changes: 1 addition & 1 deletion app/(Nav)/home/video/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export default function Page() {

{musicPubs?.map(mpub => (
<div
className=" bg-base-100 hover:bg-[--link-hover-background] w-dvw lg:max-w-4xl p-4 py-2 mt-2"
className=" bg-base-100 hover:bg-[--link-hover-background] w-dvw lg:max-w-3xl p-4 py-2 mt-2"
key={mpub.id}
/* onClick={() => router.push(`https://share.lens.xyz/p/${mpub.id}`)} */
>
Expand Down
2 changes: 1 addition & 1 deletion app/(Nav)/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default function layout({ children }) {
<Header />
<div className="h-0 md:h-16" />
<NavHeader />
<div className='mx-auto max-w-4xl min-h-[calc(100dvh-4rem)] flex-1 justify-center'>
<div className='mx-auto max-w-3xl min-h-[calc(100dvh-4rem)] flex-1 justify-center'>
{children}
</div>
<Navbar />
Expand Down
8 changes: 4 additions & 4 deletions app/(Nav)/message/chat/[chatid]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ export default function page() {
</div>
</div>
<div className="chat-header">
Lens
{/* <span className=" text-base-content/70">Lens</span> */}
<time className="text-xs opacity-50 ml-2">12:45</time>
</div>
<div className="chat-bubble chat-bubble-info text-black">You were the Chosen One!</div>
<div className="chat-bubble chat-bubble-accent text-base-content">You were the Chosen One!You were the Chosen One!You were the Chosen One!You were the Chosen One!You were the Chosen One!You were the Chosen One!You were the Chosen One!You were the Chosen One!</div>
{/* <div className="chat-footer opacity-50">Delivered</div> */}
</div>

Expand All @@ -31,10 +31,10 @@ export default function page() {
</div>
</div>
<div className="chat-header">
Coolha
{/* <span className=" text-base-content/70">Coolha</span> */}
<time className="text-xs opacity-50 ml-2">12:46</time>
</div>
<div className="chat-bubble chat-bubble-info text-black">I Love you!</div>
<div className="chat-bubble chat-bubble-accent text-base-content">I Love you!</div>
{/* <div className="chat-footer opacity-50">Seen at 12:46</div> */}
</div>

Expand Down
6 changes: 3 additions & 3 deletions app/(Nav)/message/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ export default function Message({ children }) {


{shouldDisplayNav &&
<div className="flex flex-row w-full lg:w-full z-20 h-16 items-center ">
<div className="flex flex-row w-full z-20 h-12 items-center ">

{linknav.map((item) => (
<div className='mx-auto flex-col sm:flex-row w-1/3 justify-around flex border-b bg-base-100 hover:bg-[--link-hover-background] z-20' key={item.href}>
<div className='mx-auto max-w-3xl flex-row w-1/3 justify-around flex border-b bg-base-100 hover:bg-[--link-hover-background] z-20' key={item.href}>

<Link href={item.href} className={`z-20 flex items-center justify-center w-[100%] h-16 flex-col sm:flex-row border-b text-[#878787] ${pathname === item.href ? 'text-info border-b-info border-b-2' : ''}`}>
<Link href={item.href} className={`z-20 flex items-center justify-center w-[100%] h-12 flex-row border-b text-[#878787] ${pathname === item.href ? 'text-info border-b-info border-b-2' : ''}`}>
<div className=' justify-center text-2xl sm:text-2xl z-20'> {item.logo} </div>
<p className="text-sm text-inherit z-20 text-center">{item.name}</p>
</Link>
Expand Down
4 changes: 2 additions & 2 deletions app/(Nav)/profile/(Tabs)/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default function layout({ children }) {
return (
<div className='bg-base-200'>

<div className="max-w-4xl lg:min-w-4xl mx-auto w-full h-full bg-base-100">
<div className=" lg:min-w-4xl mx-auto w-full h-full bg-base-100">
<div className="navbar py-0 ">
<div className=" navbar-start">
<button className="btn btn-square btn-ghost" onClick={handleBack} >
Expand All @@ -30,7 +30,7 @@ export default function layout({ children }) {

<Header />

<div className='mx-auto max-w-4xl min-h-[calc(100dvh-4rem)] flex-1 justify-center'>
<div className='mx-auto min-h-[calc(100dvh-4rem)] flex-1 justify-center'>
{children}
</div>

Expand Down
16 changes: 8 additions & 8 deletions app/(Nav)/profile/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import Link from 'next/link';
import { SessionType, useProfile, useSession } from "@lens-protocol/react-web";
import { truncateEthAddress } from '@/utils/truncateEthAddress';
import { RiBarChart2Line, RiPuzzleLine, RiVerifiedBadgeLine, RiVerifiedBadgeFill, RiMedalLine, RiUserVoiceLine, RiBookmarkLine, RiServiceLine, RiWallet3Line } from "react-icons/ri";
import { RiBarChart2Line, RiPuzzleLine, RiVerifiedBadgeLine, RiVerifiedBadgeFill, RiMedalLine, RiUserVoiceLine, RiBookmarkLine, RiServiceLine, RiWallet3Line, RiGiftLine } from "react-icons/ri";


export default function page() {
Expand Down Expand Up @@ -118,16 +118,16 @@ function UsersMetadata({ profile }) {
function Card() {
const assetData = [
{ label: '资产', href: '/wallet', icon: RiWallet3Line, },
{ label: '会员', href: '/a', icon: RiVerifiedBadgeLine, },
{ label: '成就等级', href: '/profile/grade', icon: RiMedalLine, },
{ label: '数据分析', href: '/profile/analyse', icon: RiBarChart2Line, },
{ label: '我的书签', href: '/profile/bookmarks', icon: RiBookmarkLine, },
{ label: '会员', href: '/vip', icon: RiVerifiedBadgeLine, },
{ label: '成就等级', href: '/grade', icon: RiMedalLine, },
{ label: '数据分析', href: '/analyse', icon: RiBarChart2Line, },
{ label: '我的书签', href: '/bookmarks', icon: RiBookmarkLine, },
];

const userData = [
{ label: '扩展功能', href: '/profile/extend', icon: RiPuzzleLine, },
{ label: '测试奖励', href: '/mintNFT', icon: RiServiceLine, },
{ label: '邀请用户', href: '/profile/invite', icon: RiUserVoiceLine, },
{ label: '扩展功能', href: '/extend', icon: RiPuzzleLine, },
{ label: '邀请用户', href: '/invite', icon: RiUserVoiceLine, },
{ label: '测试奖励', href: '/mintNFT', icon: RiGiftLine, },
];

return (
Expand Down
9 changes: 9 additions & 0 deletions app/(Router)/(a)/analyse/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
'use client'

export default function page() {
return (
<>
analyse
</>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default function page() {
<>
{data?.map((pub: any) => (
<>
<div className=" bg-base-100 hover:bg-[--link-hover-background] w-dvw lg:max-w-4xl p-4 py-2 mt-2" key={pub.id}>
<div className=" bg-base-100 hover:bg-[--link-hover-background] w-dvw lg: p-4 py-2 mt-2" key={pub.id}>
{/* 帖子主内容 */}
<div className=" flex ">
<div className="flex " onClick={(e) => e.stopPropagation()}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
export default function page() {
return (
<>
page
grade
</>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
export default function page() {
return (
<>
page
vip
</>
)
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 9b064b0

Please sign in to comment.