Skip to content

Commit 7868190

Browse files
refactor: update wheel to svg (#38)
1 parent c0ff666 commit 7868190

File tree

17 files changed

+324
-272
lines changed

17 files changed

+324
-272
lines changed

src/components/MoonIcon/MoonIcon.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ function MoonIcon({
2323
<path
2424
d="M3.32031 11.6835C3.32031 16.6541 7.34975 20.6835 12.3203 20.6835C16.1075 20.6835 19.3483 18.3443 20.6768 15.032C19.6402 15.4486 18.5059 15.6834 17.3203 15.6834C12.3497 15.6834 8.32031 11.654 8.32031 6.68342C8.32031 5.50338 8.55165 4.36259 8.96453 3.32996C5.65605 4.66028 3.32031 7.89912 3.32031 11.6835Z"
2525
stroke={textColor}
26-
stroke-width="2"
27-
stroke-linecap="round"
28-
stroke-linejoin="round"
26+
strokeWidth="2"
27+
strokeLinecap="round"
28+
strokeLinejoin="round"
2929
/>
3030
</Styled.Sun>
3131
);

src/components/SunIcon/SunIcon.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ function SunIcon({
2323
<path
2424
d="M12 3V4M12 20V21M4 12H3M6.31412 6.31412L5.5 5.5M17.6859 6.31412L18.5 5.5M6.31412 17.69L5.5 18.5001M17.6859 17.69L18.5 18.5001M21 12H20M16 12C16 14.2091 14.2091 16 12 16C9.79086 16 8 14.2091 8 12C8 9.79086 9.79086 8 12 8C14.2091 8 16 9.79086 16 12Z"
2525
stroke={textColor}
26-
stroke-width="2"
27-
stroke-linecap="round"
28-
stroke-linejoin="round"
26+
strokeWidth="2"
27+
strokeLinecap="round"
28+
strokeLinejoin="round"
2929
/>
3030
</Styled.Sun>
3131
);

src/emotion.d.ts

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,21 @@ declare module '@emotion/react' {
2222
normal: string;
2323
contrast: string;
2424
};
25-
primary: string;
26-
secondary: string;
27-
tertiary: string;
25+
primary: {
26+
dim: string;
27+
normal: string;
28+
contrast: string;
29+
};
30+
secondary: {
31+
dim: string;
32+
normal: string;
33+
contrast: string;
34+
};
35+
tertiary: {
36+
dim: string;
37+
normal: string;
38+
contrast: string;
39+
};
2840
};
2941
};
3042
}

src/pages/home/Home.styled.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import TasksQueueBase from './sections/TasksQueue/TasksQueue.tsx';
88
import MicroTasksQueueBase from './sections/MicroTasksQueue/MicroTasksQueue.tsx';
99
import InfoBase from './sections/Info/Info.tsx';
1010
import ConfiguratorBase from './sections/Configurator/Configurator.tsx';
11-
import EventLoopBase from './sections/Wheel/Wheel.tsx';
11+
import EventLoopBase from 'pages/home/sections/EventLoop/EventLoop.tsx';
1212

1313
export const sharedColumnStyles = ({ theme }: { theme: Theme }) => css`
1414
display: flex;

src/pages/home/sections/Wheel/Wheel.modal.tsx renamed to src/pages/home/sections/EventLoop/EventLoop.modal.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import * as Styled from './Wheel.styled.ts';
1+
import * as Styled from './EventLoop.styled.ts';
22
import InfoModal from 'components/Modal/Modal.tsx';
33

4-
function WheelModal({
4+
function EventLoopModal({
55
isOpened,
66
toggle,
77
}: {
@@ -38,4 +38,4 @@ function WheelModal({
3838
);
3939
}
4040

41-
export default WheelModal;
41+
export default EventLoopModal;
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import styled from '@emotion/styled';
2+
import InfoClosed from 'components/CloseIcon/InfoIcon.tsx';
3+
4+
export const CloseIcon = styled(InfoClosed)`
5+
position: absolute;
6+
top: 16px;
7+
right: 16px;
8+
`;
9+
10+
export const EventLoopBody = styled.div`
11+
display: flex;
12+
flex-direction: column;
13+
align-items: center;
14+
justify-content: center;
15+
flex: 1;
16+
padding-top: 10px;
17+
`;
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import * as Styled from './EventLoop.styled.ts';
2+
import InfoIcon from 'components/InfoIcon/InfoIcon.tsx';
3+
import useBoolean from 'utils/hooks/useBoolean.ts';
4+
import { BaseLayoutElement } from 'pages/home/Home.styled.ts';
5+
import { EVENT_LOOP_ID } from 'utils/constants.ts';
6+
import EventLoopModal from './EventLoop.modal.tsx';
7+
import Wheel from 'pages/home/sections/EventLoop/Wheel/Wheel.tsx';
8+
9+
function EventLoop({ className }: { className?: string }) {
10+
const [isOpened, toggle] = useBoolean(false);
11+
12+
return (
13+
<BaseLayoutElement className={className}>
14+
<p id={EVENT_LOOP_ID}>Event Loop</p>
15+
<Styled.EventLoopBody>
16+
<InfoIcon onClick={toggle} />
17+
<Wheel />
18+
<EventLoopModal isOpened={isOpened} toggle={toggle} />
19+
</Styled.EventLoopBody>
20+
</BaseLayoutElement>
21+
);
22+
}
23+
24+
export default EventLoop;
File renamed without changes.

src/pages/home/sections/Wheel/Wheel.data.ts renamed to src/pages/home/sections/EventLoop/Wheel/Wheel.data.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { EventInterface } from './Wheel.types.ts';
1+
import { EventInterface } from '../EventLoop.types.ts';
22

33
export const events: EventInterface[] = [
44
{

src/pages/home/sections/Wheel/Wheel.styled.ts renamed to src/pages/home/sections/EventLoop/Wheel/Wheel.styled.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import styled from '@emotion/styled';
22
import { css } from '@emotion/react';
3-
import InfoClosed from 'components/CloseIcon/InfoIcon.tsx';
43

54
export const CircleContainer = styled.div(
65
({ theme }) => css`
@@ -79,18 +78,3 @@ export const Sector = styled.div<{
7978
}
8079
`;
8180
});
82-
83-
export const CloseIcon = styled(InfoClosed)`
84-
position: absolute;
85-
top: 16px;
86-
right: 16px;
87-
`;
88-
89-
export const EventLoopBody = styled.div`
90-
display: flex;
91-
flex-direction: column;
92-
align-items: center;
93-
justify-content: center;
94-
flex: 1;
95-
padding-top: 10px;
96-
`;

0 commit comments

Comments
 (0)