Skip to content

Commit

Permalink
emoji-picker-react@4.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ealush committed Feb 22, 2024
1 parent ca214df commit 42fc3c3
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 5 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"dependencies": {
"@vercel/analytics": "^1.1.1",
"emoji-picker-react": "^4.7.18",
"emoji-picker-react": "^4.8.0",
"next": "13.5.6",
"react": "^18",
"react-dom": "^18"
Expand Down
24 changes: 24 additions & 0 deletions src/components/PickerControls.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ export function PickerControls({
updateState("reactionsDefaultOpen", reactionsDefaultOpen)
}
/>
<ChkAllowExpandReactions
allowExpandReactions={pickerProps.allowExpandReactions}
setAllowExpandReactions={(allowExpandReactions) =>
updateState("allowExpandReactions", allowExpandReactions)
}
/>
<div className={styles.spacer} />
<button onClick={reset} className={styles.ButtonReset}>
Reset
Expand Down Expand Up @@ -327,3 +333,21 @@ function ChkReactions({
</Label>
);
}

function ChkAllowExpandReactions({
allowExpandReactions,
setAllowExpandReactions,
}: {
allowExpandReactions?: boolean;
setAllowExpandReactions: (allowExpandReactions: boolean) => void;
}) {
return (
<Label text="Allow Expand Reactions">
<input
type="checkbox"
checked={allowExpandReactions}
onChange={(e) => setAllowExpandReactions(e.target.checked)}
/>
</Label>
);
}
2 changes: 2 additions & 0 deletions src/components/PickerDemo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const DEFAULT_THEME = Theme.AUTO;
const DEFAULT_SUGGESTED_EMOJIS_MODE = SuggestionMode.RECENT;
const DEFAULT_HEIGHT = 450;
const DEFAULT_WIDTH = 350;
const DEFAULT_ALLOW_EXPAND_REACTIONS = true;
const DEFAULT_SKIN_TONE_PICKER_LOCATION = SkinTonePickerLocation.SEARCH;

export default function PickerDemo() {
Expand Down Expand Up @@ -92,4 +93,5 @@ const defaultProps = {
height: DEFAULT_HEIGHT,
width: DEFAULT_WIDTH,
skinTonePickerLocation: DEFAULT_SKIN_TONE_PICKER_LOCATION,
allowExpandReactions: DEFAULT_ALLOW_EXPAND_REACTIONS,
} as PickerProps;

0 comments on commit 42fc3c3

Please sign in to comment.