Skip to content

Commit b93ebea

Browse files
Merge branch 'master' into update-kanvas-logos
2 parents b27b925 + 5cc5c15 commit b93ebea

7 files changed

Lines changed: 897 additions & 170 deletions

File tree

src/components/SistentNavigation/content.js

Lines changed: 93 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -17,121 +17,125 @@ export const content = [
1717
{ id: 12, link: "/projects/sistent/identity/typography/code", text: "Typography" },
1818

1919
// Components
20-
{ id: 13, link: "/projects/sistent/components/backdrop", text: "Backdrop" },
21-
{ id: 14, link: "/projects/sistent/components/backdrop/guidance", text: "Backdrop" },
22-
{ id: 15, link: "/projects/sistent/components/backdrop/code", text: "Backdrop" },
20+
{ id: 13, link: "/projects/sistent/components/accordion", text: "Accordion" },
21+
{ id: 14, link: "/projects/sistent/components/accordion/guidance", text: "Accordion" },
22+
{ id: 15, link: "/projects/sistent/components/accordion/code", text: "Accordion" },
2323

24-
{ id: 16, link: "/projects/sistent/components/badge", text: "Badge" },
25-
{ id: 17, link: "/projects/sistent/components/badge/guidance", text: "Badge" },
26-
{ id: 18, link: "/projects/sistent/components/badge/code", text: "Badge" },
24+
{ id: 16, link: "/projects/sistent/components/backdrop", text: "Backdrop" },
25+
{ id: 17, link: "/projects/sistent/components/backdrop/guidance", text: "Backdrop" },
26+
{ id: 18, link: "/projects/sistent/components/backdrop/code", text: "Backdrop" },
2727

28-
{ id: 19, link: "/projects/sistent/components/box", text: "Box" },
29-
{ id: 20, link: "/projects/sistent/components/box/guidance", text: "Box" },
30-
{ id: 21, link: "/projects/sistent/components/box/code", text: "Box" },
28+
{ id: 19, link: "/projects/sistent/components/badge", text: "Badge" },
29+
{ id: 20, link: "/projects/sistent/components/badge/guidance", text: "Badge" },
30+
{ id: 21, link: "/projects/sistent/components/badge/code", text: "Badge" },
3131

32-
{ id: 22, link: "/projects/sistent/components/button", text: "Button" },
33-
{ id: 23, link: "/projects/sistent/components/button/guidance", text: "Button" },
34-
{ id: 24, link: "/projects/sistent/components/button/code", text: "Button" },
32+
{ id: 22, link: "/projects/sistent/components/box", text: "Box" },
33+
{ id: 23, link: "/projects/sistent/components/box/guidance", text: "Box" },
34+
{ id: 24, link: "/projects/sistent/components/box/code", text: "Box" },
3535

36-
{ id: 25, link: "/projects/sistent/components/button-group", text: "Button Group" },
37-
{ id: 26, link: "/projects/sistent/components/button-group/guidance", text: "Button Group" },
38-
{ id: 27, link: "/projects/sistent/components/button-group/code", text: "Button Group" },
36+
{ id: 25, link: "/projects/sistent/components/button", text: "Button" },
37+
{ id: 26, link: "/projects/sistent/components/button/guidance", text: "Button" },
38+
{ id: 27, link: "/projects/sistent/components/button/code", text: "Button" },
3939

40-
{ id: 28, link: "/projects/sistent/components/chip", text: "Chip" },
41-
{ id: 29, link: "/projects/sistent/components/chip/guidance", text: "Chip" },
42-
{ id: 30, link: "/projects/sistent/components/chip/code", text: "Chip" },
40+
{ id: 28, link: "/projects/sistent/components/button-group", text: "Button Group" },
41+
{ id: 29, link: "/projects/sistent/components/button-group/guidance", text: "Button Group" },
42+
{ id: 30, link: "/projects/sistent/components/button-group/code", text: "Button Group" },
4343

44-
{ id: 31, link: "/projects/sistent/components/circularprogress", text: "Circular Progress" },
45-
{ id: 32, link: "/projects/sistent/components/circularprogress/guidance", text: "Circular Progress" },
46-
{ id: 33, link: "/projects/sistent/components/circularprogress/code", text: "Circular Progress" },
44+
{ id: 31, link: "/projects/sistent/components/chip", text: "Chip" },
45+
{ id: 32, link: "/projects/sistent/components/chip/guidance", text: "Chip" },
46+
{ id: 33, link: "/projects/sistent/components/chip/code", text: "Chip" },
4747

48-
{ id: 34, link: "/projects/sistent/components/collapse", text: "Collapse" },
49-
{ id: 35, link: "/projects/sistent/components/collapse/guidance", text: "Collapse" },
50-
{ id: 36, link: "/projects/sistent/components/collapse/code", text: "Collapse" },
48+
{ id: 34, link: "/projects/sistent/components/circularprogress", text: "Circular Progress" },
49+
{ id: 35, link: "/projects/sistent/components/circularprogress/guidance", text: "Circular Progress" },
50+
{ id: 36, link: "/projects/sistent/components/circularprogress/code", text: "Circular Progress" },
5151

52-
{ id: 37, link: "/projects/sistent/components/container", text: "Container" },
53-
{ id: 38, link: "/projects/sistent/components/container/guidance", text: "Container" },
54-
{ id: 39, link: "/projects/sistent/components/container/code", text: "Container" },
52+
{ id: 37, link: "/projects/sistent/components/collapse", text: "Collapse" },
53+
{ id: 38, link: "/projects/sistent/components/collapse/guidance", text: "Collapse" },
54+
{ id: 39, link: "/projects/sistent/components/collapse/code", text: "Collapse" },
5555

56-
{ id: 40, link: "/projects/sistent/components/dialog", text: "Dialog" },
57-
{ id: 41, link: "/projects/sistent/components/dialog/guidance", text: "Dialog" },
58-
{ id: 42, link: "/projects/sistent/components/dialog/code", text: "Dialog" },
56+
{ id: 40, link: "/projects/sistent/components/container", text: "Container" },
57+
{ id: 41, link: "/projects/sistent/components/container/guidance", text: "Container" },
58+
{ id: 42, link: "/projects/sistent/components/container/code", text: "Container" },
5959

60-
{ id: 43, link: "/projects/sistent/components/formcontrollabel", text: "FormControlLabel" },
61-
{ id: 44, link: "/projects/sistent/components/formcontrollabel/guidance", text: "FormControlLabel" },
62-
{ id: 45, link: "/projects/sistent/components/formcontrollabel/code", text: "FormControlLabel" },
60+
{ id: 43, link: "/projects/sistent/components/dialog", text: "Dialog" },
61+
{ id: 44, link: "/projects/sistent/components/dialog/guidance", text: "Dialog" },
62+
{ id: 45, link: "/projects/sistent/components/dialog/code", text: "Dialog" },
6363

64-
{ id: 46, link: "/projects/sistent/components/grid", text: "Grid" },
65-
{ id: 47, link: "/projects/sistent/components/grid/guidance", text: "Grid" },
66-
{ id: 48, link: "/projects/sistent/components/grid/code", text: "Grid" },
64+
{ id: 46, link: "/projects/sistent/components/formcontrollabel", text: "FormControlLabel" },
65+
{ id: 47, link: "/projects/sistent/components/formcontrollabel/guidance", text: "FormControlLabel" },
66+
{ id: 48, link: "/projects/sistent/components/formcontrollabel/code", text: "FormControlLabel" },
6767

68-
{ id: 49, link: "/projects/sistent/components/iconbutton", text: "IconButton" },
69-
{ id: 50, link: "/projects/sistent/components/iconbutton/guidance", text: "IconButton" },
70-
{ id: 51, link: "/projects/sistent/components/iconbutton/code", text: "IconButton" },
68+
{ id: 49, link: "/projects/sistent/components/grid", text: "Grid" },
69+
{ id: 50, link: "/projects/sistent/components/grid/guidance", text: "Grid" },
70+
{ id: 51, link: "/projects/sistent/components/grid/code", text: "Grid" },
7171

72-
{ id: 52, link: "/projects/sistent/components/icons", text: "Icons" },
72+
{ id: 52, link: "/projects/sistent/components/iconbutton", text: "IconButton" },
73+
{ id: 53, link: "/projects/sistent/components/iconbutton/guidance", text: "IconButton" },
74+
{ id: 54, link: "/projects/sistent/components/iconbutton/code", text: "IconButton" },
7375

74-
{ id: 53, link: "/projects/sistent/components/link", text: "Link" },
75-
{ id: 54, link: "/projects/sistent/components/link/guidance", text: "Link" },
76-
{ id: 55, link: "/projects/sistent/components/link/code", text: "Link" },
76+
{ id: 55, link: "/projects/sistent/components/icons", text: "Icons" },
7777

78-
{ id: 56, link: "/projects/sistent/components/list", text: "List" },
79-
{ id: 57, link: "/projects/sistent/components/list/guidance", text: "List" },
80-
{ id: 58, link: "/projects/sistent/components/list/code", text: "List" },
78+
{ id: 56, link: "/projects/sistent/components/link", text: "Link" },
79+
{ id: 57, link: "/projects/sistent/components/link/guidance", text: "Link" },
80+
{ id: 58, link: "/projects/sistent/components/link/code", text: "Link" },
8181

82-
{ id: 59, link: "/projects/sistent/components/modal", text: "Modal" },
83-
{ id: 60, link: "/projects/sistent/components/modal/guidance", text: "Modal" },
84-
{ id: 61, link: "/projects/sistent/components/modal/code", text: "Modal" },
82+
{ id: 59, link: "/projects/sistent/components/list", text: "List" },
83+
{ id: 60, link: "/projects/sistent/components/list/guidance", text: "List" },
84+
{ id: 61, link: "/projects/sistent/components/list/code", text: "List" },
8585

86-
{ id: 62, link: "/projects/sistent/components/pagination", text: "Pagination" },
87-
{ id: 63, link: "/projects/sistent/components/pagination/guidance", text: "Pagination" },
88-
{ id: 64, link: "/projects/sistent/components/pagination/code", text: "Pagination" },
86+
{ id: 62, link: "/projects/sistent/components/modal", text: "Modal" },
87+
{ id: 63, link: "/projects/sistent/components/modal/guidance", text: "Modal" },
88+
{ id: 64, link: "/projects/sistent/components/modal/code", text: "Modal" },
8989

90-
{ id: 65, link: "/projects/sistent/components/paper", text: "Paper" },
91-
{ id: 66, link: "/projects/sistent/components/paper/guidance", text: "Paper" },
92-
{ id: 67, link: "/projects/sistent/components/paper/code", text: "Paper" },
90+
{ id: 65, link: "/projects/sistent/components/pagination", text: "Pagination" },
91+
{ id: 66, link: "/projects/sistent/components/pagination/guidance", text: "Pagination" },
92+
{ id: 67, link: "/projects/sistent/components/pagination/code", text: "Pagination" },
9393

94-
{ id: 68, link: "/projects/sistent/components/popper", text: "Popper" },
95-
{ id: 69, link: "/projects/sistent/components/popper/guidance", text: "Popper" },
96-
{ id: 70, link: "/projects/sistent/components/popper/code", text: "Popper" },
94+
{ id: 68, link: "/projects/sistent/components/paper", text: "Paper" },
95+
{ id: 69, link: "/projects/sistent/components/paper/guidance", text: "Paper" },
96+
{ id: 70, link: "/projects/sistent/components/paper/code", text: "Paper" },
9797

98-
{ id: 71, link: "/projects/sistent/components/radiogroup", text: "RadioGroup" },
99-
{ id: 72, link: "/projects/sistent/components/radiogroup/guidance", text: "RadioGroup" },
100-
{ id: 73, link: "/projects/sistent/components/radiogroup/code", text: "RadioGroup" },
98+
{ id: 71, link: "/projects/sistent/components/popper", text: "Popper" },
99+
{ id: 72, link: "/projects/sistent/components/popper/guidance", text: "Popper" },
100+
{ id: 73, link: "/projects/sistent/components/popper/code", text: "Popper" },
101101

102-
{ id: 74, link: "/projects/sistent/components/select", text: "Select" },
103-
{ id: 75, link: "/projects/sistent/components/select/guidance", text: "Select" },
104-
{ id: 76, link: "/projects/sistent/components/select/code", text: "Select" },
102+
{ id: 74, link: "/projects/sistent/components/radiogroup", text: "RadioGroup" },
103+
{ id: 75, link: "/projects/sistent/components/radiogroup/guidance", text: "RadioGroup" },
104+
{ id: 76, link: "/projects/sistent/components/radiogroup/code", text: "RadioGroup" },
105105

106-
{ id: 77, link: "/projects/sistent/components/stack", text: "Stack" },
107-
{ id: 78, link: "/projects/sistent/components/stack/guidance", text: "Stack" },
108-
{ id: 79, link: "/projects/sistent/components/stack/code", text: "Stack" },
106+
{ id: 77, link: "/projects/sistent/components/select", text: "Select" },
107+
{ id: 78, link: "/projects/sistent/components/select/guidance", text: "Select" },
108+
{ id: 79, link: "/projects/sistent/components/select/code", text: "Select" },
109109

110-
{ id: 80, link: "/projects/sistent/components/stepper", text: "Stepper" },
111-
{ id: 81, link: "/projects/sistent/components/stepper/guidance", text: "Stepper" },
112-
{ id: 82, link: "/projects/sistent/components/stepper/code", text: "Stepper" },
110+
{ id: 80, link: "/projects/sistent/components/stack", text: "Stack" },
111+
{ id: 81, link: "/projects/sistent/components/stack/guidance", text: "Stack" },
112+
{ id: 82, link: "/projects/sistent/components/stack/code", text: "Stack" },
113113

114-
{ id: 83, link: "/projects/sistent/components/switch", text: "Switch" },
115-
{ id: 84, link: "/projects/sistent/components/switch/guidance", text: "Switch" },
116-
{ id: 85, link: "/projects/sistent/components/switch/code", text: "Switch" },
114+
{ id: 83, link: "/projects/sistent/components/stepper", text: "Stepper" },
115+
{ id: 84, link: "/projects/sistent/components/stepper/guidance", text: "Stepper" },
116+
{ id: 85, link: "/projects/sistent/components/stepper/code", text: "Stepper" },
117117

118-
{ id: 86, link: "/projects/sistent/components/tabs", text: "Tabs" },
119-
{ id: 87, link: "/projects/sistent/components/tabs/guidance", text: "Tabs" },
120-
{ id: 88, link: "/projects/sistent/components/tabs/code", text: "Tabs" },
118+
{ id: 86, link: "/projects/sistent/components/switch", text: "Switch" },
119+
{ id: 87, link: "/projects/sistent/components/switch/guidance", text: "Switch" },
120+
{ id: 88, link: "/projects/sistent/components/switch/code", text: "Switch" },
121121

122-
{ id: 89, link: "/projects/sistent/components/text-field", text: "Text Field" },
123-
{ id: 90, link: "/projects/sistent/components/text-field/guidance", text: "Text Field" },
124-
{ id: 91, link: "/projects/sistent/components/text-field/code", text: "Text Field" },
122+
{ id: 89, link: "/projects/sistent/components/tabs", text: "Tabs" },
123+
{ id: 90, link: "/projects/sistent/components/tabs/guidance", text: "Tabs" },
124+
{ id: 91, link: "/projects/sistent/components/tabs/code", text: "Tabs" },
125125

126-
{ id: 92, link: "/projects/sistent/components/text-input", text: "Text Input" },
127-
{ id: 93, link: "/projects/sistent/components/text-input/guidance", text: "Text Input" },
128-
{ id: 94, link: "/projects/sistent/components/text-input/code", text: "Text Input" },
126+
{ id: 92, link: "/projects/sistent/components/text-field", text: "Text Field" },
127+
{ id: 93, link: "/projects/sistent/components/text-field/guidance", text: "Text Field" },
128+
{ id: 94, link: "/projects/sistent/components/text-field/code", text: "Text Field" },
129129

130-
{ id: 95, link: "/projects/sistent/components/toolbar", text: "Toolbar" },
131-
{ id: 96, link: "/projects/sistent/components/toolbar/guidance", text: "Toolbar" },
132-
{ id: 97, link: "/projects/sistent/components/toolbar/code", text: "Toolbar" },
130+
{ id: 95, link: "/projects/sistent/components/text-input", text: "Text Input" },
131+
{ id: 96, link: "/projects/sistent/components/text-input/guidance", text: "Text Input" },
132+
{ id: 97, link: "/projects/sistent/components/text-input/code", text: "Text Input" },
133133

134-
{ id: 98, link: "/projects/sistent/components/tooltip", text: "Tooltip" },
135-
{ id: 99, link: "/projects/sistent/components/tooltip/guidance", text: "Tooltip" },
136-
{ id: 100, link: "/projects/sistent/components/tooltip/code", text: "Tooltip" },
137-
];
134+
{ id: 98, link: "/projects/sistent/components/toolbar", text: "Toolbar" },
135+
{ id: 99, link: "/projects/sistent/components/toolbar/guidance", text: "Toolbar" },
136+
{ id: 100, link: "/projects/sistent/components/toolbar/code", text: "Toolbar" },
137+
138+
{ id: 101, link: "/projects/sistent/components/tooltip", text: "Tooltip" },
139+
{ id: 102, link: "/projects/sistent/components/tooltip/guidance", text: "Tooltip" },
140+
{ id: 103, link: "/projects/sistent/components/tooltip/code", text: "Tooltip" },
141+
];

