Skip to content

Commit c370fc1

Browse files
FireeagSainirohit-saini1anmode
authored
add prettier config file (amupedia2021#33)
* add prettier config file * Update .prettierignore added yarn.lock Co-authored-by: rohit.saini1 <[email protected]> Co-authored-by: Anmol Agrawal <[email protected]>
1 parent 0b185fb commit c370fc1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+4557
-4465
lines changed

Diff for: .prettierignore

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package.json
2+
package-lock.json
3+
yarn.lock
4+
5+
*.md
6+
*.svg
7+
*.lock

Diff for: .prettierrc

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"printWidth": 80,
3+
"tabWidth": 2,
4+
"useTabs": false,
5+
"semi": true,
6+
"singleQuote": false,
7+
"quoteProps": "as-needed",
8+
"jsxSingleQuote": false,
9+
"trailingComma": "es5",
10+
"bracketSpacing": true,
11+
"bracketSameLine": false,
12+
"arrowParens": "always",
13+
"rangeStart": 0,
14+
"proseWrap": "preserve",
15+
"htmlWhitespaceSensitivity": "css",
16+
"endOfLine": "lf",
17+
"embeddedLanguageFormatting": "auto"
18+
}

Diff for: .vscode/settings.json

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
{
2-
"marquee.widgets.npm-stats.packageNames": [
3-
"amupedia"
4-
]
5-
}
2+
"marquee.widgets.npm-stats.packageNames": ["amupedia"]
3+
}

Diff for: components/Alert.js

+55-55
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,64 @@
1-
import { Store } from 'utils/Store/Store';
2-
import { useContext, useState } from 'react';
3-
import styles from '@styles/scss/alert.module.scss';
1+
import { Store } from "utils/Store/Store";
2+
import { useContext, useState } from "react";
3+
import styles from "@styles/scss/alert.module.scss";
44
import {
5-
faExclamationCircle,
6-
faExclamationTriangle,
7-
faBell,
8-
} from 'node_modules/@fortawesome/free-solid-svg-icons/index';
9-
import { FontAwesomeIcon } from 'node_modules/@fortawesome/react-fontawesome/index';
10-
import Link from 'node_modules/next/link';
5+
faExclamationCircle,
6+
faExclamationTriangle,
7+
faBell,
8+
} from "node_modules/@fortawesome/free-solid-svg-icons/index";
9+
import { FontAwesomeIcon } from "node_modules/@fortawesome/react-fontawesome/index";
10+
import Link from "node_modules/next/link";
1111

1212
const Alert = () => {
13-
const { state, dispatch } = useContext(Store);
14-
const { alert } = state;
15-
const [toNull, setToNull] = useState(false);
13+
const { state, dispatch } = useContext(Store);
14+
const { alert } = state;
15+
const [toNull, setToNull] = useState(false);
1616

17-
const alertUtil = {
18-
error: faExclamationCircle,
19-
warning: faExclamationTriangle,
20-
noti: faBell,
21-
};
17+
const alertUtil = {
18+
error: faExclamationCircle,
19+
warning: faExclamationTriangle,
20+
noti: faBell,
21+
};
2222

23-
const alertOff = () => {
24-
setToNull(true);
25-
setTimeout(() => {
26-
dispatch({ type: { task: 'setAlert', alert: null } });
27-
setToNull(false);
28-
}, 250);
29-
};
23+
const alertOff = () => {
24+
setToNull(true);
25+
setTimeout(() => {
26+
dispatch({ type: { task: "setAlert", alert: null } });
27+
setToNull(false);
28+
}, 250);
29+
};
3030

31-
return (
32-
<>
33-
{alert && (
34-
<div className={`${styles.main} ${toNull && styles.main_hide}`}>
35-
<div className={styles.body}>
36-
<div className={styles.content}>
37-
<span
38-
className={`${styles.icon}
39-
${alert.type === 'error' && styles.error}
40-
${alert.type === 'warning' && styles.warning}
41-
${alert.type === 'noti' && styles.noti}`}
42-
>
43-
<FontAwesomeIcon icon={alertUtil[alert.type]} />
44-
</span>
45-
<span>{alert.message}</span>
46-
</div>
47-
<button onClick={alertOff}>&times;</button>
48-
{alert.link && alert.link.type === 'external' ? (
49-
<a href={alert.link.url}>{alert.link.text}</a>
50-
) : (
51-
alert.link && (
52-
<Link href={alert.link.url} passHref>
53-
<a>{alert.link.text}</a>
54-
</Link>
55-
)
56-
)}
57-
</div>
58-
</div>
59-
)}
60-
</>
61-
);
31+
return (
32+
<>
33+
{alert && (
34+
<div className={`${styles.main} ${toNull && styles.main_hide}`}>
35+
<div className={styles.body}>
36+
<div className={styles.content}>
37+
<span
38+
className={`${styles.icon}
39+
${alert.type === "error" && styles.error}
40+
${alert.type === "warning" && styles.warning}
41+
${alert.type === "noti" && styles.noti}`}
42+
>
43+
<FontAwesomeIcon icon={alertUtil[alert.type]} />
44+
</span>
45+
<span>{alert.message}</span>
46+
</div>
47+
<button onClick={alertOff}>&times;</button>
48+
{alert.link && alert.link.type === "external" ? (
49+
<a href={alert.link.url}>{alert.link.text}</a>
50+
) : (
51+
alert.link && (
52+
<Link href={alert.link.url} passHref>
53+
<a>{alert.link.text}</a>
54+
</Link>
55+
)
56+
)}
57+
</div>
58+
</div>
59+
)}
60+
</>
61+
);
6262
};
6363

