Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: ci

on:
pull_request:

jobs:
ci:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install dependencies
run: npm ci
working-directory: next

- name: Run Biome format check
run: ./node_modules/.bin/biome format .
working-directory: next
2 changes: 1 addition & 1 deletion next/axios.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ export const setAccessToken = (token) => {
if (!token || token === "null")
return (axiosInstance.defaults.headers.common["Authorization"] = null);
axiosInstance.defaults.headers.common["Authorization"] = `Token ${token}`;
};
};
45 changes: 45 additions & 0 deletions next/biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
"vcs": {
"enabled": false,
"clientKind": "git",
"useIgnoreFile": false
},
"files": {
"ignoreUnknown": false,
"ignore": []
},
"formatter": {
"enabled": true,
"indentStyle": "space",
"ignore": [".next/"]
},
"organizeImports": {
"enabled": true
},
"linter": {
"enabled": false,
"ignore": [".next/"],
"rules": {
"recommended": true
}
},
"javascript": {
"formatter": {
"enabled": true
}
},
"json": {
"formatter": {
"enabled": false
}
},
"css": {
"linter": {
"enabled": false
},
"formatter": {
"enabled": false
}
}
}
10 changes: 4 additions & 6 deletions next/components/atoms/Button.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import {
Box,
} from "@chakra-ui/react";
import { Box } from "@chakra-ui/react";

export default function Button({ children, onClick, ...props }) {
return (
Expand All @@ -23,11 +21,11 @@ export default function Button({ children, onClick, ...props }) {
gap="8px"
lineHeight="20px"
_hover={{
backgroundColor:"#22703E"
backgroundColor: "#22703E",
}}
{...props}
>
{children}
</Box>
)
}
);
}
21 changes: 10 additions & 11 deletions next/components/atoms/Carousel.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
import { Swiper, SwiperSlide } from "swiper/react";
import { Navigation, Pagination, Autoplay, Mousewheel } from "swiper";


import "swiper/css";
import "swiper/css/navigation";
import "swiper/css/pagination";
import "swiper/css/autoplay";

export default function Carousel({ settings, children }) {
return (
<Swiper modules={[Navigation, Pagination, Autoplay, Mousewheel]} {...settings}>
{children && children.map((elm, i)=> {
return (
<SwiperSlide key={i}>
{elm}
</SwiperSlide>
)
})}
<Swiper
modules={[Navigation, Pagination, Autoplay, Mousewheel]}
{...settings}
>
{children &&
children.map((elm, i) => {
return <SwiperSlide key={i}>{elm}</SwiperSlide>;
})}
</Swiper>
)
}
);
}
10 changes: 1 addition & 9 deletions next/components/atoms/CategoryIcon.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
import { Image } from "@chakra-ui/react";

export function CategoryIcon({ url, active, size = "50px", ...style }) {
return (
<Image
width={size}
height={size}
border="0px"
src={url}
{...style}
/>
);
return <Image width={size} height={size} border="0px" src={url} {...style} />;
}
40 changes: 22 additions & 18 deletions next/components/atoms/Checkbox.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
import {
Checkbox,
Icon
} from '@chakra-ui/react';
import { Checkbox, Icon } from "@chakra-ui/react";

