Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Top banner #60

Merged
merged 9 commits into from
Sep 14, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"registry": "https://npm.pkg.github.com"
},
"repository": "git://github.com/contacto-io/contacto-console",
"version": "0.5.12",
"version": "0.5.13",
"main": "build/index.js",
"module": "build/index.es.js",
"files": [
Expand Down
7 changes: 7 additions & 0 deletions src/components/Button/Button.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,10 @@ LinkDanger.args = {
label: 'Button without border',
type: 'link-danger',
}

export const LinkUnderline = Template.bind({})
LinkUnderline.args = {
label: 'Button without border',
type: 'link',
variant: 'underline',
}
7 changes: 7 additions & 0 deletions src/components/Button/button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,13 @@
}
}

&--underline {
text-decoration: underline;
height: 24px;
padding: 0;
Copy link
Collaborator

@samuellawerentz samuellawerentz Aug 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any hover style required?

min-width: 0;
}

.contacto-icon {
margin-right: 8px
}
Expand Down
5 changes: 5 additions & 0 deletions src/components/Button/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export const getButtonClassName = (
onlyIcon,
fullWidth,
align,
variant,
) => {
return [
'sg',
Expand All @@ -34,6 +35,7 @@ export const getButtonClassName = (
fullWidth ? 'contacto-button--full-width' : '',
align ? `contacto-button--${align}` : '',
className,
variant ? `contacto-button--${variant}` : '',
].join(' ')
}
/**
Expand All @@ -48,6 +50,7 @@ export const Button = ({
align,
className,
children,
variant,
...props
}) => {
return (
Expand All @@ -60,6 +63,7 @@ export const Button = ({
!(label || children) && icon,
fullWidth,
align,
variant,
)}
icon={icon ? <Icon name={icon} className={size} /> : null}
{...props}
Expand Down Expand Up @@ -101,6 +105,7 @@ Button.propTypes = {
*/
align: PropTypes.oneOf(['left', 'right', 'center']),
children: PropTypes.any,
variant: PropTypes.string,
}

Button.defaultProps = {
Expand Down
1 change: 1 addition & 0 deletions src/components/TopBanner/TopBanner.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ BannerWithButton.args = {
onClick={() => alert('Banner button clicked!')}
size="small"
type="link"
variant="underline"
/>,
],
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/TopBanner/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const TopBanner = ({
>
{loading && (
<Block>
<Icon.Loading size={16} color="white" />
<Icon.Loading size={16} trackColor="white" />
</Block>
)}
<Text color="white">{loading ? loadingText : content}</Text>
Expand Down
5 changes: 0 additions & 5 deletions src/components/TopBanner/topbanner.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,7 @@
// margin-left: 4px;

.sg.cnto-btn.contacto-button--small {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we move this style to Button.scss file?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May be add a new button type

<Button type="link" variant="underline" color="white" />

height: 24px;
padding: 0;
min-width: 0;
font-weight: 600;
color: white;
text-decoration: underline;
}
.sg.ant-btn.cnto-btn.contacto-button--link:hover {
color: white;
Expand Down