SkyeYoung commented on code in PR #1115:
URL: https://github.com/apache/apisix-website/pull/1115#discussion_r878961942


##########
website/src/components/UI/Affix.tsx:
##########
@@ -0,0 +1,99 @@
+import type { CSSProperties, ReactNode, FC } from 'react';
+import React, { useState, useEffect } from 'react';
+import styled from 'styled-components';
+
+import { getDomStyle } from '../../utils';
+
+interface Props {
+  style: CSSProperties;
+  children: ReactNode;
+}
+
+const AffixContent = styled.div`
+`;
+
+const getPositionStyle = (
+  hasCssSticky: boolean,
+  defaultStyles: CSSProperties = {},
+):CSSProperties => {
+  const { width } = defaultStyles;
+  const positionStyle: CSSProperties = hasCssSticky ? {
+    position: 'sticky',
+    marginLeft: `-${width}px`,
+    display: 'inline-block',
+    float: 'left',
+  } : {
+    position: 'absolute',
+  };
+
+  return {
+    ...positionStyle,
+    ...defaultStyles,
+  };
+};
+
+const Affix: FC<Props> = (props) => {

Review Comment:
   You can remove the `children` prop.
   
   
![image](https://user-images.githubusercontent.com/48400568/169726620-8755f6cc-e10a-4b9b-ac98-fee2861e5d65.png)
   
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to