function CustomCheckbockIcon({ variant, isIndeterminate, isChecked, ...props }) {
function CustomCheckbockIcon({
variant,
isIndeterminate,
isChecked,
...props
}) {
function variantIcon() {
if(isIndeterminate) return "M5.06135 11.0002C4.76599 11.0002 4.51496 10.9029 4.30826 10.7084C4.10157 10.514 3.99823 10.2778 3.99823 9.99984C3.99823 9.72193 4.10157 9.48573 4.30826 9.29124C4.51496 9.09676 4.76599 8.99951 5.06135 8.99951H14.9391C15.2344 8.99951 15.4855 9.09676 15.6922 9.29124C15.8988 9.48573 16.0022 9.72193 16.0022 9.99984C16.0022 10.2778 15.8988 10.514 15.6922 10.7084C15.4855 10.9029 15.2344 11.0002 14.9391 11.0002H5.06135Z"
return "M7.17894 10.9259L13.306 4.7988C13.5043 4.60057 13.7378 4.50146 14.0068 4.50146C14.2758 4.50146 14.5094 4.60057 14.7076 4.7988C14.9058 4.99702 15.0049 5.23196 15.0049 5.50364C15.0049 5.7753 14.9058 6.01024 14.7076 6.20846L7.87972 13.0444C7.6815 13.2427 7.44791 13.3418 7.17894 13.3418C6.90998 13.3418 6.67639 13.2427 6.47817 13.0444L3.2943 9.86058C3.09609 9.66236 2.99834 9.42742 3.00103 9.15576C3.00373 8.88408 3.10418 8.64914 3.30241 8.45091C3.50063 8.25269 3.73557 8.15358 4.00725 8.15358C4.27891 8.15358 4.51385 8.25269 4.71207 8.45091L7.17894 10.9259Z"
if (isIndeterminate)
return "M5.06135 11.0002C4.76599 11.0002 4.51496 10.9029 4.30826 10.7084C4.10157 10.514 3.99823 10.2778 3.99823 9.99984C3.99823 9.72193 4.10157 9.48573 4.30826 9.29124C4.51496 9.09676 4.76599 8.99951 5.06135 8.99951H14.9391C15.2344 8.99951 15.4855 9.09676 15.6922 9.29124C15.8988 9.48573 16.0022 9.72193 16.0022 9.99984C16.0022 10.2778 15.8988 10.514 15.6922 10.7084C15.4855 10.9029 15.2344 11.0002 14.9391 11.0002H5.06135Z";
return "M7.17894 10.9259L13.306 4.7988C13.5043 4.60057 13.7378 4.50146 14.0068 4.50146C14.2758 4.50146 14.5094 4.60057 14.7076 4.7988C14.9058 4.99702 15.0049 5.23196 15.0049 5.50364C15.0049 5.7753 14.9058 6.01024 14.7076 6.20846L7.87972 13.0444C7.6815 13.2427 7.44791 13.3418 7.17894 13.3418C6.90998 13.3418 6.67639 13.2427 6.47817 13.0444L3.2943 9.86058C3.09609 9.66236 2.99834 9.42742 3.00103 9.15576C3.00373 8.88408 3.10418 8.64914 3.30241 8.45091C3.50063 8.25269 3.73557 8.15358 4.00725 8.15358C4.27891 8.15358 4.51385 8.25269 4.71207 8.45091L7.17894 10.9259Z";
}

return (
Expand All @@ -19,16 +22,21 @@ function CustomCheckbockIcon({ variant, isIndeterminate, isChecked, ...props })
viewBox={isIndeterminate ? "0 0 16 18" : "0 0 18 18"}
_focus={{
boxShadow: "none",
outline: "none"
outline: "none",
}}
{...props}
>
<path fill="currentColor" d={variantIcon()} />
</Icon>
)
);
}

export default function CustomCheckbox({ children, hasIndeterminate = false , icon, ...props}) {
export default function CustomCheckbox({
children,
hasIndeterminate = false,
icon,
...props
}) {
return (
<Checkbox
width="20px"
Expand All @@ -44,16 +52,12 @@ export default function CustomCheckbox({ children, hasIndeterminate = false , ic
}}
_focus={{
boxShadow: "none",
outline: "none"
outline: "none",
}}
icon={
<CustomCheckbockIcon
{...icon}
/>
}
icon={<CustomCheckbockIcon {...icon} />}
{...props}
>
{children}
</Checkbox>
)
}
);
}
46 changes: 24 additions & 22 deletions next/components/atoms/ControlledInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
InputGroup,
InputRightAddon,
InputRightElement,
InputLeftElement
InputLeftElement,
} from "@chakra-ui/react";
import { useEffect, useState } from "react";

