From e1df253b22730e6a13c737335372a0b4db3c404c Mon Sep 17 00:00:00 2001 From: Alexey Kostenko Date: Tue, 23 Mar 2021 18:29:29 +0300 Subject: [PATCH] Web: People/Components: Added login settings buttons to edit profile page, social button - style fix --- .../asc-web-components/social-button/index.js | 5 +- .../social-button/styled-social-button.js | 6 +- packages/asc-web-components/themes/base.js | 7 +- .../Client/public/images/share.google.svg | 6 ++ .../Client/public/images/share.linkedin.svg | 4 + .../Section/Body/updateUserForm.js | 90 +++++++++++++++++++ 6 files changed, 111 insertions(+), 7 deletions(-) create mode 100644 products/ASC.People/Client/public/images/share.google.svg create mode 100644 products/ASC.People/Client/public/images/share.linkedin.svg diff --git a/packages/asc-web-components/social-button/index.js b/packages/asc-web-components/social-button/index.js index 6c90f923e9..05e9ba9a2d 100644 --- a/packages/asc-web-components/social-button/index.js +++ b/packages/asc-web-components/social-button/index.js @@ -13,7 +13,7 @@ class SocialButton extends React.Component { } render() { - const { label, iconName } = this.props; + const { label, iconName, iconOptions } = this.props; return ( @@ -42,6 +42,8 @@ SocialButton.propTypes = { id: PropTypes.string, /** Accepts css style */ style: PropTypes.oneOfType([PropTypes.object, PropTypes.array]), + onClick: PropTypes.func, + iconOptions: PropTypes.object, }; SocialButton.defaultProps = { @@ -49,6 +51,7 @@ SocialButton.defaultProps = { iconName: "SocialButtonGoogleIcon", tabIndex: -1, isDisabled: false, + iconOptions: {}, }; export default SocialButton; diff --git a/packages/asc-web-components/social-button/styled-social-button.js b/packages/asc-web-components/social-button/styled-social-button.js index 7b17c22285..be27782345 100644 --- a/packages/asc-web-components/social-button/styled-social-button.js +++ b/packages/asc-web-components/social-button/styled-social-button.js @@ -1,3 +1,4 @@ +import React from "react"; import styled, { css } from "styled-components"; import Base from "../themes/base"; import PropTypes from "prop-types"; @@ -20,7 +21,8 @@ const StyledSocialButton = styled(ButtonWrapper).attrs((props) => ({ }))` font-family: ${(props) => props.theme.fontFamily}; border: none; - display: inline-block; + display: flex; + align-items: center; font-weight: ${(props) => props.theme.socialButton.fontWeight}; text-decoration: ${(props) => props.theme.socialButton.textDecoration}; @@ -76,7 +78,7 @@ const StyledSocialButton = styled(ButtonWrapper).attrs((props) => ({ `}; .social_button_text { - position: absolute; + position: relative; width: ${(props) => props.theme.socialButton.text.width}; height: ${(props) => props.theme.socialButton.text.height}; diff --git a/packages/asc-web-components/themes/base.js b/packages/asc-web-components/themes/base.js index 94348077a8..c847bcab18 100644 --- a/packages/asc-web-components/themes/base.js +++ b/packages/asc-web-components/themes/base.js @@ -213,10 +213,8 @@ const Base = { socialButton: { fontWeight: "600", textDecoration: "none", - margin: "20px 0 0 20px", padding: "0", borderRadius: "2px", - width: "201px", height: "40px", textAlign: "left", stroke: " none", @@ -238,14 +236,15 @@ const Base = { text: { width: "142px", height: "16px", - margin: "12px 9px 12px 10px", - fontWeight: "500", + margin: "0 11px", + fontWeight: "600", fontSize: "14px", lineHeight: "16px", letterSpacing: "0.21875px", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", + color: "#757575", }, svg: { diff --git a/products/ASC.People/Client/public/images/share.google.svg b/products/ASC.People/Client/public/images/share.google.svg new file mode 100644 index 0000000000..8a07d68b28 --- /dev/null +++ b/products/ASC.People/Client/public/images/share.google.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/products/ASC.People/Client/public/images/share.linkedin.svg b/products/ASC.People/Client/public/images/share.linkedin.svg new file mode 100644 index 0000000000..65c1ed4211 --- /dev/null +++ b/products/ASC.People/Client/public/images/share.linkedin.svg @@ -0,0 +1,4 @@ + + + + diff --git a/products/ASC.People/Client/src/pages/ProfileAction/Section/Body/updateUserForm.js b/products/ASC.People/Client/src/pages/ProfileAction/Section/Body/updateUserForm.js index e565dddcaa..cd74e433fa 100644 --- a/products/ASC.People/Client/src/pages/ProfileAction/Section/Body/updateUserForm.js +++ b/products/ASC.People/Client/src/pages/ProfileAction/Section/Body/updateUserForm.js @@ -6,6 +6,7 @@ import Button from "@appserver/components/button"; import Textarea from "@appserver/components/textarea"; import Text from "@appserver/components/text"; import AvatarEditor from "@appserver/components/avatar-editor"; +import SocialButton from "@appserver/components/social-button"; import Link from "@appserver/components/link"; import { isTablet } from "@appserver/components/utils/device"; @@ -51,6 +52,9 @@ import config from "../../../../../package.json"; import { combineUrl } from "@appserver/common/utils"; import { AppServerConfig } from "@appserver/common/constants"; +const facebookIconOptions = { isfill: true, color: "#4469B0" }; +const twitterIconOptions = { isfill: true, color: "#2AA3EF" }; + const dialogsDataset = { changeEmail: "changeEmail", changePassword: "changePassword", @@ -69,6 +73,13 @@ const Th = styled.th` const Td = styled.td``; +const StyledWrapper = styled.div` + align-items: center; + display: grid; + grid-template-columns: auto 1fr; + grid-gap: 16px 22px; +`; + class UpdateUserForm extends React.Component { constructor(props) { super(props); @@ -533,6 +544,19 @@ class UpdateUserForm extends React.Component { this.setIsEdit(); } + onClickGoogleConnect = () => { + console.log("Connect to Google"); + }; + onClickFacebookConnect = () => { + console.log("Connect to Facebook"); + }; + onClickTwitterConnect = () => { + console.log("Connect to Twitter"); + }; + onClickLinkedInConnect = () => { + console.log("Connect to LinkedIn"); + }; + render() { const { isLoading, @@ -826,6 +850,72 @@ class UpdateUserForm extends React.Component { /> + + + + + + {t("Connect")} + +
+ +
+ + + {t("Connect")} + +
+ +
+ + {t("Connect")} + +
+ +
+ + {t("Connect")} + +
+