@zohodesk/dot
Version:
In this Library, we Provide Some Basic Components to Build Your Application
85 lines (81 loc) • 2.73 kB
JavaScript
/* eslint-disable react/forbid-component-props */
/**** Libraries ****/
import React, { Component } from 'react';
import { AccountName_defaultProps } from "./props/defaultProps";
import { AccountName_propTypes } from "./props/propTypes";
/**** Components ****/
import { Container, Box } from '@zohodesk/components/lib/Layout';
import Link from "../../Link/Link";
/**** CSS ****/
import style from "./SecondaryText.module.css";
export default class AccountName extends Component {
render() {
let {
dataTitle,
dataId,
urlName,
urlData,
onClick,
isLink,
className,
text,
href,
notAccessible = false,
fontWeight,
secondaryAccountHref,
secondaryAccountClick,
secondaryAccountText,
customProps
} = this.props;
let {
LinkProps = {},
TextProps = {},
SecondaryTextProps = {}
} = customProps;
return /*#__PURE__*/React.createElement(Container, {
alignBox: "row",
align: "baseline",
isCover: false,
"data-title": dataTitle,
dataId: dataId
}, /*#__PURE__*/React.createElement(Box, {
flexible: true
}, /*#__PURE__*/React.createElement(Container, {
alignBox: "row",
align: "baseline",
isCover: false,
className: style.primaryAccountNameCnt
}, /*#__PURE__*/React.createElement(Box, {
className: style.primaryAccountName,
shrink: true
}, isLink ? /*#__PURE__*/React.createElement(Link, {
href: href,
urlName: urlName,
urlData: urlData,
onClick: onClick,
dataId: `${dataId}_link`,
className: style.link,
...LinkProps,
ariaLabel: `Account Name ${text}`
}, /*#__PURE__*/React.createElement("div", {
className: `${style.textStyle} ${style[`font_${fontWeight}`]} ${className ? className : ''}`
}, text)) : /*#__PURE__*/React.createElement("div", {
className: `${style.secondaryText} ${style[`font_${fontWeight}`]} ${className ? className : ''} ${notAccessible ? style.disable : ''}`,
...TextProps
}, text)), secondaryAccountText && /*#__PURE__*/React.createElement(Box, null, /*#__PURE__*/React.createElement(Link, {
href: secondaryAccountHref,
onClick: secondaryAccountClick,
className: style.link
}, /*#__PURE__*/React.createElement("div", {
className: `${style.textStyle} ${style[`font_${fontWeight}`]} ${className ? className : ''}`,
...SecondaryTextProps
}, secondaryAccountText))))));
}
}
AccountName.propTypes = AccountName_propTypes;
AccountName.defaultProps = AccountName_defaultProps; // if (__DOCS__) {
// AccountName.docs = {
// folderName: 'List',
// componentGroup: 'AccountName'
// };
// }