Skip to content

Commit

Permalink
Changed function names from stylePanel to stylePanelContents to bette…
Browse files Browse the repository at this point in the history
…r reflect the element/ref they are directly modifying
  • Loading branch information
cmhhelgeson committed Jan 4, 2024
1 parent 0effe6d commit e559c09
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const MainLayout: React.FunctionComponent<AppProps> = ({
}, []);

// Style .panelContents when clicking the expand icon.
const stylePanelOnExpand = () => {
const stylePanelContentsOnExpand = () => {
if (panelContentsRef.current) {
if (panelContentsRef.current.style.maxHeight === '0px') {
// Scroll height + marginBlockEnd of 16
Expand All @@ -65,7 +65,7 @@ const MainLayout: React.FunctionComponent<AppProps> = ({
};

//Style .panelContents when clicking on a link.
const stylePanelOnLink = () => {
const stylePanelContentsOnLink = () => {
// Only hide the panelContents when our window size is less than 768 pixels.
// Otherwise maintain the current layout of panelContents.
if (window.innerWidth <= 768) {
Expand Down Expand Up @@ -101,7 +101,7 @@ const MainLayout: React.FunctionComponent<AppProps> = ({
<div
className={styles.expand}
onClick={() => {
stylePanelOnExpand();
stylePanelContentsOnExpand();
}}
></div>
</h1>
Expand All @@ -128,7 +128,7 @@ const MainLayout: React.FunctionComponent<AppProps> = ({
<Link
href={`/samples/${slug}`}
onClick={() => {
stylePanelOnLink();
stylePanelContentsOnLink();
}}
>
{slug}
Expand Down

0 comments on commit e559c09

Please sign in to comment.