From b07d91b2da7a912996d363d8d5e9931575e8141b Mon Sep 17 00:00:00 2001 From: Lucas Bento Date: Fri, 1 May 2020 12:47:23 +0200 Subject: [PATCH 1/3] Add missing `framer-motion` --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 216646b6..ab2d94f5 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "@emotion/core": "10.0.28", "@emotion/styled": "10.0.27", "antd": "4.0.3", - "framer-motion": "^2.0.0-beta.52", + "framer-motion": "^2.0.0-beta.57", "markdown-to-jsx": "6.11.0", "query-string": "6.11.1", "react": "16.13.0", diff --git a/yarn.lock b/yarn.lock index 0aeb2d45..1859fb58 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5292,10 +5292,10 @@ fragment-cache@^0.2.1: dependencies: map-cache "^0.2.2" -framer-motion@^2.0.0-beta.52: - version "2.0.0-beta.52" - resolved "https://registry.yarnpkg.com/framer-motion/-/framer-motion-2.0.0-beta.52.tgz#f7a6512f6205accb46cf94459aa7b36464b72193" - integrity sha512-6bHcrHkm2OiWYYF3EXre3xPl6/Z8RS6tqD6tW3GVDJK/JBG3XMjXNnXA9wN4k/6phDRfjpcooPUMtm2yztrmmA== +framer-motion@^2.0.0-beta.57: + version "2.0.0-beta.57" + resolved "https://registry.yarnpkg.com/framer-motion/-/framer-motion-2.0.0-beta.57.tgz#c17703b86cddebd9638d1643893f2583a1b0731b" + integrity sha512-5grAM3CNlsItmge0AnZxJy80fOo2b4vyoQvgZp2gdErtd6HTF+LOSjQ4tW4PFVnvIGLlULa0syu198LAcGrWsQ== dependencies: "@popmotion/easing" "^1.0.2" "@popmotion/popcorn" "^0.4.2" From 3afa96569ea086e408e4754878e6b4cbaf28e1e7 Mon Sep 17 00:00:00 2001 From: Lucas Bento Date: Wed, 3 Jun 2020 12:33:24 +0200 Subject: [PATCH 2/3] Separate content section components --- .../common/Sections/HideContentButton.js | 31 +++ src/components/common/Sections/Section.js | 107 ++++++++ src/components/common/Sections/Title.js | 32 +++ src/components/common/UsefulContentSection.js | 252 +++++------------- 4 files changed, 234 insertions(+), 188 deletions(-) create mode 100644 src/components/common/Sections/HideContentButton.js create mode 100644 src/components/common/Sections/Section.js create mode 100644 src/components/common/Sections/Title.js diff --git a/src/components/common/Sections/HideContentButton.js b/src/components/common/Sections/HideContentButton.js new file mode 100644 index 00000000..8951ebed --- /dev/null +++ b/src/components/common/Sections/HideContentButton.js @@ -0,0 +1,31 @@ +import React from 'react' +import styled from '@emotion/styled' +import { UpOutlined, DownOutlined } from '@ant-design/icons' +import { Button } from 'antd' + +const HideContentButton = styled( + ({ toggleContentVisibility, isContentVisible, ...props }) => ( + +))` + padding: 0px 5px 0px 0px; +` + +const NextButton = styled( + ({ issues, issuesKeySince, setIssuesKeySince, ...props }) => { + const nextIssuesKeySince = issuesKeySince + MAX_ISSUES_PER_PAGE + + return ( + + ) + } +)` + padding: 0px 0px 0px 5px; +` + +const TroubleshootingSection = ({ isLoading }) => { + const [issuesKeySince, setIssuesKeySince] = useState(0) + + const renderTitle = () => ( + + Troubleshooting + + ) + + return ( +
+ + {issuesMock.map( + (issue, key) => + key > issuesKeySince && + key <= issuesKeySince + MAX_ISSUES_PER_PAGE && ( + + ) + )} + + + + + + + +
+ ) +} + +export default TroubleshootingSection