Skip to content
This repository was archived by the owner on May 13, 2024. It is now read-only.

Commit 2757c16

Browse files
authored
Merge pull request #179 from utkarsha-deriv/utkarsha/add-slack-telegram-to-footer
Utkarsha/add slack telegram to footer
2 parents e836274 + ae65dee commit 2757c16

File tree

5 files changed

+65
-19
lines changed

5 files changed

+65
-19
lines changed

src/components/Footer/Footer.module.scss

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
@media screen and (max-width: 992px) {
1212
flex-direction: column;
13-
gap: rem(2);
13+
gap: rem(4);
1414
padding: rem(4);
1515
}
1616

@@ -47,14 +47,32 @@
4747
color: var(--ifm-color-danger);
4848
padding: 0 rem(0.5);
4949
}
50+
.Communities {
51+
display: flex;
52+
align-items: center;
53+
gap: rem(1.7);
54+
}
5055
.communityButton {
5156
font-family: 'Ubuntu', sans-serif;
5257
color: var(--ifm-color-white);
5358
border: 2px solid var(--ifm-color-secondary-darkest);
54-
padding: rem(0.5);
55-
border-radius: rem(1);
59+
padding: rem(0.8) rem(1.6);
60+
border-radius: rem(1.7);
5661
font-size: rem(1.4);
5762
font-weight: bold;
63+
text-decoration: none;
64+
cursor: pointer;
65+
white-space: nowrap;
66+
}
67+
.Telegram {
68+
display: flex;
69+
justify-content: center;
70+
align-items: center;
71+
gap: rem(0.8);
72+
}
73+
.TelegramIcon {
74+
width: rem(2);
75+
height: rem(1.657);
5876
}
5977
}
6078
}

src/components/Footer/__tests__/Footer.test.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React from 'react';
22
import '@testing-library/jest-dom';
33
import { cleanup, render, screen, RenderResult, within } from '@site/src/test-utils';
44
import Footer from '../';
5+
import userEvent from '@testing-library/user-event';
56

67
describe('HeroHeader', () => {
78
let render_result: RenderResult;
@@ -26,15 +27,14 @@ describe('HeroHeader', () => {
2627
expect(footer_description).toBeInTheDocument();
2728
});
2829
it('should render community link properly', () => {
29-
const community_link = screen.getByTestId('community-link');
30+
const community_link = screen.getByRole('link', { name: 'Join our community' });
3031
expect(community_link).toBeInTheDocument();
31-
expect(community_link).toHaveAttribute('href', 'https://binary.vanillacommunity.com/');
32+
expect(community_link).toHaveAttribute('href', 'https://deriv.vanillacommunity.com/');
3233
});
33-
it('should render the button inside community link properly', () => {
34-
const community_link = screen.getByTestId('community-link');
35-
const { getByRole } = within(community_link);
36-
const button = getByRole('button');
37-
expect(button).toHaveTextContent('Join our community');
34+
it('should render telegram link properly', () => {
35+
const telegram_link = screen.getByRole('link', { name: 'Telegram' });
36+
expect(telegram_link).toBeInTheDocument();
37+
expect(telegram_link).toHaveAttribute('href', 'https://t.me/+g6FV5tFY1u9lZGE1');
3838
});
3939
it('should render footer body texts properly', () => {
4040
const help_text = screen.getByText(/^we're here to help$/i);

src/components/Footer/index.tsx

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,27 @@ const Footer = () => {
1212
<p className={styles.FooterBodyContent}>
1313
Discuss ideas and share solutions with developers worldwide.
1414
</p>
15-
<a
16-
data-testid='community-link'
17-
style={{ textDecoration: 'none' }}
18-
href='https://binary.vanillacommunity.com/'
19-
target='_blank'
20-
rel='noreferrer'
21-
>
22-
<button className={styles.communityButton}>Join our community</button>
23-
</a>
15+
<div className={styles.Communities}>
16+
<a
17+
href='https://deriv.vanillacommunity.com/'
18+
target='_blank'
19+
rel='noreferrer'
20+
className={styles.communityButton}
21+
>
22+
<span>Join our community</span>
23+
</a>
24+
<a
25+
href='https://t.me/+g6FV5tFY1u9lZGE1'
26+
target='_blank'
27+
rel='noreferrer'
28+
className={styles.communityButton}
29+
>
30+
<div className={styles.Telegram}>
31+
<img src='/img/telegram.svg' className={styles.TelegramIcon} />
32+
<p>Telegram</p>
33+
</div>
34+
</a>
35+
</div>
2436
</section>
2537
<section className={styles.FooterBody}>
2638
<Text type='subtitle-1' as='h2' align='center' className={styles.FooterContent}>

static/img/slack.svg

Lines changed: 13 additions & 0 deletions
Loading

static/img/telegram.svg

Lines changed: 3 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)