forked from lobehub/lobe-chat
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
💄 style: Imporve mobile styles and loading skeleton (lobehub#2363)
- Loading branch information
1 parent
6012b91
commit 8ee3591
Showing
44 changed files
with
338 additions
and
126 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
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
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
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
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
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
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
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
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
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 @@ | ||
'use client'; | ||
|
||
import { ActionIcon, MobileNavBar } from '@lobehub/ui'; | ||
import { useScroll } from 'ahooks'; | ||
import { useTheme } from 'antd-style'; | ||
import { Moon, Sun } from 'lucide-react'; | ||
import { memo } from 'react'; | ||
|
||
import { MOBILE_HEADER_ICON_SIZE } from '@/const/layoutTokens'; | ||
import { useUserStore } from '@/store/user'; | ||
import { mobileHeaderFixed } from '@/styles/mobileHeader'; | ||
|
||
const Header = memo(() => { | ||
const theme = useTheme(); | ||
const scroll = useScroll(() => document.querySelector('#lobe-mobile-scroll-container')); | ||
const switchThemeMode = useUserStore((s) => s.switchThemeMode); | ||
const showBackground = (scroll as any)?.top > 44; | ||
|
||
return ( | ||
<MobileNavBar | ||
right={ | ||
<ActionIcon | ||
color={showBackground ? undefined : theme.colorBgLayout} | ||
icon={theme.isDarkMode ? Moon : Sun} | ||
onClick={() => switchThemeMode(theme.isDarkMode ? 'light' : 'dark')} | ||
size={MOBILE_HEADER_ICON_SIZE} | ||
/> | ||
} | ||
style={{ | ||
...mobileHeaderFixed, | ||
background: showBackground ? undefined : 'transparent', | ||
}} | ||
/> | ||
); | ||
}); | ||
|
||
export default Header; |
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,29 @@ | ||
import { createStyles } from 'antd-style'; | ||
|
||
export const useStyles = createStyles(({ css, token, isDarkMode }) => ({ | ||
bannerBox: css` | ||
position: relative; | ||
overflow: hidden; | ||
flex: none; | ||
width: 100%; | ||
height: 100px; | ||
background: ${token.colorFill}; | ||
`, | ||
bannerImg: css` | ||
position: absolute; | ||
scale: 8; | ||
filter: blur(6px) saturate(2); | ||
`, | ||
info: css` | ||
position: relative; | ||
margin-top: ${-token.borderRadiusLG}px; | ||
background: ${isDarkMode ? token.colorBgLayout : token.colorBgContainer}; | ||
border-top-left-radius: ${token.borderRadiusLG}px; | ||
border-top-right-radius: ${token.borderRadiusLG}px; | ||
`, | ||
})); |
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 |
---|---|---|
@@ -1,17 +1,32 @@ | ||
'use client'; | ||
|
||
import { Skeleton } from 'antd'; | ||
import { Center } from 'react-layout-kit'; | ||
import { memo } from 'react'; | ||
import { Flexbox } from 'react-layout-kit'; | ||
|
||
import SkeletonLoading from '@/components/SkeletonLoading'; | ||
|
||
export default () => { | ||
import { useStyles } from './features/style'; | ||
|
||
const Loading = memo(() => { | ||
const { styles } = useStyles(); | ||
return ( | ||
<> | ||
<Center height={180}> | ||
<Skeleton.Avatar shape={'circle'} size={88} /> | ||
</Center> | ||
<SkeletonLoading paragraph={{ rows: 8 }} title={false} /> | ||
<Flexbox align={'center'} className={styles.bannerBox} justify={'center'} /> | ||
<Flexbox | ||
align={'center'} | ||
className={styles.info} | ||
gap={12} | ||
horizontal | ||
paddingBlock={12} | ||
paddingInline={12} | ||
> | ||
<Skeleton.Avatar active shape={'circle'} size={48} /> | ||
<Skeleton active paragraph={{ rows: 1 }} title={false} /> | ||
</Flexbox> | ||
<SkeletonLoading active paragraph={{ rows: 8 }} title={false} /> | ||
</> | ||
); | ||
}; | ||
}); | ||
|
||
export default Loading; |
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
Oops, something went wrong.