Skip to content

Commit

Permalink
Format code
Browse files Browse the repository at this point in the history
  • Loading branch information
majakomel committed Aug 1, 2024
1 parent dfbe154 commit 924c229
Show file tree
Hide file tree
Showing 32 changed files with 622 additions and 492 deletions.
16 changes: 8 additions & 8 deletions components/NavBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ const LanguageSelect = (props) => (
/>
)

const StyledNavItem = ({isActive, ...props}) => (
const StyledNavItem = ({ isActive, ...props }) => (
<Link
className={`
className={`
block
cursor-pointer
text-white
Expand All @@ -39,8 +39,8 @@ const StyledNavItem = ({isActive, ...props}) => (
hover:border-b-2
hover:border-white
${isActive ? 'pb-[4px] opacity-100 border-b-2 border-white' : 'pb-[6px] opacity-60'}`}
{...props}
/>
{...props}
/>
)

const NavItem = ({ label, href, ...props }) => {
Expand All @@ -52,7 +52,9 @@ const NavItem = ({ label, href, ...props }) => {
}, [pathname, href])

return (
<StyledNavItem isActive={isActive} href={href} {...props}>{label}</StyledNavItem>
<StyledNavItem isActive={isActive} href={href} {...props}>
{label}
</StyledNavItem>
)
}

Expand Down Expand Up @@ -84,9 +86,7 @@ export const NavBar = ({ color }) => {
}, [pathname])

return (
<div
className={`${color} z-[8888] py-4`}
>
<div className={`${color} z-[8888] py-4`}>
<div className="container">
<div className="flex flex-row justify-between items-end">
<div className="z-[1] mb-1">
Expand Down
230 changes: 115 additions & 115 deletions components/as/Loader.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import ContentLoader from 'react-content-loader'

const Loader = (props) => (
<ContentLoader
<ContentLoader
speed={1}
width={1249}
height={1477}
Expand All @@ -10,121 +10,121 @@ const Loader = (props) => (
foregroundColor="#ecebeb"
{...props}
>
<rect x="2" y="977" rx="4" ry="4" width="1247" height="500" />
<rect x="2" y="977" rx="4" ry="4" width="1247" height="500" />
<rect x="319" y="382" rx="4" ry="4" width="19" height="19" />
<rect x="319" y="382" rx="4" ry="4" width="19" height="19" />
<rect x="274" y="450" rx="4" ry="4" width="19" height="19" />
<rect x="274" y="450" rx="4" ry="4" width="19" height="19" />
<rect x="137" y="404" rx="4" ry="4" width="19" height="19" />
<rect x="137" y="404" rx="4" ry="4" width="19" height="19" />
<rect x="159" y="427" rx="4" ry="4" width="19" height="19" />
<rect x="159" y="427" rx="4" ry="4" width="19" height="19" />
<rect x="183" y="518" rx="4" ry="4" width="19" height="19" />
<rect x="183" y="518" rx="4" ry="4" width="19" height="19" />
<rect x="183" y="473" rx="4" ry="4" width="19" height="19" />
<rect x="183" y="473" rx="4" ry="4" width="19" height="19" />
<rect x="159" y="496" rx="4" ry="4" width="19" height="19" />
<rect x="159" y="496" rx="4" ry="4" width="19" height="19" />
<rect x="159" y="382" rx="4" ry="4" width="19" height="19" />
<rect x="159" y="382" rx="4" ry="4" width="19" height="19" />
<rect x="183" y="450" rx="4" ry="4" width="19" height="19" />
<rect x="183" y="450" rx="4" ry="4" width="19" height="19" />
<rect x="455" y="404" rx="4" ry="4" width="19" height="19" />
<rect x="455" y="404" rx="4" ry="4" width="19" height="19" />
<rect x="433" y="427" rx="4" ry="4" width="19" height="19" />
<rect x="433" y="427" rx="4" ry="4" width="19" height="19" />
<rect x="478" y="473" rx="4" ry="4" width="19" height="19" />
<rect x="478" y="473" rx="4" ry="4" width="19" height="19" />
<rect x="387" y="473" rx="4" ry="4" width="19" height="19" />
<rect x="387" y="473" rx="4" ry="4" width="19" height="19" />
<rect x="501" y="427" rx="4" ry="4" width="19" height="19" />
<rect x="501" y="427" rx="4" ry="4" width="19" height="19" />
<rect x="433" y="382" rx="4" ry="4" width="19" height="19" />
<rect x="433" y="382" rx="4" ry="4" width="19" height="19" />
<rect x="364" y="450" rx="4" ry="4" width="19" height="19" />
<rect x="364" y="450" rx="4" ry="4" width="19" height="19" />
<rect x="46" y="427" rx="4" ry="4" width="19" height="19" />
<rect x="46" y="427" rx="4" ry="4" width="19" height="19" />
<rect x="23" y="427" rx="4" ry="4" width="19" height="19" />
<rect x="23" y="427" rx="4" ry="4" width="19" height="19" />
<rect x="46" y="518" rx="4" ry="4" width="19" height="19" />
<rect x="46" y="518" rx="4" ry="4" width="19" height="19" />
<rect x="46" y="473" rx="4" ry="4" width="19" height="19" />
<rect x="46" y="473" rx="4" ry="4" width="19" height="19" />
<rect x="23" y="496" rx="4" ry="4" width="19" height="19" />
<rect x="23" y="496" rx="4" ry="4" width="19" height="19" />
<rect x="23" y="382" rx="4" ry="4" width="19" height="19" />
<rect x="23" y="382" rx="4" ry="4" width="19" height="19" />
<rect x="23" y="450" rx="4" ry="4" width="19" height="19" />
<rect x="23" y="450" rx="4" ry="4" width="19" height="19" />
<rect x="69" y="404" rx="4" ry="4" width="19" height="19" />
<rect x="69" y="404" rx="4" ry="4" width="19" height="19" />
<rect x="69" y="427" rx="4" ry="4" width="19" height="19" />
<rect x="69" y="427" rx="4" ry="4" width="19" height="19" />
<rect x="69" y="518" rx="4" ry="4" width="19" height="19" />
<rect x="69" y="518" rx="4" ry="4" width="19" height="19" />
<rect x="69" y="473" rx="4" ry="4" width="19" height="19" />
<rect x="69" y="473" rx="4" ry="4" width="19" height="19" />
<rect x="69" y="496" rx="4" ry="4" width="19" height="19" />
<rect x="69" y="496" rx="4" ry="4" width="19" height="19" />
<rect x="69" y="382" rx="4" ry="4" width="19" height="19" />
<rect x="69" y="382" rx="4" ry="4" width="19" height="19" />
<rect x="69" y="450" rx="4" ry="4" width="19" height="19" />
<rect x="69" y="450" rx="4" ry="4" width="19" height="19" />
<rect x="92" y="405" rx="4" ry="4" width="19" height="19" />
<rect x="92" y="405" rx="4" ry="4" width="19" height="19" />
<rect x="114" y="427" rx="4" ry="4" width="19" height="19" />
<rect x="114" y="427" rx="4" ry="4" width="19" height="19" />
<rect x="114" y="518" rx="4" ry="4" width="19" height="19" />
<rect x="114" y="518" rx="4" ry="4" width="19" height="19" />
<rect x="137" y="473" rx="4" ry="4" width="19" height="19" />
<rect x="137" y="473" rx="4" ry="4" width="19" height="19" />
<rect x="114" y="496" rx="4" ry="4" width="19" height="19" />
<rect x="114" y="496" rx="4" ry="4" width="19" height="19" />
<rect x="92" y="382" rx="4" ry="4" width="19" height="19" />
<rect x="92" y="382" rx="4" ry="4" width="19" height="19" />
<rect x="92" y="450" rx="4" ry="4" width="19" height="19" />
<rect x="92" y="450" rx="4" ry="4" width="19" height="19" />
<rect x="205" y="427" rx="4" ry="4" width="19" height="19" />
<rect x="205" y="427" rx="4" ry="4" width="19" height="19" />
<rect x="228" y="450" rx="4" ry="4" width="19" height="19" />
<rect x="228" y="450" rx="4" ry="4" width="19" height="19" />
<rect x="251" y="404" rx="4" ry="4" width="19" height="19" />
<rect x="251" y="404" rx="4" ry="4" width="19" height="19" />
<rect x="251" y="427" rx="4" ry="4" width="19" height="19" />
<rect x="251" y="427" rx="4" ry="4" width="19" height="19" />
<rect x="296" y="382" rx="4" ry="4" width="19" height="19" />
<rect x="296" y="382" rx="4" ry="4" width="19" height="19" />
<rect x="319" y="427" rx="4" ry="4" width="19" height="19" />
<rect x="319" y="427" rx="4" ry="4" width="19" height="19" />
<rect x="410" y="405" rx="4" ry="4" width="19" height="19" />
<rect x="410" y="405" rx="4" ry="4" width="19" height="19" />
<rect x="387" y="382" rx="4" ry="4" width="19" height="19" />
<rect x="387" y="382" rx="4" ry="4" width="19" height="19" />
<rect x="364" y="382" rx="4" ry="4" width="19" height="19" />
<rect x="364" y="382" rx="4" ry="4" width="19" height="19" />
<rect x="296" y="404" rx="4" ry="4" width="19" height="19" />
<rect x="296" y="404" rx="4" ry="4" width="19" height="19" />
<rect x="341" y="404" rx="4" ry="4" width="19" height="19" />
<rect x="341" y="404" rx="4" ry="4" width="19" height="19" />
<rect x="2" y="45" rx="4" ry="4" width="193" height="148" />
<rect x="2" y="45" rx="4" ry="4" width="193" height="148" />
<rect x="213" y="45" rx="4" ry="4" width="193" height="148" />
<rect x="213" y="45" rx="4" ry="4" width="193" height="148" />
<rect x="0" y="0" rx="15" ry="15" width="471" height="30" />
<rect x="0" y="284" rx="27" ry="27" width="725" height="54" />
<rect x="0" y="230" rx="15" ry="15" width="133" height="30" />
<rect x="3" y="612" rx="2" ry="2" width="1249" height="3" />
<rect x="1" y="664" rx="15" ry="15" width="237" height="30" />
<rect x="0" y="842" rx="15" ry="15" width="122" height="30" />
<rect x="1" y="741" rx="7" ry="7" width="324" height="14" />
<rect x="0" y="947" rx="7" ry="7" width="492" height="14" />
<rect x="1" y="765" rx="15" ry="15" width="595" height="30" />
<rect x="1" y="882" rx="15" ry="15" width="595" height="30" />
<rect x="1" y="546" rx="11" ry="11" width="294" height="22" />
<rect x="2" y="977" rx="4" ry="4" width="1247" height="500" />
<rect x="2" y="977" rx="4" ry="4" width="1247" height="500" />
<rect x="319" y="382" rx="4" ry="4" width="19" height="19" />
<rect x="319" y="382" rx="4" ry="4" width="19" height="19" />
<rect x="274" y="450" rx="4" ry="4" width="19" height="19" />
<rect x="274" y="450" rx="4" ry="4" width="19" height="19" />
<rect x="137" y="404" rx="4" ry="4" width="19" height="19" />
<rect x="137" y="404" rx="4" ry="4" width="19" height="19" />
<rect x="159" y="427" rx="4" ry="4" width="19" height="19" />
<rect x="159" y="427" rx="4" ry="4" width="19" height="19" />
<rect x="183" y="518" rx="4" ry="4" width="19" height="19" />
<rect x="183" y="518" rx="4" ry="4" width="19" height="19" />
<rect x="183" y="473" rx="4" ry="4" width="19" height="19" />
<rect x="183" y="473" rx="4" ry="4" width="19" height="19" />
<rect x="159" y="496" rx="4" ry="4" width="19" height="19" />
<rect x="159" y="496" rx="4" ry="4" width="19" height="19" />
<rect x="159" y="382" rx="4" ry="4" width="19" height="19" />
<rect x="159" y="382" rx="4" ry="4" width="19" height="19" />
<rect x="183" y="450" rx="4" ry="4" width="19" height="19" />
<rect x="183" y="450" rx="4" ry="4" width="19" height="19" />
<rect x="455" y="404" rx="4" ry="4" width="19" height="19" />
<rect x="455" y="404" rx="4" ry="4" width="19" height="19" />
<rect x="433" y="427" rx="4" ry="4" width="19" height="19" />
<rect x="433" y="427" rx="4" ry="4" width="19" height="19" />
<rect x="478" y="473" rx="4" ry="4" width="19" height="19" />
<rect x="478" y="473" rx="4" ry="4" width="19" height="19" />
<rect x="387" y="473" rx="4" ry="4" width="19" height="19" />
<rect x="387" y="473" rx="4" ry="4" width="19" height="19" />
<rect x="501" y="427" rx="4" ry="4" width="19" height="19" />
<rect x="501" y="427" rx="4" ry="4" width="19" height="19" />
<rect x="433" y="382" rx="4" ry="4" width="19" height="19" />
<rect x="433" y="382" rx="4" ry="4" width="19" height="19" />
<rect x="364" y="450" rx="4" ry="4" width="19" height="19" />
<rect x="364" y="450" rx="4" ry="4" width="19" height="19" />
<rect x="46" y="427" rx="4" ry="4" width="19" height="19" />
<rect x="46" y="427" rx="4" ry="4" width="19" height="19" />
<rect x="23" y="427" rx="4" ry="4" width="19" height="19" />
<rect x="23" y="427" rx="4" ry="4" width="19" height="19" />
<rect x="46" y="518" rx="4" ry="4" width="19" height="19" />
<rect x="46" y="518" rx="4" ry="4" width="19" height="19" />
<rect x="46" y="473" rx="4" ry="4" width="19" height="19" />
<rect x="46" y="473" rx="4" ry="4" width="19" height="19" />
<rect x="23" y="496" rx="4" ry="4" width="19" height="19" />
<rect x="23" y="496" rx="4" ry="4" width="19" height="19" />
<rect x="23" y="382" rx="4" ry="4" width="19" height="19" />
<rect x="23" y="382" rx="4" ry="4" width="19" height="19" />
<rect x="23" y="450" rx="4" ry="4" width="19" height="19" />
<rect x="23" y="450" rx="4" ry="4" width="19" height="19" />
<rect x="69" y="404" rx="4" ry="4" width="19" height="19" />
<rect x="69" y="404" rx="4" ry="4" width="19" height="19" />
<rect x="69" y="427" rx="4" ry="4" width="19" height="19" />
<rect x="69" y="427" rx="4" ry="4" width="19" height="19" />
<rect x="69" y="518" rx="4" ry="4" width="19" height="19" />
<rect x="69" y="518" rx="4" ry="4" width="19" height="19" />
<rect x="69" y="473" rx="4" ry="4" width="19" height="19" />
<rect x="69" y="473" rx="4" ry="4" width="19" height="19" />
<rect x="69" y="496" rx="4" ry="4" width="19" height="19" />
<rect x="69" y="496" rx="4" ry="4" width="19" height="19" />
<rect x="69" y="382" rx="4" ry="4" width="19" height="19" />
<rect x="69" y="382" rx="4" ry="4" width="19" height="19" />
<rect x="69" y="450" rx="4" ry="4" width="19" height="19" />
<rect x="69" y="450" rx="4" ry="4" width="19" height="19" />
<rect x="92" y="405" rx="4" ry="4" width="19" height="19" />
<rect x="92" y="405" rx="4" ry="4" width="19" height="19" />
<rect x="114" y="427" rx="4" ry="4" width="19" height="19" />
<rect x="114" y="427" rx="4" ry="4" width="19" height="19" />
<rect x="114" y="518" rx="4" ry="4" width="19" height="19" />
<rect x="114" y="518" rx="4" ry="4" width="19" height="19" />
<rect x="137" y="473" rx="4" ry="4" width="19" height="19" />
<rect x="137" y="473" rx="4" ry="4" width="19" height="19" />
<rect x="114" y="496" rx="4" ry="4" width="19" height="19" />
<rect x="114" y="496" rx="4" ry="4" width="19" height="19" />
<rect x="92" y="382" rx="4" ry="4" width="19" height="19" />
<rect x="92" y="382" rx="4" ry="4" width="19" height="19" />
<rect x="92" y="450" rx="4" ry="4" width="19" height="19" />
<rect x="92" y="450" rx="4" ry="4" width="19" height="19" />
<rect x="205" y="427" rx="4" ry="4" width="19" height="19" />
<rect x="205" y="427" rx="4" ry="4" width="19" height="19" />
<rect x="228" y="450" rx="4" ry="4" width="19" height="19" />
<rect x="228" y="450" rx="4" ry="4" width="19" height="19" />
<rect x="251" y="404" rx="4" ry="4" width="19" height="19" />
<rect x="251" y="404" rx="4" ry="4" width="19" height="19" />
<rect x="251" y="427" rx="4" ry="4" width="19" height="19" />
<rect x="251" y="427" rx="4" ry="4" width="19" height="19" />
<rect x="296" y="382" rx="4" ry="4" width="19" height="19" />
<rect x="296" y="382" rx="4" ry="4" width="19" height="19" />
<rect x="319" y="427" rx="4" ry="4" width="19" height="19" />
<rect x="319" y="427" rx="4" ry="4" width="19" height="19" />
<rect x="410" y="405" rx="4" ry="4" width="19" height="19" />
<rect x="410" y="405" rx="4" ry="4" width="19" height="19" />
<rect x="387" y="382" rx="4" ry="4" width="19" height="19" />
<rect x="387" y="382" rx="4" ry="4" width="19" height="19" />
<rect x="364" y="382" rx="4" ry="4" width="19" height="19" />
<rect x="364" y="382" rx="4" ry="4" width="19" height="19" />
<rect x="296" y="404" rx="4" ry="4" width="19" height="19" />
<rect x="296" y="404" rx="4" ry="4" width="19" height="19" />
<rect x="341" y="404" rx="4" ry="4" width="19" height="19" />
<rect x="341" y="404" rx="4" ry="4" width="19" height="19" />
<rect x="2" y="45" rx="4" ry="4" width="193" height="148" />
<rect x="2" y="45" rx="4" ry="4" width="193" height="148" />
<rect x="213" y="45" rx="4" ry="4" width="193" height="148" />
<rect x="213" y="45" rx="4" ry="4" width="193" height="148" />
<rect x="0" y="0" rx="15" ry="15" width="471" height="30" />
<rect x="0" y="284" rx="27" ry="27" width="725" height="54" />
<rect x="0" y="230" rx="15" ry="15" width="133" height="30" />
<rect x="3" y="612" rx="2" ry="2" width="1249" height="3" />
<rect x="1" y="664" rx="15" ry="15" width="237" height="30" />
<rect x="0" y="842" rx="15" ry="15" width="122" height="30" />
<rect x="1" y="741" rx="7" ry="7" width="324" height="14" />
<rect x="0" y="947" rx="7" ry="7" width="492" height="14" />
<rect x="1" y="765" rx="15" ry="15" width="595" height="30" />
<rect x="1" y="882" rx="15" ry="15" width="595" height="30" />
<rect x="1" y="546" rx="11" ry="11" width="294" height="22" />
<rect x="809" y="546" rx="11" ry="11" width="440" height="22" />
</ContentLoader>
)

export default Loader
export default Loader
44 changes: 32 additions & 12 deletions components/chart/Slices.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,31 @@ const SlicesItem = ({ slice, axis, debug, tooltip, isCurrent, setCurrent }) => {
const { showTooltipFromEvent, hideTooltip } = useTooltip()

const handleMouseEnter = useCallback(
event => {
showTooltipFromEvent(createElement(tooltip, { slice, axis }), event, 'right')
(event) => {
showTooltipFromEvent(
createElement(tooltip, { slice, axis }),
event,
'right',
)
setCurrent(slice)
},
[showTooltipFromEvent, tooltip, slice]
[showTooltipFromEvent, tooltip, slice],
)

const handleMouseMove = useCallback(
event => {
showTooltipFromEvent(createElement(tooltip, { slice, axis }), event, 'right')
(event) => {
showTooltipFromEvent(
createElement(tooltip, { slice, axis }),
event,
'right',
)
},
[showTooltipFromEvent, tooltip, slice]
[showTooltipFromEvent, tooltip, slice],
)

const handleMouseLeave = useCallback(() => {
hideTooltip()
setCurrent(null)
hideTooltip()
setCurrent(null)
}, [hideTooltip])

return (
Expand All @@ -43,11 +51,23 @@ const SlicesItem = ({ slice, axis, debug, tooltip, isCurrent, setCurrent }) => {
}

const Slices = (props) => {
const { width, axis, debug, height, tooltip, sliceTooltip, currentSlice, setCurrentSlice, points, enableSlices, debugSlices } = props
const {
width,
axis,
debug,
height,
tooltip,
sliceTooltip,
currentSlice,
setCurrentSlice,
points,
enableSlices,
debugSlices,
} = props

const map = new Map()

points.forEach(point => {
points.forEach((point) => {
if (point.data.x === null || point.data.y === null) return
if (new Date(point.data.x).getMinutes() !== 0) return
if (!map.has(point.x)) map.set(point.x, [point])
Expand Down Expand Up @@ -80,7 +100,7 @@ const Slices = (props) => {
}
})

return slices.map(slice => (
return slices.map((slice) => (
<SlicesItem
key={slice.id}
slice={slice}
Expand All @@ -95,4 +115,4 @@ const Slices = (props) => {
))
}

export default Slices
export default Slices
Loading

0 comments on commit 924c229

Please sign in to comment.