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

create common component shareLink #48

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import PropTypes from 'prop-types';
import styles from './ShareButton.module.scss';
const ShareButton = ({ children, type }) => (
<div
className={`${styles[`share-button__${type}`]} ${styles['share-button']}`}
>
{children}
</div>
);
ShareButton.propTypes = {
children: PropTypes.oneOfType([
PropTypes.arrayOf(PropTypes.node),
PropTypes.node,
]).isRequired,
type: PropTypes.string.isRequired,
};
export default ShareButton;
import PropTypes from 'prop-types';

import styles from './ShareButton.module.scss';

const ShareButton = ({ children, type }) => (
<div
className={`${styles[`share-button__${type}`]} ${styles['share-button']}`}
>
{children}
</div>
);

ShareButton.propTypes = {
children: PropTypes.oneOfType([
PropTypes.arrayOf(PropTypes.node),
PropTypes.node,
]).isRequired,
type: PropTypes.string.isRequired,
};

export default ShareButton;
Original file line number Diff line number Diff line change
@@ -1,106 +1,117 @@
@import '../../../../sass/variables';

.share-button {
border: 1px solid #fff;
border-radius: 5px;
}

.share-button button {
width: 3.5rem;
height: 2.9rem;
display: flex;
justify-content: center;
align-items: center;
}

.share-button__whatsapp {
&:hover {
svg path {
fill: $whatsapp;
}
}

&:active {
border: 1px solid $whatsapp;
}
}

.share-button__facebook {
&:hover {
svg path {
fill: $facebook;
}
}

&:active {
border: 1px solid $facebook--active;

svg path {
fill: $facebook--active;
}
}
}

.share-button__telegram {
&:hover {
svg path {
fill: $telegram;
}
}

&:active {
border: 1px solid $telegram--active;

svg path {
fill: $telegram--active;
}
}
}

.share-button__twitter {
&:hover {
svg path {
fill: $twitter;
}
}

&:active {
border: 1px solid $twitter--active;

svg path {
fill: $twitter--active;
}
}
}

.share-button__email {
&:hover {
svg path {
fill: $email;
}
}

&:active {
border: 1px solid $email--active;

svg path {
fill: $email--active;
}
}
}

.share-button__reddit {
&:hover {
svg path {
fill: $reddit;
}
}

&:active {
border: 1px solid $reddit--active;

svg path {
fill: $reddit--active;
}
}
}
@import 'sass/variables';

.share-button {
border: 1px solid #fff;
border-radius: 5px;
}

.share-button button {
width: 3.5rem;
height: 2.9rem;
display: flex;
justify-content: center;
align-items: center;
}

.share-button__whatsapp {
&:hover {
svg path {
fill: $whatsapp;
}
}

&:active {
border: 1px solid $whatsapp;
}
}

.share-button__facebook {
&:hover {
svg path {
fill: $facebook;
}
}

&:active {
border: 1px solid $facebook--active;

svg path {
fill: $facebook--active;
}
}
}

.share-button__telegram {
&:hover {
svg path {
fill: $telegram;
}
}

&:active {
border: 1px solid $telegram--active;

svg path {
fill: $telegram--active;
}
}
}

.share-button__twitter {
&:hover {
svg path {
fill: $twitter;
}
}

&:active {
border: 1px solid $twitter--active;

svg path {
fill: $twitter--active;
}
}
}

.share-button__email {
&:hover {
svg path {
fill: $email;
}
}

&:active {
border: 1px solid $email--active;

svg path {
fill: $email--active;
}
}
}

.share-button__reddit {
&:hover {
svg path {
fill: $reddit;
}
}

&:active {
border: 1px solid $reddit--active;

svg path {
fill: $reddit--active;
}
}
}

@media (max-width: $breakpoint-tablet) {
.share-button {
margin-top: 10px;
}

.share-button button {
width: 2.5rem;
height: 1.5rem;
}
}
Loading