Expand Down Expand Up @@ -36,20 +36,20 @@ export function ControlledInput({
onChange={(e) => onChange(e.target.value)}
onKeyDown={checkForEnter}
variant="outline"
padding={{base: "24px 48px 24px 20px", lg: "24px 64px 24px 32px"}}
height={{base: "50px", lg: "80px"}}
padding={{ base: "24px 48px 24px 20px", lg: "24px 64px 24px 32px" }}
height={{ base: "50px", lg: "80px" }}
backgroundColor="#FFFFFF"
borderRadius={{base: "18px", lg: "25px"}}
borderRadius={{ base: "18px", lg: "25px" }}
placeholder={placeholder}
_placeholder={{
color: "#717571"
color: "#717571",
}}
boxShadow="0 1px 8px 1px rgba(64, 60, 67, 0.16) !important"
border="0"
fontFamily="Roboto"
fontWeight="400"
fontSize={{base: "16px", lg: "20px"}}
lineHeight={{base: "24px", lg: "30px"}}
fontSize={{ base: "16px", lg: "20px" }}
lineHeight={{ base: "24px", lg: "30px" }}
color="#252A32"
{...inputStyle}
/>
Expand All @@ -76,16 +76,18 @@ export function DebouncedSimpleControlledInput({
fill,
...props
}) {
const [skipFirstDebounced, setSkipFirstDebounced] = useState(true)
const [skipFirstDebounced, setSkipFirstDebounced] = useState(true);
const [_value, _setValue] = useState(value);
const [_timeout, _setTimeout] = useState(null);

useEffect(() => {
clearTimeout(_timeout);
_setTimeout(setTimeout(() => {
if(!skipFirstDebounced) onChange(_value)
setSkipFirstDebounced(false)
}, 1000));
_setTimeout(
setTimeout(() => {
if (!skipFirstDebounced) onChange(_value);
setSkipFirstDebounced(false);
}, 1000),
);
}, [_value]);

useEffect(() => {
Expand Down Expand Up @@ -118,11 +120,11 @@ export function DebouncedSimpleControlledInput({
border="2px solid transparent !important"
color="#464A51"
_hover={{
border:"2px solid transparent !important",
backgroundColor:"#DEDFE0",
border: "2px solid transparent !important",
backgroundColor: "#DEDFE0",
}}
_focus={{
border:"2px solid #0068C5 !important",
border: "2px solid #0068C5 !important",
backgroundColor: "#FFF",
}}
paddingLeft="52px !important"
Expand All @@ -134,7 +136,7 @@ export function DebouncedSimpleControlledInput({
fontFamily="Roboto"
fontWeight="400"
borderRadius="14px"
_placeholder={{color: "#464A51", opacity: 1}}
_placeholder={{ color: "#464A51", opacity: 1 }}
{...inputStyle}
/>
</InputGroup>
Expand Down Expand Up @@ -191,11 +193,11 @@ export function ControlledInputSimple({
border="2px solid transparent !important"
color="#464A51"
_hover={{
border:"2px solid transparent !important",
backgroundColor:"#DEDFE0",
border: "2px solid transparent !important",
backgroundColor: "#DEDFE0",
}}
_focus={{
border:"2px solid #0068C5 !important",
border: "2px solid #0068C5 !important",
backgroundColor: "#FFF",
}}
paddingLeft="52px !important"
Expand All @@ -207,9 +209,9 @@ export function ControlledInputSimple({
fontFamily="Roboto"
fontWeight="400"
borderRadius="14px"
_placeholder={{color: "#464A51", opacity: 1}}
_placeholder={{ color: "#464A51", opacity: 1 }}
{...inputStyle}
/>
</InputGroup>
)
}
);
}
4 changes: 2 additions & 2 deletions next/components/atoms/DatasetCardTag.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Link from './Link';
import { Tag } from '@chakra-ui/react';
import Link from "./Link";
import { Tag } from "@chakra-ui/react";

export function DatasetCardTag({ slug, name, locale, ...props }) {
return (
Expand Down
7 changes: 4 additions & 3 deletions next/components/atoms/DomainComponent.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { useRouter } from 'next/router';
import { useRouter } from "next/router";

export default function DomainComponent({ domains = [], children }) {
const router = useRouter();
const hostname = typeof window !== 'undefined' ? window.location.hostname : '';
const hostname =
typeof window !== "undefined" ? window.location.hostname : "";

// Check if current hostname matches any of the allowed domains
const shouldRender = domains.includes(hostname);

return shouldRender ? children : null;
}
}
Loading