From 83b326e9a557326dfa3b27ca824943ce2b718eaa Mon Sep 17 00:00:00 2001 From: Virginie Ky Date: Fri, 20 Mar 2020 09:19:43 +0100 Subject: [PATCH] leftmenu alignment and border listbutton Signed-off-by: Virginie Ky --- .../lib/src/components/LeftMenuLink/Icon.js | 15 +++++++++++++++ .../lib/src/components/LeftMenuLink/index.js | 3 +++ .../lib/src/components/LeftMenuList/List.js | 3 +-- .../lib/src/components/ListButton/index.js | 1 + .../src/components/CustomLink/StyledCustomLink.js | 2 +- 5 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 packages/strapi-helper-plugin/lib/src/components/LeftMenuLink/Icon.js diff --git a/packages/strapi-helper-plugin/lib/src/components/LeftMenuLink/Icon.js b/packages/strapi-helper-plugin/lib/src/components/LeftMenuLink/Icon.js new file mode 100644 index 0000000000..63a5e1010a --- /dev/null +++ b/packages/strapi-helper-plugin/lib/src/components/LeftMenuLink/Icon.js @@ -0,0 +1,15 @@ +import React from 'react'; +import styled from 'styled-components'; +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; + +import colors from '../../assets/styles/colors'; + +const LeftMenuIcon = styled(({ ...props }) => )` + position: absolute; + top: calc(50% - 0.3rem); + left: 1.4rem; + font-size: 0.7rem; + color: ${colors.leftMenu.darkGrey}; +`; + +export default LeftMenuIcon; diff --git a/packages/strapi-helper-plugin/lib/src/components/LeftMenuLink/index.js b/packages/strapi-helper-plugin/lib/src/components/LeftMenuLink/index.js index f340430f77..3bd532129c 100644 --- a/packages/strapi-helper-plugin/lib/src/components/LeftMenuLink/index.js +++ b/packages/strapi-helper-plugin/lib/src/components/LeftMenuLink/index.js @@ -2,9 +2,12 @@ import React, { memo } from 'react'; import PropTypes from 'prop-types'; import { NavLink } from 'react-router-dom'; +import Icon from './Icon'; + function LeftMenuLink({ children, to }) { return ( +

{children}

); diff --git a/packages/strapi-helper-plugin/lib/src/components/LeftMenuList/List.js b/packages/strapi-helper-plugin/lib/src/components/LeftMenuList/List.js index 185ac863d2..fa7bbe79ae 100644 --- a/packages/strapi-helper-plugin/lib/src/components/LeftMenuList/List.js +++ b/packages/strapi-helper-plugin/lib/src/components/LeftMenuList/List.js @@ -5,8 +5,7 @@ import colors from '../../assets/styles/colors'; const List = styled.ul` margin-bottom: 0; padding-left: 0; - max-height: ${props => - props.numberOfVisibleItems ? `${props.numberOfVisibleItems * 35}px` : null}; + max-height: 178px; overflow-y: scroll; li { position: relative; diff --git a/packages/strapi-helper-plugin/lib/src/components/ListButton/index.js b/packages/strapi-helper-plugin/lib/src/components/ListButton/index.js index 4c7d3cc035..b6c983b906 100644 --- a/packages/strapi-helper-plugin/lib/src/components/ListButton/index.js +++ b/packages/strapi-helper-plugin/lib/src/components/ListButton/index.js @@ -4,6 +4,7 @@ const ListButton = styled.div` button { width: 100%; height: 54px; + border: 0; border-top: 1px solid #aed4fb; color: #007eff; font-weight: 500; diff --git a/packages/strapi-plugin-content-type-builder/admin/src/components/CustomLink/StyledCustomLink.js b/packages/strapi-plugin-content-type-builder/admin/src/components/CustomLink/StyledCustomLink.js index 9f482ff68d..f3851d908e 100644 --- a/packages/strapi-plugin-content-type-builder/admin/src/components/CustomLink/StyledCustomLink.js +++ b/packages/strapi-plugin-content-type-builder/admin/src/components/CustomLink/StyledCustomLink.js @@ -8,7 +8,7 @@ import styled from 'styled-components'; const StyledCustomLink = styled.div` padding-left: 15px; - padding-top: 9px; + padding-top: 10px; line-height: 0; margin-left: -3px;