Skip to content

Commit cb905d0

Browse files
committed
Updated the code with the original structure
1 parent a6a485e commit cb905d0

File tree

4 files changed

+11
-22
lines changed

4 files changed

+11
-22
lines changed

components/buttons/ButtonLink/ButtonLink.module.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@
1818
}
1919

2020
// Color scheme variations
21-
&.invertedGrey {
21+
&.inverted-grey {
2222
&:hover {
2323
color: var(--color-primary-content);
2424
background-color: var(--color-transparent);
2525
}
2626
}
2727

28-
&.invertedWhite {
28+
&.inverted-white {
2929
border: 1px solid var(--color-white);
3030
color: var(--color-primary-content);
3131
background-color: var(--color-white);

components/buttons/ButtonLink/index.js

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,12 @@ import styles from './ButtonLink.module.scss';
33
export default function ButtonLink({
44
link,
55
children,
6-
$colorScheme,
6+
customBtnClass,
77
openNewTab,
8-
className,
98
}) {
10-
let buttonClass = styles.buttonLink;
11-
12-
if ($colorScheme === 'inverted-grey') {
13-
buttonClass += ` ${styles.invertedGrey}`;
14-
} else if ($colorScheme === 'inverted-white') {
15-
buttonClass += ` ${styles.invertedWhite}`;
16-
}
17-
18-
if (className) {
19-
buttonClass += ` ${className}`;
20-
}
9+
const buttonClass = customBtnClass
10+
? `${styles.buttonLink} ${styles[customBtnClass]}`
11+
: styles.buttonLink;
2112

2213
return (
2314
<a

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>

0 commit comments

Comments
 (0)