From b79f25bb0f6284fb82351f3b409c0de0f6d81acc Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Sun, 9 Jul 2023 22:45:55 -0700 Subject: [PATCH] Change headerRef footerRef to be camelcase --- components/auth/AccountModal/index.tsx | 4 ++-- components/auth/LoginModal/index.tsx | 2 +- components/auth/SignupModal/index.tsx | 2 +- .../CharacterConflictModal/index.tsx | 2 +- components/character/CharacterModal/index.tsx | 4 ++-- components/common/DialogContent/index.tsx | 20 +++++++++---------- components/search/SearchModal/index.tsx | 2 +- .../weapon/WeaponConflictModal/index.tsx | 2 +- components/weapon/WeaponModal/index.tsx | 4 ++-- 9 files changed, 20 insertions(+), 22 deletions(-) diff --git a/components/auth/AccountModal/index.tsx b/components/auth/AccountModal/index.tsx index 48b50dc2..1cfa9cb1 100644 --- a/components/auth/AccountModal/index.tsx +++ b/components/auth/AccountModal/index.tsx @@ -277,8 +277,8 @@ const AccountModal = React.forwardRef( {}} onEscapeKeyDown={onEscapeKeyDown} > diff --git a/components/auth/LoginModal/index.tsx b/components/auth/LoginModal/index.tsx index 618d36d0..5c2d8671 100644 --- a/components/auth/LoginModal/index.tsx +++ b/components/auth/LoginModal/index.tsx @@ -218,7 +218,7 @@ const LoginModal = (props: Props) => { diff --git a/components/auth/SignupModal/index.tsx b/components/auth/SignupModal/index.tsx index a4597d7e..7b57c82d 100644 --- a/components/auth/SignupModal/index.tsx +++ b/components/auth/SignupModal/index.tsx @@ -298,7 +298,7 @@ const SignupModal = (props: Props) => { diff --git a/components/character/CharacterConflictModal/index.tsx b/components/character/CharacterConflictModal/index.tsx index 5ad5acbb..b366ec5c 100644 --- a/components/character/CharacterConflictModal/index.tsx +++ b/components/character/CharacterConflictModal/index.tsx @@ -77,7 +77,7 @@ const CharacterConflictModal = (props: Props) => { event.preventDefault()} onEscapeKeyDown={close} > diff --git a/components/character/CharacterModal/index.tsx b/components/character/CharacterModal/index.tsx index f42b3114..6a170d6d 100644 --- a/components/character/CharacterModal/index.tsx +++ b/components/character/CharacterModal/index.tsx @@ -354,8 +354,8 @@ const CharacterModal = ({ {children} event.preventDefault()} onEscapeKeyDown={() => {}} > diff --git a/components/common/DialogContent/index.tsx b/components/common/DialogContent/index.tsx index 44823b3b..001f5426 100644 --- a/components/common/DialogContent/index.tsx +++ b/components/common/DialogContent/index.tsx @@ -12,15 +12,15 @@ interface Props HTMLDivElement > { wrapperClassName?: string - headerref?: React.RefObject - footerref?: React.RefObject + headerRef?: React.RefObject + footerRef?: React.RefObject scrollable?: boolean onEscapeKeyDown: (event: KeyboardEvent) => void onOpenAutoFocus: (event: Event) => void } const DialogContent = React.forwardRef(function Dialog( - { scrollable, children, ...props }, + { scrollable, wrapperClassName, headerRef, footerRef, children, ...props }, forwardedRef ) { // Classes @@ -37,12 +37,12 @@ const DialogContent = React.forwardRef(function Dialog( const scrollHeight = event.currentTarget.scrollHeight const clientHeight = event.currentTarget.clientHeight - if (props.headerref && props.headerref.current) - manipulateHeaderShadow(props.headerref.current, scrollTop) + if (headerRef && headerRef.current) + manipulateHeaderShadow(headerRef.current, scrollTop) - if (props.footerref && props.footerref.current) + if (footerRef && footerRef.current) manipulateFooterShadow( - props.footerref.current, + footerRef.current, scrollTop, scrollHeight, clientHeight @@ -94,7 +94,7 @@ const DialogContent = React.forwardRef(function Dialog( const calculateFooterShadow = debounce(() => { const boxShadowBase = '0 -2px 8px' const scrollable = document.querySelector(`.${styles.scrollable}`) - const footer = props.footerref + const footer = footerRef if (footer && footer.current) { if (scrollable && scrollable.clientHeight >= scrollable.scrollHeight) { @@ -133,9 +133,7 @@ const DialogContent = React.forwardRef(function Dialog( { [styles.dialog]: true, }, - props.wrapperClassName - ?.split(' ') - .map((className) => styles[className]) + wrapperClassName?.split(' ').map((className) => styles[className]) )} > { {props.children} { event.preventDefault()} onEscapeKeyDown={close} > diff --git a/components/weapon/WeaponModal/index.tsx b/components/weapon/WeaponModal/index.tsx index 5502168e..13d63335 100644 --- a/components/weapon/WeaponModal/index.tsx +++ b/components/weapon/WeaponModal/index.tsx @@ -469,8 +469,8 @@ const WeaponModal = ({ {children} event.preventDefault()} onEscapeKeyDown={onEscapeKeyDown} >