Skip to content

Commit

Permalink
refactor!: standardized naming (#23)
Browse files Browse the repository at this point in the history
* chore: minor version bump
  • Loading branch information
dylandbl authored Jul 15, 2022
1 parent c1664d4 commit 3621e0a
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-quick-reactions",
"version": "0.7.0",
"version": "0.8.0",
"description": "A popup emoji-reaction component for React.",
"private": false,
"main": "./lib/cjs/index.js",
Expand Down
4 changes: 2 additions & 2 deletions src/components/ReactionPopover/ReactionPopover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { CloseSvg } from "../svg/CloseSvg";
export const ReactionPopover = (props: PopoverProps) => {
const {
isVisible = false,
onClickEmoji,
onClickReaction,
closeButton,
header = "Quick reactions",
outerDivClassName,
Expand Down Expand Up @@ -66,7 +66,7 @@ export const ReactionPopover = (props: PopoverProps) => {
className={"rqr-reaction-element " + reactionElementClassName}
key={item?.name + "-" + index}
id={item?.id}
onClick={(e) => onClickEmoji(e.target as Element)}
onClick={(e) => onClickReaction(e.target as Element)}
onMouseEnter={
changeHeaderOnReactionElemHover
? () => setPopoverHeader(item?.name)
Expand Down
16 changes: 8 additions & 8 deletions src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import { ReactNode } from "react";
import { ReactionPopover } from "./components/ReactionPopover/ReactionPopover";
import { RQRSpan } from "./styles/RqrStyles";
import { QuickReactionsSpan } from "./styles/RqrStyles";
import { PopoverProps } from "./types";

interface RQRProps extends PopoverProps {
interface QuickReactionsProps extends PopoverProps {
trigger: ReactNode;
}
const RQR = (props: RQRProps) => {
const { trigger } = props;
const QuickReactions = (props: QuickReactionsProps) => {
const { trigger, isVisible } = props;

return (
<RQRSpan>
<QuickReactionsSpan>
{trigger}
<ReactionPopover {...props} />
</RQRSpan>
{isVisible && <ReactionPopover {...props} />}
</QuickReactionsSpan>
);
};

export default RQR;
export default QuickReactions;
2 changes: 1 addition & 1 deletion src/styles/RqrStyles.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import styled from "@emotion/styled";

export const RQRSpan = styled.span`
export const QuickReactionsSpan = styled.span`
display: inline-block;
position: relative;
`;
2 changes: 1 addition & 1 deletion src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export interface PopoverProps {
hideCloseButton?: boolean;
hideHeader?: boolean;
isVisible: boolean;
onClickEmoji: (event?: Element) => void;
onClickReaction: (event?: Element) => void;
onClose: () => void;
outerDivClassName?: string;
reactionElementClassName?: string;
Expand Down

0 comments on commit 3621e0a

Please sign in to comment.