-
-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
234 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
'use client'; | ||
|
||
import { useRouter } from 'next/navigation'; | ||
import { useEffect } from 'react'; | ||
|
||
const Redirect = () => { | ||
const router = useRouter(); | ||
|
||
useEffect(() => { | ||
// const hasData = localStorage.getItem('V_IDOL_WELCOME'); | ||
// if (hasData) { | ||
router.push('/my/agent'); | ||
// } else { | ||
// router.push('/welcome'); | ||
// } | ||
}, []); | ||
|
||
return null; | ||
}; | ||
|
||
export default Redirect; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import { Icon, List } from '@lobehub/ui'; | ||
import { createStyles, useResponsive } from 'antd-style'; | ||
import { ChevronRight, type LucideIcon } from 'lucide-react'; | ||
import { CSSProperties, ReactNode, memo } from 'react'; | ||
|
||
const { Item } = List; | ||
|
||
const useStyles = createStyles(({ css, token, responsive }) => ({ | ||
container: css` | ||
position: relative; | ||
padding-top: 16px; | ||
padding-bottom: 16px; | ||
border-radius: ${token.borderRadius}px; | ||
${responsive.mobile} { | ||
border-radius: 0; | ||
} | ||
`, | ||
noHover: css` | ||
pointer-events: none; | ||
`, | ||
})); | ||
|
||
export interface ItemProps { | ||
active?: boolean; | ||
className?: string; | ||
hoverable?: boolean; | ||
icon: LucideIcon; | ||
label: ReactNode; | ||
style?: CSSProperties; | ||
} | ||
|
||
const SettingItem = memo<ItemProps>( | ||
({ label, icon, hoverable = true, active = false, style, className }) => { | ||
const { cx, styles } = useStyles(); | ||
const { mobile } = useResponsive(); | ||
return ( | ||
<Item | ||
active={active} | ||
avatar={<Icon icon={icon} size={{ fontSize: 20 }} />} | ||
className={cx(styles.container, !hoverable && styles.noHover, className)} | ||
style={style} | ||
title={label as string} | ||
> | ||
{mobile && <Icon icon={ChevronRight} size={{ fontSize: 16 }} />} | ||
</Item> | ||
); | ||
}, | ||
); | ||
|
||
export default SettingItem; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { Bot, Mic2 } from 'lucide-react'; | ||
import Link from 'next/link'; | ||
import { memo } from 'react'; | ||
|
||
import { MyTabs } from '../type'; | ||
import Item from './Item'; | ||
|
||
export interface MyListProps { | ||
activeTab?: MyTabs; | ||
mobile?: boolean; | ||
} | ||
|
||
const MyList = memo<MyListProps>(({ activeTab, mobile }) => { | ||
const items = [ | ||
{ icon: Bot, label: '我的角色', value: MyTabs.Agent }, | ||
{ icon: Mic2, label: '我的舞蹈', value: MyTabs.Dance }, | ||
]; | ||
|
||
return items.map(({ value, icon, label }) => ( | ||
<Link aria-label={label} href={`/my/${value}`} key={value}> | ||
<Item | ||
active={mobile ? false : activeTab === value} | ||
hoverable={!mobile} | ||
icon={icon} | ||
label={label} | ||
/> | ||
</Link> | ||
)); | ||
}); | ||
|
||
export default MyList; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { createStyles, useResponsive } from 'antd-style'; | ||
import { memo } from 'react'; | ||
import { Flexbox } from 'react-layout-kit'; | ||
|
||
import MyList, { MyListProps } from './MyList'; | ||
|
||
const useStyles = createStyles(({ token, css }) => ({ | ||
container: css` | ||
border-inline-end: 1px solid ${token.colorBorder}; | ||
`, | ||
logo: css` | ||
fill: ${token.colorText}; | ||
`, | ||
top: css` | ||
font-size: 20px; | ||
font-weight: bold; | ||
`, | ||
})); | ||
|
||
const SideBar = memo<MyListProps>(({ activeTab }) => { | ||
const { styles } = useStyles(); | ||
|
||
const { mobile } = useResponsive(); | ||
|
||
return ( | ||
<Flexbox className={styles.container} width={280}> | ||
<Flexbox className={styles.top} padding={16}> | ||
我的 | ||
</Flexbox> | ||
<Flexbox gap={8} style={{ paddingInline: 8 }}> | ||
<MyList activeTab={activeTab} mobile={mobile} /> | ||
</Flexbox> | ||
</Flexbox> | ||
); | ||
}); | ||
|
||
export default SideBar; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export enum MyTabs { | ||
Agent = 'agent', | ||
Dance = 'dance', | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { PropsWithChildren } from 'react'; | ||
|
||
import { MyTabs } from '@/app/my/SideBar/type'; | ||
|
||
import MyLayout from '../layout.desktop'; | ||
|
||
export default ({ children }: PropsWithChildren) => { | ||
return <MyLayout activeTab={MyTabs.Agent}>{children}</MyLayout>; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
'use client'; | ||
|
||
import React from 'react'; | ||
|
||
import MyAgent from '@/panels/AgentPanel/Agent'; | ||
|
||
const Market = () => { | ||
return <MyAgent />; | ||
}; | ||
|
||
export default Market; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { PropsWithChildren } from 'react'; | ||
|
||
import { MyTabs } from '@/app/my/SideBar/type'; | ||
|
||
import MyLayout from '../layout.desktop'; | ||
|
||
export default ({ children }: PropsWithChildren) => { | ||
return <MyLayout activeTab={MyTabs.Dance}>{children}</MyLayout>; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
'use client'; | ||
|
||
import React from 'react'; | ||
|
||
import MyDance from '@/panels/DancePanel/Dance'; | ||
|
||
const Market = () => { | ||
return <MyDance />; | ||
}; | ||
|
||
export default Market; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
'use client'; | ||
|
||
import { ReactNode } from 'react'; | ||
import { Flexbox } from 'react-layout-kit'; | ||
|
||
import SideBar from '@/app/my/SideBar'; | ||
import { MyTabs } from '@/app/my/SideBar/type'; | ||
|
||
export interface LayoutProps { | ||
activeTab: MyTabs; | ||
children?: ReactNode; | ||
} | ||
|
||
const LayoutDesktop = (props: LayoutProps) => { | ||
const { children, activeTab } = props; | ||
return ( | ||
<Flexbox flex={1} height={'100%'} width={'100%'} style={{ position: 'relative' }} horizontal> | ||
<SideBar activeTab={activeTab} /> | ||
<Flexbox align={'center'} flex={1} style={{ overflow: 'scroll' }}> | ||
{children} | ||
</Flexbox> | ||
</Flexbox> | ||
); | ||
}; | ||
|
||
export default LayoutDesktop; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import Redirect from '@/app/my/Redirect'; | ||
|
||
const Index = () => <Redirect />; | ||
|
||
export default Index; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { createStyles } from 'antd-style'; | ||
|
||
export const useStyles = createStyles(({ css }) => ({ | ||
content: css` | ||
display: flex; | ||
flex-direction: row; | ||
flex-grow: 1; | ||
width: 100%; | ||
height: 100%; | ||
`, | ||
})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters