Skip to content

Commit 7757eb0

Browse files
authored
Merge branch 'master' into gomezivann/toast-redesign
2 parents 0546460 + 88d53c5 commit 7757eb0

File tree

81 files changed

+2073
-2655
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+2073
-2655
lines changed

apps/website/pages/_app.tsx

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,8 @@ const ApplicationLayoutWrapper = ({ condition, wrapper, children }: ApplicationL
3030
const App = ({ Component, pageProps }: AppPropsWithLayout) => {
3131
const getLayout = Component.getLayout || ((page) => page);
3232
const componentWithLayout = getLayout(<Component {...pageProps} />);
33-
3433
const [filter, setFilter] = useState("");
3534
const { asPath: currentPath } = useRouter();
36-
3735
const filteredLinks = useMemo(() => {
3836
const filtered: LinksSectionDetails[] = [];
3937
LinksSections.map((section) => {
@@ -47,17 +45,10 @@ const App = ({ Component, pageProps }: AppPropsWithLayout) => {
4745
return filtered;
4846
}, [filter]);
4947

50-
const onFilterInputChange = ({ value }: { value: string }) => {
51-
setFilter(value);
52-
};
53-
5448
const matchPaths = (linkPath: string) => {
49+
const desiredPaths = [linkPath, `${linkPath}/code`];
5550
const pathToBeMatched = currentPath?.split("#")[0]?.slice(0, -1);
56-
const desiredPaths = [linkPath, `${linkPath}/specifications`, `${linkPath}/usage`];
57-
if (pathToBeMatched) {
58-
return desiredPaths.includes(pathToBeMatched);
59-
}
60-
return false;
51+
return pathToBeMatched ? desiredPaths.includes(pathToBeMatched) : false;
6152
};
6253

6354
return (
@@ -77,7 +68,9 @@ const App = ({ Component, pageProps }: AppPropsWithLayout) => {
7768
<DxcTextInput
7869
placeholder="Search docs"
7970
value={filter}
80-
onChange={onFilterInputChange}
71+
onChange={({ value }: { value: string }) => {
72+
setFilter(value);
73+
}}
8174
size="fillParent"
8275
clearable
8376
margin={{
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import Head from "next/head";
2+
import type { ReactElement } from "react";
3+
import ContainerCodePage from "screens/components/container/code/ContainerCodePage";
4+
import ContainerPageLayout from "screens/components/container/ContainerPageLayout";
5+
6+
const Code = () => (
7+
<>
8+
<Head>
9+
<title>Container code — Halstack Design System</title>
10+
</Head>
11+
<ContainerCodePage />
12+
</>
13+
);
14+
15+
Code.getLayout = (page: ReactElement) => <ContainerPageLayout>{page}</ContainerPageLayout>;
16+
17+
export default Code;
Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,17 @@
11
import Head from "next/head";
22
import type { ReactElement } from "react";
3-
import ContainerCodePage from "screens/components/container/code/ContainerCodePage";
3+
import ContainerOverviewPage from "screens/components/container/overview/ContainerOverviewPage";
44
import ContainerPageLayout from "screens/components/container/ContainerPageLayout";
55

6-
const Usage = () => {
7-
return (
8-
<>
9-
<Head>
10-
<title>Container — Halstack Design System</title>
11-
</Head>
12-
<ContainerCodePage></ContainerCodePage>
13-
</>
14-
);
15-
};
6+
const Index = () => (
7+
<>
8+
<Head>
9+
<title>Container — Halstack Design System</title>
10+
</Head>
11+
<ContainerOverviewPage />
12+
</>
13+
);
1614

17-
Usage.getLayout = function getLayout(page: ReactElement) {
18-
return <ContainerPageLayout>{page}</ContainerPageLayout>;
19-
};
15+
Index.getLayout = (page: ReactElement) => <ContainerPageLayout>{page}</ContainerPageLayout>;
2016

21-
export default Usage;
17+
export default Index;

apps/website/pages/components/container/usage.tsx

Lines changed: 0 additions & 21 deletions
This file was deleted.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import Head from "next/head";
2+
import type { ReactElement } from "react";
3+
import FlexPageLayout from "screens/components/flex/FlexPageLayout";
4+
import FlexCodePage from "screens/components/flex/code/FlexCodePage";
5+
6+
const Code = () => (
7+
<>
8+
<Head>
9+
<title>Flex code — Halstack Design System</title>
10+
</Head>
11+
<FlexCodePage />
12+
</>
13+
);
14+
15+
Code.getLayout = (page: ReactElement) => <FlexPageLayout>{page}</FlexPageLayout>;
16+
17+
export default Code;
Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,17 @@
11
import Head from "next/head";
22
import type { ReactElement } from "react";
33
import FlexPageLayout from "screens/components/flex/FlexPageLayout";
4-
import FlexCodePage from "screens/components/flex/code/FlexCodePage";
4+
import FlexOverviewPage from "screens/components/flex/overview/FlexOverviewPage";
55

6-
const Index = () => {
7-
return (
8-
<>
9-
<Head>
10-
<title>Flex — Halstack Design System</title>
11-
</Head>
12-
<FlexCodePage></FlexCodePage>
13-
</>
14-
);
15-
};
6+
const Index = () => (
7+
<>
8+
<Head>
9+
<title>Flex — Halstack Design System</title>
10+
</Head>
11+
<FlexOverviewPage />
12+
</>
13+
);
1614

17-
Index.getLayout = function getLayout(page: ReactElement) {
18-
return <FlexPageLayout>{page}</FlexPageLayout>;
19-
};
15+
Index.getLayout = (page: ReactElement) => <FlexPageLayout>{page}</FlexPageLayout>;
2016

2117
export default Index;

apps/website/pages/components/flex/specifications.tsx

Lines changed: 0 additions & 21 deletions
This file was deleted.

apps/website/pages/components/flex/usage.tsx

Lines changed: 0 additions & 21 deletions
This file was deleted.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import Head from "next/head";
2+
import type { ReactElement } from "react";
3+
import GridPageLayout from "screens/components/grid/GridPageLayout";
4+
import GridCodePage from "screens/components/grid/code/GridCodePage";
5+
6+
const Code = () => (
7+
<>
8+
<Head>
9+
<title>Grid code — Halstack Design System</title>
10+
</Head>
11+
<GridCodePage />
12+
</>
13+
);
14+
15+
Code.getLayout = (page: ReactElement) => <GridPageLayout>{page}</GridPageLayout>;
16+
17+
export default Code;
Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,17 @@
11
import Head from "next/head";
22
import type { ReactElement } from "react";
33
import GridPageLayout from "screens/components/grid/GridPageLayout";
4-
import GridCodePage from "screens/components/grid/code/GridCodePage";
4+
import GridOverviewPage from "screens/components/grid/overview/GridOverviewPage";
55

6-
const Index = () => {
7-
return (
8-
<>
9-
<Head>
10-
<title>Grid — Halstack Design System</title>
11-
</Head>
12-
<GridCodePage></GridCodePage>
13-
</>
14-
);
15-
};
6+
const Index = () => (
7+
<>
8+
<Head>
9+
<title>Grid — Halstack Design System</title>
10+
</Head>
11+
<GridOverviewPage />
12+
</>
13+
);
1614

17-
Index.getLayout = function getLayout(page: ReactElement) {
18-
return <GridPageLayout>{page}</GridPageLayout>;
19-
};
15+
Index.getLayout = (page: ReactElement) => <GridPageLayout>{page}</GridPageLayout>;
2016

2117
export default Index;

0 commit comments

Comments
 (0)