Skip to content

Commit 6461d76

Browse files
Merge pull request #144 from Web-Dev-Path/feature/contact-us-card
Added "Contact Us Cards" section to Contact page
2 parents 6e7365b + 8680fff commit 6461d76

File tree

11 files changed

+116
-19
lines changed

11 files changed

+116
-19
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
5555
- contact form functionalities (email form using sendgrid, subscription if selected, google recaptcha)
5656
- who we are section to about page
5757
- still got questions section to about page
58-
58+
- Contact us cards section to contact page
5959

6060

6161
### Fixed

components/ContactUsCards.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import contactCardStyles from '@/styles/ContactUsCards.module.scss';
2+
import CardsColumns from './containers/CardsColumns';
3+
import RevealContentContainer from './containers/RevealContentContainer';
4+
5+
export default function ContactUsCards() {
6+
return (
7+
<div className={contactCardStyles.contactCards}>
8+
<RevealContentContainer>
9+
<CardsColumns
10+
titles={['FAQ', 'Blog', 'Repository']}
11+
images={[
12+
'/images/svg/faq-icon.svg',
13+
'/images/svg/blog-icon.svg',
14+
'/images/svg/repository-icon.svg',
15+
]}
16+
altTags={['FAQ', 'Blog', 'Repository']}
17+
content={[
18+
'Find the main questions about the project.',
19+
'Share your projects and ideas with our community.',
20+
'Check out our codebase and guidelines.',
21+
]}
22+
links={[
23+
'https://github.com/Web-Dev-Path/web-dev-path/wiki/FAQ',
24+
'/blog',
25+
'https://github.com/Web-Dev-Path/web-dev-path',
26+
]}
27+
linkText={['Our FAQ', 'Our Blog', 'Our Repository']}
28+
customClass='contact-cards'
29+
/>
30+
</RevealContentContainer>
31+
</div>
32+
);
33+
}

components/containers/Card.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@ export default function Card({
1111
linkText,
1212
customClass,
1313
}) {
14+
const LinkComponent = link?.startsWith('http') ? (
15+
<a href={link} target='_blank' rel='noopener noreferrer'>
16+
{linkText}
17+
</a>
18+
) : (
19+
<Link href={link}>{linkText}</Link>
20+
);
1421
return (
1522
<div
1623
className={
@@ -32,7 +39,7 @@ export default function Card({
3239
<h2 className={styles.title}>{title}</h2>
3340
<div className={styles.content}>
3441
<p>
35-
{content} {link && <Link href={link}>{linkText}</Link>}
42+
{content} {link && LinkComponent}
3643
</p>
3744
</div>
3845
</div>

components/containers/CardsColumns.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Swiper, SwiperSlide } from 'swiper/react';
2-
import { Pagination, Navigation } from 'swiper';
2+
import { Pagination } from 'swiper';
33
import 'swiper/css';
44
import 'swiper/css/pagination';
55
import 'swiper/css/navigation';

pages/contact.js

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,33 @@
11
import { useState } from 'react';
22
import { ContactUsFormSubscribe } from '@/components/ContactUsForm';
3+
import ContactUsCards from '@/components/ContactUsCards';
34
import contactUsFormStyles from '@/styles/Contact.module.scss';
45
import Bracket from '@/components/decorations/Bracket';
56

67
export default function ContactUs() {
78
const [message, setMessage] = useState([]);
89

910
return (
10-
<div className={contactUsFormStyles.contact}>
11-
<div className={contactUsFormStyles.contact__formAndDecorations}>
12-
<Bracket className={contactUsFormStyles.contact__yellowBracket} />
13-
<ContactUsFormSubscribe setMsg={setMessage} />
14-
<img
15-
src='/images/svg/yellow-colon.svg'
16-
className={contactUsFormStyles.contact__yellowColon}
17-
/>
18-
<div className={contactUsFormStyles.contact__response_message}>
19-
{message?.map((m, i) => (
20-
<span key={i}>
21-
{m}
22-
<br />
23-
</span>
24-
))}
11+
<>
12+
<div className={contactUsFormStyles.contact}>
13+
<div className={contactUsFormStyles.contact__formAndDecorations}>
14+
<Bracket className={contactUsFormStyles.contact__yellowBracket} />
15+
<ContactUsFormSubscribe setMsg={setMessage} />
16+
<img
17+
src='/images/svg/yellow-colon.svg'
18+
className={contactUsFormStyles.contact__yellowColon}
19+
/>
20+
<div className={contactUsFormStyles.contact__response_message}>
21+
{message?.map((m, i) => (
22+
<span key={i}>
23+
{m}
24+
<br />
25+
</span>
26+
))}
27+
</div>
2528
</div>
2629
</div>
27-
</div>
30+
<ContactUsCards />
31+
</>
2832
);
2933
}

public/images/svg/blog-icon.svg

Lines changed: 6 additions & 0 deletions
Loading

public/images/svg/faq-icon.svg

Lines changed: 5 additions & 0 deletions
Loading

public/images/svg/repository-icon.svg

Lines changed: 7 additions & 0 deletions
Loading

styles/Card.module.scss

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,4 +88,29 @@
8888
}
8989
}
9090
}
91+
92+
// Contact us cards
93+
&.contact-cards {
94+
height: 27rem;
95+
background-color: $white;
96+
97+
@include desktop {
98+
height: 25rem;
99+
}
100+
101+
.card__image {
102+
width: auto;
103+
position: relative;
104+
height: 5rem;
105+
margin-right: 75%;
106+
margin-top: 3rem;
107+
margin-bottom: 3rem;
108+
109+
.img {
110+
margin: 0;
111+
position: absolute;
112+
object-fit: contain !important;
113+
}
114+
}
115+
}
91116
}

styles/Contact.module.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
background-color: $light-bg-color;
66
height: 42rem;
77
position: relative;
8+
margin-bottom: -10rem;
9+
@include mobile {
10+
margin-bottom: 3rem;
11+
}
812

913
&__formAndDecorations {
1014
@include tablet {

0 commit comments

Comments
 (0)