-
Notifications
You must be signed in to change notification settings - Fork 3
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
14 changed files
with
167 additions
and
345 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ yarn-error.log* | |
pnpm-debug.log* | ||
lerna-debug.log* | ||
pnpm-lock.yaml | ||
pnpm-lock.yaml | ||
|
||
node_modules | ||
dist | ||
|
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
Large diffs are not rendered by default.
Oops, something went wrong.
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,7 +1,27 @@ | ||
import { memo } from 'react' | ||
import CustomIcon from '.' | ||
import clsx from 'clsx' | ||
|
||
const IconButton = memo(() => { | ||
return '' | ||
}) | ||
interface IconButtonProps { | ||
component: React.ForwardRefExoticComponent<any> | React.FC<React.SVGProps<SVGSVGElement>> | ||
className?: string | ||
buttonClassName?: string | ||
} | ||
|
||
const IconButton: React.FC<IconButtonProps & React.ButtonHTMLAttributes<HTMLButtonElement>> = memo( | ||
({ component, className, buttonClassName, ...props }) => { | ||
return ( | ||
<button | ||
className={clsx( | ||
'p-2 bg-transparent border-none outline-none rounded-md hover:bg-gray-100 focus:outline-none active:bg-gray-100 duration-300', | ||
buttonClassName | ||
)} | ||
{...props} | ||
> | ||
<CustomIcon component={component} className={className} /> | ||
</button> | ||
) | ||
} | ||
) | ||
|
||
export default IconButton |
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import { $t } from '@/i18n' | ||
|
||
const Loading = () => { | ||
return <p>{$t('你好11')}</p> | ||
return <p>{$t('loading...')}</p> | ||
} | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,21 @@ | ||
import { useElementSize } from '@reactuses/core' | ||
import { Flex } from 'antd' | ||
import { memo } from 'react' | ||
import { memo, useEffect, useRef } from 'react' | ||
|
||
const MessageContent = memo(() => { | ||
return <Flex className="flex-1">111</Flex> | ||
const messageContentRef = useRef<HTMLDivElement>(null) | ||
|
||
const [height] = useElementSize(messageContentRef) | ||
|
||
useEffect(() => { | ||
console.log('height', height) | ||
}, [height]) | ||
|
||
return ( | ||
<Flex className="flex-1" ref={messageContentRef}> | ||
111 | ||
</Flex> | ||
) | ||
}) | ||
|
||
export default MessageContent |
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,18 @@ | ||
import useCommonStore from '@/stores/common' | ||
import { useEffect } from 'react' | ||
import { useParams, useLocation } from 'react-router' | ||
|
||
function useDialogHistory() { | ||
const params = useParams() | ||
const location = useLocation() | ||
const commonStore = useCommonStore() | ||
|
||
useEffect(() => { | ||
if (location.pathname.includes('dashboard')) { | ||
// console.log('~ dialog history hook, id changed =>', params.id) | ||
commonStore.update({ lastDialogId: Number(params.id || 0) }) | ||
} | ||
}, [params?.id, location.pathname]) | ||
} | ||
|
||
export default useDialogHistory |
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