Skip to content

Commit 281852d

Browse files
uinstinctaditya-mitra
authored andcommitted
added jsonconfig.json to resolve absolute imports
used directly export default in components added absolute imports in projects and landing configured absolute patehs for about and footer containers configured absolute container imports in pages/index.js used relative z-index in skillmouse movements used pointer enter instead of mouse enter in project/index.js
1 parent 63d9731 commit 281852d

File tree

16 files changed

+129
-143
lines changed

16 files changed

+129
-143
lines changed

containers/About/aboutMe.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import NextImage from 'next/image';
22

33
import { useColorMode } from "@chakra-ui/core";
44

5-
import styles from "../../styles/aboutMe";
5+
import styles from "@/styles/aboutMe";
66

7-
function AboutMe({title, subTitle, description, image, status}) {
7+
export default function AboutMe({title, subTitle, description, image, status}) {
88
const { colorMode } = useColorMode();
99
return (
1010
<>
@@ -30,6 +30,4 @@ function AboutMe({title, subTitle, description, image, status}) {
3030
</div>
3131
</>
3232
);
33-
}
34-
35-
export default AboutMe;
33+
}

containers/About/deviceChange.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
import styles from "../../styles/deviceChange";
2-
function DeviceChange() {
1+
import styles from "@/styles/deviceChange";
2+
3+
export default function DeviceChange() {
34
return (
45
<>
56
<style jsx>
@@ -20,6 +21,4 @@ function DeviceChange() {
2021
</div>
2122
</>
2223
);
23-
}
24-
25-
export default DeviceChange;
24+
}

containers/About/index.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@ import { useColorMode } from "@chakra-ui/core";
22

33
import DeviceChange from "./deviceChange";
44
import AboutMe from "./aboutMe";
5-
65
import constants from "./constants";
76

8-
import styles from "../../styles/aboutContainer";
7+
import styles from "@/styles/aboutContainer";
98

10-
function About() {
9+
export default function About() {
1110
const { colorMode } = useColorMode();
1211
return (
1312
<>
@@ -22,6 +21,4 @@ function About() {
2221
</div>
2322
</>
2423
);
25-
}
26-
27-
export default About;
24+
}

containers/Footer/index.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ import { useEffect } from 'react';
33
import constants from "./constants";
44

55
import {useColorMode, Link, Icon } from "@chakra-ui/core";
6-
import styles from "../../styles/footer";
6+
import styles from "@/styles/footer";
77

88

9-
function Footer() {
9+
export default function Footer() {
1010
const { colorMode } = useColorMode();
1111

1212
useEffect(() => {
@@ -70,6 +70,4 @@ function Footer() {
7070
</footer>
7171
</>
7272
);
73-
}
74-
75-
export default Footer;
73+
}

containers/Landing/header.js

Lines changed: 23 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import { useState, useEffect } from 'react';
22

3-
import styles, { mouser } from '../../styles/header';
3+
import styles, { mouser } from '@/styles/header';
44

5-
function Header() {
5+
export default function Header() {
66

77
const [isMounted, setMounted] = useState(false);
88

99
useEffect(() => {
1010
setTimeout(() => {
11-
setMounted(true);
11+
setMounted(true);
1212
}, 2000);
1313
}, []);
1414

@@ -21,27 +21,25 @@ function Header() {
2121
<div className="scrollball" />
2222
</div>
2323
</>;
24-
25-
return (
26-
<>
27-
<style jsx>
28-
{styles}
29-
</style>
30-
<div className="container">
31-
<div className="box">
32-
<div className="title">
33-
<span className="block"></span>
34-
<h1>Aditya Mitra<span /></h1>
35-
</div>
36-
<div className="role">
37-
<div className="block" />
38-
<p>UInstinct</p>
24+
25+
return (
26+
<>
27+
<style jsx>
28+
{styles}
29+
</style>
30+
<div className="container">
31+
<div className="box">
32+
<div className="title">
33+
<span className="block"></span>
34+
<h1>Aditya Mitra<span /></h1>
35+
</div>
36+
<div className="role">
37+
<div className="block" />
38+
<p>UInstinct</p>
3939
</div>
4040
</div>
41-
{isMounted ? mouseTrans : null}
42-
</div>
43-
</>
44-
);
45-
}
46-
47-
export default Header;
41+
{isMounted ? mouseTrans : null}
42+
</div>
43+
</>
44+
);
45+
}

containers/Landing/index.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import Header from './header';
22
import Navbar from './navbar';
33

4-
import styles from "../../styles/landing";
4+
import styles from "@/styles/landing";
55

6-
function LandingContainer() {
6+
export default function LandingContainer() {
77
return (
88
<>
99
<span id="pageLanding" style={{ visibility: "hidden" }} />
@@ -16,6 +16,4 @@ function LandingContainer() {
1616
</div>
1717
</>
1818
);
19-
}
20-
21-
export default LandingContainer;
19+
}

containers/Landing/modeSwitch.js

Lines changed: 29 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,36 @@
1-
import { useEffect } from "react";
2-
import { useColorMode } from "@chakra-ui/core";
3-
4-
import { Tooltip } from "@chakra-ui/core";
5-
import styles from '../../styles/modeSwitch';
6-
7-
function ModeSwitch() {
8-
const { colorMode, toggleColorMode } = useColorMode();
9-
useEffect(() => {
10-
if (colorMode === "dark") {
11-
document.body.setAttribute("data-theme", "dark");
12-
} else {
13-
document.body.setAttribute("data-theme", "light");
14-
}
15-
}, [colorMode]);
16-
return (
17-
<>
18-
<style jsx>
19-
{styles}
1+
import { useEffect } from "react";
2+
3+
import { Tooltip, useColorMode } from "@chakra-ui/core";
4+
import styles from '@/styles/modeSwitch';
5+
6+
export default function ModeSwitch() {
7+
const { colorMode, toggleColorMode } = useColorMode();
8+
useEffect(() => {
9+
if (colorMode === "dark") {
10+
document.body.setAttribute("data-theme", "dark");
11+
} else {
12+
document.body.setAttribute("data-theme", "light");
13+
}
14+
}, [colorMode]);
15+
return (
16+
<>
17+
<style jsx>
18+
{styles}
2019
</style>
21-
<Tooltip
22-
label={`click to change to ${colorMode === "dark" ? "dark" : "light"} mode`}
23-
hasArrow
24-
bg={colorMode === "dark" ? "white" : "black"}
25-
color={colorMode === "dark" ? "black" : "white"}
26-
>
20+
<Tooltip
21+
label={`click to change to ${colorMode === "dark" ? "dark" : "light"} mode`}
22+
hasArrow
23+
bg={colorMode === "dark" ? "white" : "black"}
24+
color={colorMode === "dark" ? "black" : "white"}
25+
>
2726
<div className="container">
2827
<input
2928
className="l" id="modeSwitch"
30-
type="checkbox"
29+
type="checkbox"
3130
checked={colorMode === "dark"}
3231
onChange={toggleColorMode} />
33-
</div>
32+
</div>
3433
</Tooltip>
35-
</>
36-
);
37-
}
38-
39-
export default ModeSwitch;
34+
</>
35+
);
36+
}

containers/Landing/navbar.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import {
77
Button, Link,
88
Menu, MenuButton, MenuList, MenuItem
99
} from "@chakra-ui/core";
10-
import styles from "../../styles/navbar";
10+
import styles from "@/styles/navbar";
1111

12-
function Navbar() {
12+
export default function Navbar() {
1313
const { colorMode } = useColorMode();
1414

1515
useEffect(() => {
@@ -109,6 +109,4 @@ function Navbar() {
109109
</nav>
110110
</>
111111
);
112-
}
113-
114-
export default Navbar;
112+
}

containers/Projects/card.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ import {
1010
Tag, TagLabel, TagRightIcon
1111
} from '@chakra-ui/core';
1212

13-
import { allStyles, itemStyles, bulletStyles } from "../../styles/card";
13+
import { allStyles, itemStyles, bulletStyles } from "@/styles/card";
1414
import { glossColour, glossIcon } from "./constants";
1515

16-
function Card({ sourceItems, links, stacks }) {
16+
export default function Card({ sourceItems, links, stacks }) {
1717

1818
const { colorMode } = useColorMode();
1919
const uniqueMark = sourceItems[0].id;
@@ -161,6 +161,4 @@ function Card({ sourceItems, links, stacks }) {
161161
</div>
162162
</>
163163
);
164-
}
165-
166-
export default Card;
164+
}

containers/Projects/index.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import constants from "./constants";
22
import Card from "./card";
33
import { showSwipeGuide } from "./cardMouseMovements";
44

5-
function Projects() {
5+
export default function Projects() {
66

77
let count = 1;
88
const cards = constants.map((constant, idx) => {
@@ -15,12 +15,10 @@ function Projects() {
1515
});
1616
return (
1717
<div
18-
onMouseEnter={showSwipeGuide}
18+
onPointerEnter={showSwipeGuide}
1919
>
2020
<h1 id="myProjects" className="container-header">My Projects</h1>
2121
{cards}
2222
</div>
2323
);
24-
}
25-
26-
export default Projects;
24+
}

0 commit comments

Comments
 (0)