Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
ealush committed Feb 22, 2024

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
1 parent ca214df commit 42fc3c3
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
@@ -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"
24 changes: 24 additions & 0 deletions src/components/PickerControls.tsx
Original file line number Diff line number Diff line change
@@ -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
@@ -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
@@ -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() {
@@ -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.