6464
export default Alert;

Diff for: components/BlogCard.js

+43-43
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,48 @@
1-
import styles from '@styles/scss/blogcard.module.scss';
2-
import Image from 'next/image';
3-
import dataScienceImg from '@images/blog/dataScience.jpg';
4-
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
5-
import { faThumbsUp, faComment } from '@fortawesome/free-solid-svg-icons';
6-
import Link from 'next/link';
1+
import styles from "@styles/scss/blogcard.module.scss";
2+
import Image from "next/image";
3+
import dataScienceImg from "@images/blog/dataScience.jpg";
4+
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
5+
import { faThumbsUp, faComment } from "@fortawesome/free-solid-svg-icons";
6+
import Link from "next/link";
77

88
const BlogCard = (props) => {
9-
const { id, image, comments, likes } = props;
10-
return (
11-
<>
12-
<Link
13-
href={`/blog/${id == undefined ? (id == null ? '' : id) : id}`}
14-
passHref
15-
>
16-
<div className={styles.cover}>
17-
<div className={styles.image}>
18-
<Image src={dataScienceImg} alt="data-science-amupedia-blogs" />
19-
</div>
20-
<h3 className={styles.title}>
21-
How to become a data scientist in no time
22-
</h3>
23-
<div className={styles.blogfooter}>
24-
<span className={styles.author}>Author</span>
25-
<div className={styles.info}>
26-
<span className={styles.likes}>
27-
{likes}
28-
<FontAwesomeIcon
29-
icon={faThumbsUp}
30-
className={`${styles.icon} ${styles.likesIcon}`}
31-
/>
32-
</span>
33-
<span className={styles.comments}>
34-
{comments}
35-
<FontAwesomeIcon
36-
icon={faComment}
37-
className={`${styles.icon} ${styles.commentsIcon}`}
38-
/>
39-
</span>
40-
</div>
41-
</div>
42-
</div>
43-
</Link>
44-
</>
45-
);
9+
const { id, image, comments, likes } = props;
10+
return (
11+
<>
12+
<Link
13+
href={`/blog/${id == undefined ? (id == null ? "" : id) : id}`}
14+
passHref
15+
>
16+
<div className={styles.cover}>
17+
<div className={styles.image}>
18+
<Image src={dataScienceImg} alt="data-science-amupedia-blogs" />
19+
</div>
20+
<h3 className={styles.title}>
21+
How to become a data scientist in no time
22+
</h3>
23+
<div className={styles.blogfooter}>
24+
<span className={styles.author}>Author</span>
25+
<div className={styles.info}>
26+
<span className={styles.likes}>
27+
{likes}
28+
<FontAwesomeIcon
29+
icon={faThumbsUp}
30+
className={`${styles.icon} ${styles.likesIcon}`}
31+
/>
32+
</span>
33+
<span className={styles.comments}>
34+
{comments}
35+
<FontAwesomeIcon
36+
icon={faComment}
37+
className={`${styles.icon} ${styles.commentsIcon}`}
38+
/>
39+
</span>
40+
</div>
41+
</div>
42+
</div>
43+
</Link>
44+
</>
45+
);
4646
};
4747

