Skip to content

Commit

Permalink
ui
Browse files Browse the repository at this point in the history
  • Loading branch information
qinjiangban committed Jun 2, 2024
1 parent 2e33c3b commit 68de96c
Show file tree
Hide file tree
Showing 25 changed files with 269 additions and 164 deletions.
18 changes: 12 additions & 6 deletions app/(Nav)/(home)/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,28 +35,34 @@ export default function Home({ children }) {
}
]
return (
<div className="mx-auto lg:max-w-4xl h-full lg:justify-center pb-12 flex flex-col ">
<div className="mx-auto lg:max-w-4xl lg:justify-center pb-14 flex flex-col ">


<div className="flex flex-row border-l w-[100vw] lg:w-full z-20 h-16 sm:mt-16 items-center ">

<div className="flex flex-row border-x-0 md:border-x w-[100vw] lg:w-full z-20 h-16 md:mt-16 items-center ">
{linknav.map((item) => (
<div className='mx-auto flex-col sm:flex-row justify-around w-[20%] flex 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 text-[#878787] border-r border-b ${pathname === item.href ? 'text-primary border-b border-b-primary' : ''}`}>
<div className=' justify-center text-2xl sm:text-xl z-20'> {item.logo} </div>
<p className="text-sm ml-2 sm:ml-0 text-inherit z-20 text-center sm:text-justify">{item.name}</p>
<Link href={item.href} className={`z-20 flex items-center justify-center w-[100%] h-16 flex-col sm:flex-row text-[#878787] border-b ${pathname === item.href ? 'text-info border-b-2 border-b-info' : ''}`}>
<div className=' justify-center text-2xl sm:text-3xl z-20'> {item.logo} </div>
<p className="text-sm text-inherit z-20 text-center">{item.name}</p>
</Link>

</div>
))}
</div>



<div className=''>

{children}

</div>




</div>
)
}
Expand Down
14 changes: 7 additions & 7 deletions app/(Nav)/(home)/music/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export default function Page() {

return (
<>
<div className="flex flex-1 flex-wrap flex-col max-w-4xl mx-auto">
<div className="flex flex-wrap flex-col justify-normal lg:justify-center lg:w-full w-[100vw]">


{loadingMusicPubs && (
Expand All @@ -86,7 +86,7 @@ export default function Page() {

{musicPubs?.map(publication => (
<div
className="border-b border-l border-r sm:border-r-0 sm:border-l-0 hover:bg-[#6463631a]"
className="md:border border-b border-t-0 hover:bg-[--link-hover-background] w-dvw lg:max-w-4xl py-6 lg:px-6 "
key={publication.id}
onClick={() => router.push(`https://share.lens.xyz/p/${publication.id}`)}
>
Expand All @@ -105,23 +105,23 @@ export default function Page() {


<div>
<ReactMarkdown className=" mt-4 break-words ">
{publication.metadata.content.replace(/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig, '[LINK]($1)')}
</ReactMarkdown>
<img
className={`max-w-[400px] h-auto sm:max-w-[100%] sm:h-auto mb-3 sm:rounded-none rounded-2xl object-cover`}
className={`sm:max-w-[400px] h-auto max-w-[100%] sm:h-auto mb-3 sm:rounded-none rounded-2xl object-cover`}
alt='audio img'
src={publication.__typename === 'Post' ?
publication.metadata?.asset?.cover?.optimized?.uri ?
publication.metadata?.asset?.cover?.optimized?.uri :
publication.metadata?.asset?.cover?.optimized?.raw?.uri : ''}
/>
<audio controls>
<audio controls className={`sm:w-[400px] `}>
<source
type={publication.metadata?.asset?.audio?.optimized?.mimeType}
src={publication.metadata?.asset?.audio?.optimized?.uri}
/>
</audio>
<ReactMarkdown className=" mt-4 break-words ">
{publication.metadata.content.replace(/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig, '[LINK]($1)')}
</ReactMarkdown>
</div>


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


{publications?.map((publication: any) => (
<div key={publication.id} className="md:border sm:border-t-0 border-b border-t-0 hover:bg-[--link-hover-background] w-dvw lg:max-w-4xl py-6 lg:px-6" >
<div key={publication.id} className="md:border border-b border-t-0 hover:bg-[--link-hover-background] w-dvw lg:max-w-4xl py-6 lg:px-6" >

{/* users */}
<div className=" flex px-6 lg:px-0">
Expand Down
2 changes: 1 addition & 1 deletion app/(Nav)/find/page.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Creator from './creator/page'
export default function Page() {
return (
<div className=' sm:mt-16'>
<div className=' md:mt-16'>
<Creator />
</div>
)
Expand Down
6 changes: 4 additions & 2 deletions app/(Nav)/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@

import Nav from '@/components/nav/Navbar'
import Navbar from '@/components/nav/Navbar'
import NavHeader from '@/components/nav/NavHeader'


export default function layout({children}) {
return (
<>
<NavHeader />
{children}
<Nav />
<Navbar />
</>
)
}
8 changes: 8 additions & 0 deletions app/(Nav)/message/chat/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export default function chatpage() {
return (
<div>

聊天
</div>
)
}
7 changes: 7 additions & 0 deletions app/(Nav)/message/community/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export default function communitypage() {
return (
<div>
社区
</div>
)
}
52 changes: 52 additions & 0 deletions app/(Nav)/message/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
'use client'
import ThemeSwap from "@/components/ThemeSwap";
import Link from "next/link";
import { usePathname } from 'next/navigation'
import { RiChat3Line, RiFileTextLine, RiImageLine, RiMusic2Line, RiNotification3Line, RiQuestionAnswerLine, RiShapesLine, RiTeamLine, RiVideoLine } from 'react-icons/ri'
export default function Message({ children }) {
const pathname = usePathname();
return (
<div className='mx-auto max-w-4xl justify-center border-x-0 md:border-x'>



<div className="flex flex-row w-full lg:w-full z-20 h-16 md:mt-16 items-center ">

{linknav.map((item) => (
<div className='mx-auto flex-col sm:flex-row w-1/3 justify-around flex 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 text-[#878787] border-b ${pathname === item.href ? 'text-info border-b-2 border-b-info' : ''}`}>
<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>

</div>
))}

</div>



{children}
</div>
);
}

const linknav = [
{
href: "/message/chat",
name: "聊天",
logo: <RiQuestionAnswerLine />
},
{
href: "/message/community",
name: "社区",
logo: <RiTeamLine />
},
{
href: "/message/notice",
name: "通知",
logo: <RiNotification3Line />
},

]
8 changes: 8 additions & 0 deletions app/(Nav)/message/notice/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export default function noticepage() {
return (
<div>

通知
</div>
)
}
12 changes: 0 additions & 12 deletions app/(Nav)/message/page.jsx

This file was deleted.

2 changes: 1 addition & 1 deletion app/(Nav)/profile/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

export default function page() {
return (
<div className="mx-auto max-w-4xl sm:mt-16 justify-center sm:border-x ">
<div className="mx-auto max-w-4xl md:mt-16 justify-center sm:border-x ">
profile
</div>
)
Expand Down
4 changes: 3 additions & 1 deletion app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
/* UI */
--link-hover-background: rgba(0, 0, 0, 0.03) !important;
--navlink-color: #545353d3 !important;
--navlink-active: #3f1de7,
}

[data-theme='dark'] {
Expand All @@ -19,8 +20,9 @@

/* UI hover */
--link-hover-background: hsla(0, 0%, 100%, 0.04) !important;

--navlink-color: #ece1e1d3 !important;
--navlink-active: #C0E218,

}

body {}
Expand Down
2 changes: 1 addition & 1 deletion app/login/LoginForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default function LoginForm({ owner, onSuccess }: { owner: string; onSucce
{profiles.map((profile, idx) => (
<label
key={profile.id}
className="w-full items-center p-4 rounded-lg cursor-pointer border transition-colors border-gray-300 hover:border-gray-500 grid grid-cols-[24px_auto]"
className=" btn btn-outline"
>
<input
disabled={isLoginPending}
Expand Down
12 changes: 7 additions & 5 deletions app/login/WelcomeToLens.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { SessionType, useSession } from "@lens-protocol/react-web";
import { useAccount as useWagmiAccount } from "wagmi";
import { config } from "@/config/Wagmi";

import { useWeb3Modal } from '@web3modal/wagmi/react'
import ConnectWalletButton from "@/app/login/ConnectWalletButton";
import { DisconnectWalletButton } from "@/app/login/DisconnectWalletButton";
import LoginForm from "@/app/login/LoginForm";
Expand All @@ -16,14 +16,16 @@ import ThemeSwap from "@/components/ThemeSwap";
export function WelcomeToLens() {
const { isConnected, address } = useWagmiAccount({ config });
const { data } = useSession();
const { open, close } = useWeb3Modal()

return (
<div className=" flex justify-center items-center">
<div className=" gap-14 w-dvw">

{!isConnected && (
<div className="flex flex-col justify-center items-center">
<p className="mb-4">连接您的钱包</p>
<div className="flex flex-row justify-center items-center">
{/* <p className="mb-4" onClick={()=>open({ view: 'Networks' })}>连接您的钱包</p> */}

<ConnectWalletButton />
</div>
)}
Expand All @@ -32,7 +34,7 @@ export function WelcomeToLens() {
<>
<p className="">当前连接的钱包: </p>
<div className="mt-2 mb-16 flex-row flex justify-between items-center">
<button className='btn btn-primary'>{truncateEthAddress(address)}</button>
<button className='btn btn-outline' onClick={()=>open({ view: 'Account' })} >{truncateEthAddress(address)}</button>
<DisconnectWalletButton />
</div>

Expand All @@ -43,7 +45,7 @@ export function WelcomeToLens() {
<>
<p className="">当前登入的Lens账号 </p>
<div className="mt-2 flex-row flex justify-between items-center">
<button className='btn btn-primary font-semibold' >{data.profile.handle?.fullHandle ?? data.profile.id}
<button className='btn btn-outline btn-primary font-semibold' >{data.profile.handle?.fullHandle ?? data.profile.id}
</button>
<LogoutButton />
</div>
Expand Down
Loading

0 comments on commit 68de96c

Please sign in to comment.