Skip to content

Commit

Permalink
♻️ refactor(fluentemoji): Replace useLocalStorageState with useState …
Browse files Browse the repository at this point in the history
…hook

This commit refactors the "FluentEmoji" component by removing the
"useLocalStorageState" import and replacing it with the useState hook.
The "emojiUrl" state is also updated to use useState instead of
useLocalStorageState.

Changes:
- Replace useLocalStorageState with useState hook
- Update emojiUrl state to use useState instead of useLocalStorageState
  • Loading branch information
canisminor1990 committed Jul 16, 2023
1 parent dc6db66 commit a61706a
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/FluentEmoji/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { useLocalStorageState } from 'ahooks';
import { kebabCase } from 'lodash-es';
import { memo, useEffect, useState } from 'react';

Expand Down Expand Up @@ -27,12 +26,7 @@ export interface FluentEmojiProps extends DivProps {
const FluentEmoji = memo<FluentEmojiProps>(
({ emoji, className, style, type = 'modern', size = 40 }) => {
const [loadingFail, setLoadingFail] = useState(false);
const [emojiUrl, setEmojiUrl] = useLocalStorageState<{ [key: string]: string }>(
'lobe-ui-emoji',
{
defaultValue: {},
},
);
const [emojiUrl, setEmojiUrl] = useState<{ [key: string]: string }>({});
const { cx, styles } = useStyles();

useEffect(() => {
Expand Down

1 comment on commit a61706a

@vercel
Copy link

@vercel vercel bot commented on a61706a Jul 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

lobe-ui – ./

lobe-ui.vercel.app
lobe-ui-git-master-lobehub.vercel.app
lobe-ui-lobehub.vercel.app
ui.lobehub.com

Please sign in to comment.