4848
export default BlogCard;

Diff for: components/Footer.js

+60-60
Original file line numberDiff line numberDiff line change
@@ -6,66 +6,66 @@ import { faTwitterSquare } from "node_modules/@fortawesome/free-brands-svg-icons
66
import { faLinkedin } from "node_modules/@fortawesome/free-brands-svg-icons/index";
77

88
const Footer = () => {
9-
return (
10-
<footer id="footer">
11-
<div id={styles.above_bg}>
12-
<p>Folow Us On</p>
13-
<div id={styles.icons}>
14-
<a
15-
href="https://www.instagram.com/amu.pedia/?hl=am-et"
16-
target="_blank"
17-
rel="noreferrer"
18-
>
19-
<FontAwesomeIcon
20-
icon={faInstagramSquare}
21-
size="2x"
22-
inverse
23-
className={styles.icon}
24-
/>
25-
</a>
26-
<a
27-
href="https://www.facebook.com/AMUPedia"
28-
target="_blank"
29-
rel="noreferrer"
30-
>
31-
<FontAwesomeIcon
32-
icon={faFacebookSquare}
33-
size="2x"
34-
inverse
35-
className={styles.icon}
36-
/>
37-
</a>
38-
<a
39-
href="https://twitter.com/AmuPedia?t=PEHmP10PAymk6gsTykKtAQ&s=08"
40-
target="_blank"
41-
rel="noreferrer"
42-
>
43-
<FontAwesomeIcon
44-
icon={faTwitterSquare}
45-
size="2x"
46-
inverse
47-
className={styles.icon}
48-
/>
49-
</a>
50-
<a
51-
href="https://in.linkedin.com/company/amupedia"
52-
target="_blank"
53-
rel="noreferrer"
54-
>
55-
<FontAwesomeIcon
56-
icon={faLinkedin}
57-
size="2x"
58-
inverse
59-
className={styles.icon}
60-
/>
61-
</a>
62-
</div>
63-
</div>
64-
<div id={styles.ftbg}>
65-
66-
</div>
67-
</footer>
68-
);
9+
return (
10+
<footer id="footer">
11+
<div id={styles.above_bg}>
12+
<p>Folow Us On</p>
13+
<div id={styles.icons}>
14+
<a
15+
href="https://www.instagram.com/amu.pedia/?hl=am-et"
16+
target="_blank"
17+
rel="noreferrer"
18+
>
19+
<FontAwesomeIcon
20+
icon={faInstagramSquare}
21+
size="2x"
22+
inverse
23+
className={styles.icon}
24+
/>
25+
</a>
26+
<a
27+
href="https://www.facebook.com/AMUPedia"
28+
target="_blank"
29+
rel="noreferrer"
30+
>
31+
<FontAwesomeIcon
32+
icon={faFacebookSquare}
33+
size="2x"
34+
inverse
35+
className={styles.icon}
36+
/>
37+
</a>
38+
<a
39+
href="https://twitter.com/AmuPedia?t=PEHmP10PAymk6gsTykKtAQ&s=08"
40+
target="_blank"
41+
rel="noreferrer"
42+
>
43+
<FontAwesomeIcon
44+
icon={faTwitterSquare}
45+
size="2x"
46+
inverse
47+
className={styles.icon}
48+
/>
49+
</a>
50+
<a
51+
href="https://in.linkedin.com/company/amupedia"
52+
target="_blank"
53+
rel="noreferrer"
54+
>
55+
<FontAwesomeIcon
56+
icon={faLinkedin}
57+
size="2x"
58+
inverse
59+
className={styles.icon}
60+
/>
61+
</a>
62+
</div>
63+
</div>
64+
<div id={styles.ftbg}>
65+
66+
</div>
67+
</footer>
68+
);
6969
};
7070

7171
export default Footer;

0 commit comments

Comments
 (0)