src/sections/Home/So-Special-Section/index.js

Lines changed: 50 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
import React from "react";
2+
import React, {useLayoutEffect, useState, useRef} from "react";
33
import Slider from "react-slick";
44
import SoSpecialWrapper from "./so-special-style";
55

@@ -9,6 +9,9 @@ import Image from "../../../components/image";
99
// import { useStyledDarkMode } from "../../../theme/app/useStyledDarkMode";
1010

1111
const SoSpecial = () => {
12+
const [isClient, setIsClient] = useState(false);
13+
const [slidesToShowState, setSlidesToShowState] = useState(null);
14+
const sliderRef = useRef(null);
1215
const data = useStaticQuery(
1316
graphql`query newsList {
1417
allMdx(
@@ -53,56 +56,55 @@ const SoSpecial = () => {
5356
}`
5457
);
5558
const settings = {
56-
dots: false,
59+
dots: slidesToShowState <= 1,
5760
infinite: false,
5861
speed: 500,
59-
slidesToShow: 2.5,
6062
swipeToSlide: true,
61-
62-
responsive: [
63-
{
64-
breakpoint: 1200,
65-
settings: {
66-
slidesToShow: 2.2,
67-
68-
}
69-
},
70-
{
71-
breakpoint: 1024,
72-
settings: {
73-
slidesToShow: 2,
74-
75-
}
76-
},
77-
{
78-
breakpoint: 800,
79-
settings: {
80-
slidesToShow: 1.5,
81-
slidesToScroll: 1,
82-
initialSlide: 1
83-
}
84-
},
85-
{
86-
breakpoint: 600,
87-
settings: {
88-
dots: true,
89-
arrows: false,
90-
slidesToShow: 1,
91-
slidesToScroll: 1,
92-
initialSlide: 1
93-
}
94-
},
95-
{
96-
breakpoint: 400,
97-
settings: {
98-
dots: true,
99-
arrows: false,
100-
slidesToShow: 1,
101-
slidesToScroll: 1
102-
}
103-
}
104-
]
63+
slidesToScroll: 1,
64+
arrows: slidesToShowState !== 1,
65+
slidesToShow: slidesToShowState ?? 2.5,
10566
};
67+
68+
const computeSlides = () => {
69+
const w = typeof window !== "undefined" ? (window.innerWidth || document.documentElement.clientWidth) : 1200;
70+
if (w <= 600) return 1;
71+
if (w <= 800) return 1.5;
72+
if (w <= 1024) return 2;
73+
if (w <= 1200) return 2.2;
74+
return 3;
75+
};
76+
77+
useLayoutEffect(() => {
78+
79+
setIsClient(true);
80+
setSlidesToShowState(computeSlides());
81+
82+
let resizeTimeout = null;
83+
const onResizeDebounced = () => {
84+
clearTimeout(resizeTimeout);
85+
resizeTimeout = setTimeout(() => {
86+
const slides = computeSlides();
87+
setSlidesToShowState((prev) => {
88+
if (prev !== slides) return slides;
89+
return prev;
90+
});
91+
if (sliderRef.current && sliderRef.current.innerSlider && typeof sliderRef.current.innerSlider.onWindowResized === "function") {
92+
sliderRef.current.innerSlider.onWindowResized();
93+
}
94+
}, 100);
95+
};
96+
97+
window.addEventListener("resize", onResizeDebounced);
98+
window.addEventListener("load", onResizeDebounced);
99+
100+
return () => {
101+
window.removeEventListener("resize", onResizeDebounced);
102+
window.removeEventListener("load", onResizeDebounced);
103+
clearTimeout(resizeTimeout);
104+
};
105+
}, []);
106+
107+
if (!isClient || slidesToShowState === null) return null;
106108

107109
// const { isDark } = useStyledDarkMode();
108110

@@ -113,7 +115,7 @@ const SoSpecial = () => {
113115
<h1>We're making a splash</h1>
114116
</div>
115117
<div className="special_carousel">
116-
<Slider {...settings}>
118+
<Slider {...settings} key={`review-slider-${slidesToShowState}`} ref={sliderRef}>
117119
{
118120
data.allMdx.nodes.map(({ id, frontmatter, fields }) => (
119121
<Button className="special-cont_btn" $url={fields.slug} key={id}>

0 commit comments

Comments
 (0)