Skip to content

Commit 2fcbb79

Browse files
Merge pull request #244 from Web-Dev-Path/main
Update: Merge current main(prod) to refactor/styles-migration
2 parents cd73343 + e47c876 commit 2fcbb79

File tree

9 files changed

+59
-67
lines changed

9 files changed

+59
-67
lines changed

CHANGELOG.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,5 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
156156
- Updated husky script to avoid warning
157157

158158
### Changed
159-
160159
- Started migrating styles from Styled Components to CSS Modules (ContactUsCard)
161-
160+
- CSS Modules Migration for ButtonLink

components/blog/BlogPostContainer/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const BlogPostContainer = ({ post, relatedPosts, latestPosts }) => {
3333
$contentType='questions'
3434
link='/contact'
3535
linkText='Contact us'
36-
$btnColorScheme='inverted-grey'
36+
customBtnClass='inverted-grey'
3737
/>
3838
</RevealContentContainer>
3939
</>
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
.buttonLink {
2+
padding: 0.5rem 2rem;
3+
color: var(--color-white);
4+
background-color: var(--color-primary-content);
5+
border-radius: 2rem;
6+
cursor: pointer;
7+
font-weight: bold;
8+
font-size: 1.5rem;
9+
text-align: center;
10+
min-width: 16rem;
11+
display: inline-block;
12+
border: 1px solid var(--color-primary-content);
13+
text-decoration: none;
14+
transition: all 0.3s ease;
15+
16+
&:hover {
17+
text-decoration: none;
18+
}
19+
20+
// Color scheme variations
21+
&.inverted-grey {
22+
&:hover {
23+
color: var(--color-primary-content);
24+
background-color: var(--color-transparent);
25+
}
26+
}
27+
28+
&.inverted-white {
29+
border: 1px solid var(--color-white);
30+
color: var(--color-primary-content);
31+
background-color: var(--color-white);
32+
33+
&:hover {
34+
color: var(--color-white);
35+
background-color: var(--color-transparent);
36+
}
37+
}
38+
}
Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
1-
import S from './styles';
1+
import styles from './ButtonLink.module.scss';
22

3-
/* The component supports the use of target with the property "openNewTab" to open the
4-
link in a new tab.*/
53
export default function ButtonLink({
64
link,
75
children,
8-
$colorScheme,
6+
customBtnClass,
97
openNewTab,
108
}) {
9+
const buttonClass = customBtnClass
10+
? `${styles.buttonLink} ${styles[customBtnClass]}`
11+
: styles.buttonLink;
12+
1113
return (
12-
<S.ButtonLink
14+
<a
1315
href={link}
14-
$colorScheme={$colorScheme}
16+
className={buttonClass}
1517
target={openNewTab ? '_blank' : undefined}
1618
rel='noopener noreferrer'
1719
>
1820
{children}
19-
</S.ButtonLink>
21+
</a>
2022
);
2123
}

components/buttons/ButtonLink/styles.js

Lines changed: 0 additions & 47 deletions
This file was deleted.

components/containers/TwoColumn/index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ export default function TwoColumn({
1111
bgColor,
1212
link,
1313
customBtnClass,
14-
$btnColorScheme,
1514
linkText = 'Learn more',
1615
secondTextColumn,
1716
openNewTab,
@@ -35,7 +34,7 @@ export default function TwoColumn({
3534
{link && (
3635
<ButtonLink
3736
link={link}
38-
$colorScheme={$btnColorScheme}
37+
customBtnClass={customBtnClass}
3938
openNewTab={openNewTab}
4039
>
4140
{linkText}

pages/about.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import { whoWeAre } from '@/utils/about';
1010
import { useTheme } from 'styled-components';
1111

1212
export default function AboutUs() {
13-
1413
const theme = useTheme();
1514

1615
return (
@@ -166,7 +165,7 @@ export default function AboutUs() {
166165
linkText='Our wiki'
167166
openNewTab
168167
link='https://github.com/Web-Dev-Path/web-dev-path/wiki'
169-
$btnColorScheme='inverted-grey'
168+
customBtnClass='inverted-grey'
170169
color={theme.colors.primaryContent}
171170
bgColor={theme.colors.lightBg}
172171
$contentType='two-text-columns'
@@ -181,7 +180,7 @@ export default function AboutUs() {
181180
}
182181
linkText='Contact us'
183182
link='/contact'
184-
$btnColorScheme='inverted-grey'
183+
customBtnClass='inverted-grey'
185184
color={theme.colors.primaryContent}
186185
bgColor={theme.colors.lightBg}
187186
$contentType='second-text-column'
@@ -224,7 +223,7 @@ export default function AboutUs() {
224223
$contentType='get-started'
225224
link='mailto:[email protected]'
226225
linkText='Ping us'
227-
$btnColorScheme='inverted-grey'
226+
customBtnClass='inverted-grey'
228227
/>
229228
</RevealContentContainer>
230229
<RevealContentContainer>
@@ -261,7 +260,7 @@ export default function AboutUs() {
261260
$contentType='questions'
262261
link='/contact'
263262
linkText='Contact us'
264-
$btnColorScheme='inverted-grey'
263+
customBtnClass='inverted-grey'
265264
/>
266265
</RevealContentContainer>
267266
</div>

pages/index.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import RevealContentContainer from '@/components/containers/RevealContentContain
55
import { useTheme } from 'styled-components';
66

77
export default function Home() {
8-
98
const theme = useTheme();
109
return (
1110
<>
@@ -16,7 +15,7 @@ export default function Home() {
1615
altTag='Join the project'
1716
content='Web Dev Path is an open-source initiative that provides hands-on experience in a simulated professional environment to people who seek to begin or move forward in their web development journey.'
1817
link='/about'
19-
$btnColorScheme='inverted-grey'
18+
customBtnClass='inverted-grey'
2019
bgColor={theme.colors.lightBg}
2120
/>
2221
</RevealContentContainer>
@@ -76,7 +75,7 @@ export default function Home() {
7675
bgColor={theme.colors.primaryContent}
7776
link='/about'
7877
$contentType='non-profit'
79-
$btnColorScheme='inverted-white'
78+
customBtnClass='inverted-white'
8079
/>
8180
</RevealContentContainer>
8281
</>

styles/themes.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
:root {
22
--bg-contact-card: #ffffff;
33
--bg-color: #eaeaea;
4+
--color-white: #ffffff;
5+
--color-primary-content: #292929;
6+
--color-transparent: transparent;
47
}
58

69
// placeholder colors

0 commit comments

Comments
 (0)