@stackshift-ui/footer 6.0.13 → 6.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-6BH7H5U6.mjs → chunk-IHBDV5WG.mjs} +1 -1
- package/dist/chunk-JHKJISLR.mjs +1 -0
- package/dist/chunk-RCTJNFBQ.mjs +1 -0
- package/dist/chunk-RMQJ53K6.mjs +1 -0
- package/dist/chunk-S35O64PB.mjs +1 -0
- package/dist/chunk-VVCGL3KL.mjs +1 -0
- package/dist/footer.d.ts +1 -1
- package/dist/footer.js +1 -1
- package/dist/footer.mjs +1 -1
- package/dist/footer_a.js +1 -1
- package/dist/footer_a.mjs +1 -1
- package/dist/footer_b.js +1 -1
- package/dist/footer_b.mjs +1 -1
- package/dist/footer_c.js +1 -1
- package/dist/footer_c.mjs +1 -1
- package/dist/footer_d.js +1 -1
- package/dist/footer_d.mjs +1 -1
- package/dist/helper/index.d.ts +2 -1
- package/dist/helper/index.js +1 -1
- package/dist/helper/index.mjs +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/types.d.ts +112 -1
- package/dist/types.js +1 -1
- package/package.json +15 -14
- package/src/footer.test.tsx +2 -2
- package/src/footer.tsx +10 -6
- package/src/footer_a.tsx +3 -2
- package/src/footer_b.tsx +8 -5
- package/src/footer_c.tsx +17 -12
- package/src/footer_d.tsx +15 -12
- package/src/helper/index.tsx +117 -1
- package/src/types.ts +118 -1
- package/dist/chunk-7W6RK7Y5.mjs +0 -1
- package/dist/chunk-FWXIR5AI.mjs +0 -1
- package/dist/chunk-QPANXJBZ.mjs +0 -1
- package/dist/chunk-SGUCRY3T.mjs +0 -1
- package/dist/chunk-ZHEGNPPP.mjs +0 -1
package/dist/types.d.ts
CHANGED
|
@@ -1,9 +1,71 @@
|
|
|
1
|
+
import { PortableTextComponents } from "@portabletext/react";
|
|
1
2
|
export type StyleVariants<T extends string> = Record<T, string>;
|
|
2
3
|
export type Socials = "facebook" | "instagram" | "youtube" | "linkedin" | "twitter";
|
|
3
4
|
export interface MainImage {
|
|
4
5
|
image: string;
|
|
5
6
|
alt?: string;
|
|
6
7
|
}
|
|
8
|
+
export interface MegaMenu {
|
|
9
|
+
_type: string;
|
|
10
|
+
showcaseLink?: ShowcaseLink[];
|
|
11
|
+
links?: MegaMenuLink[];
|
|
12
|
+
_key: string;
|
|
13
|
+
title?: string;
|
|
14
|
+
groupOfLinks?: GroupOfLink[];
|
|
15
|
+
label?: string;
|
|
16
|
+
linkTarget?: string;
|
|
17
|
+
linkType?: string;
|
|
18
|
+
url?: string;
|
|
19
|
+
linkExternal?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface Logo extends ConditionalLink {
|
|
22
|
+
alt?: string;
|
|
23
|
+
linkTarget?: string;
|
|
24
|
+
image?: string;
|
|
25
|
+
}
|
|
26
|
+
export interface Logos {
|
|
27
|
+
logo: Logo[];
|
|
28
|
+
}
|
|
29
|
+
export interface GroupOfLink {
|
|
30
|
+
_type: string;
|
|
31
|
+
links: GroupOfLinkRoot[];
|
|
32
|
+
_key: string;
|
|
33
|
+
title: string;
|
|
34
|
+
primaryButton: LabeledRouteWithKey;
|
|
35
|
+
}
|
|
36
|
+
export interface GroupOfLinkRoot {
|
|
37
|
+
title: string;
|
|
38
|
+
_type: string;
|
|
39
|
+
label?: string;
|
|
40
|
+
links: LabeledRouteWithKey[];
|
|
41
|
+
_key: string;
|
|
42
|
+
}
|
|
43
|
+
export interface MegaMenu {
|
|
44
|
+
_type: string;
|
|
45
|
+
showcaseLink?: ShowcaseLink[];
|
|
46
|
+
links?: MegaMenuLink[];
|
|
47
|
+
_key: string;
|
|
48
|
+
title?: string;
|
|
49
|
+
groupOfLinks?: GroupOfLink[];
|
|
50
|
+
label?: string;
|
|
51
|
+
linkTarget?: string;
|
|
52
|
+
linkType?: string;
|
|
53
|
+
url?: string;
|
|
54
|
+
}
|
|
55
|
+
export interface ShowcaseLink {
|
|
56
|
+
mainImage: MainImage;
|
|
57
|
+
_type: string;
|
|
58
|
+
primaryButton: LabeledRouteWithKey;
|
|
59
|
+
_key: string;
|
|
60
|
+
}
|
|
61
|
+
export interface MegaMenuLink {
|
|
62
|
+
_key: string;
|
|
63
|
+
title: string;
|
|
64
|
+
_type: string;
|
|
65
|
+
links: LabeledRouteWithKey[];
|
|
66
|
+
primaryButton: LabeledRouteWithKey;
|
|
67
|
+
label: string;
|
|
68
|
+
}
|
|
7
69
|
export interface LabeledRoute extends ConditionalLink {
|
|
8
70
|
ariaLabel?: string;
|
|
9
71
|
label?: string;
|
|
@@ -11,6 +73,10 @@ export interface LabeledRoute extends ConditionalLink {
|
|
|
11
73
|
linkType?: string;
|
|
12
74
|
_type?: string;
|
|
13
75
|
linkInternal?: any;
|
|
76
|
+
linkExternal?: any;
|
|
77
|
+
referenceType?: string;
|
|
78
|
+
multipleRoutes?: LabeledRouteWithKey[];
|
|
79
|
+
multipleInnerRoutes?: LabeledRouteWithKey[];
|
|
14
80
|
}
|
|
15
81
|
export interface ConditionalLink {
|
|
16
82
|
type?: string;
|
|
@@ -24,10 +90,15 @@ export interface StatItems {
|
|
|
24
90
|
_key?: string;
|
|
25
91
|
_type?: string;
|
|
26
92
|
}
|
|
27
|
-
export interface Logo
|
|
93
|
+
export interface Logo {
|
|
28
94
|
alt?: string;
|
|
29
95
|
linkTarget?: string;
|
|
30
96
|
image?: string;
|
|
97
|
+
type?: string;
|
|
98
|
+
internalLink?: string;
|
|
99
|
+
externalLink?: string;
|
|
100
|
+
linkExternal?: string;
|
|
101
|
+
linkInternal?: string;
|
|
31
102
|
}
|
|
32
103
|
export interface Images {
|
|
33
104
|
image?: string;
|
|
@@ -54,6 +125,17 @@ export interface SocialLink {
|
|
|
54
125
|
}
|
|
55
126
|
export interface LabeledRouteWithKey extends LabeledRoute {
|
|
56
127
|
_key?: string;
|
|
128
|
+
image?: string;
|
|
129
|
+
alt?: string;
|
|
130
|
+
multipleRoutes?: LabeledRouteWithKey[];
|
|
131
|
+
featuredRoute?: {
|
|
132
|
+
featuredLink: LabeledRoute;
|
|
133
|
+
mainImage: {
|
|
134
|
+
image: string;
|
|
135
|
+
alt: string;
|
|
136
|
+
};
|
|
137
|
+
};
|
|
138
|
+
routeType?: string;
|
|
57
139
|
}
|
|
58
140
|
export interface ArrayOfImageTitleAndText {
|
|
59
141
|
mainImage?: {
|
|
@@ -166,12 +248,17 @@ export interface Sections extends SanityBody {
|
|
|
166
248
|
export interface Variants {
|
|
167
249
|
template?: Template;
|
|
168
250
|
multipleMenus?: any;
|
|
251
|
+
multipleLinks?: any;
|
|
252
|
+
megaMenu?: MegaMenu[];
|
|
169
253
|
arrayOfTitleAndText?: ArrayOfTitleAndText[] | null;
|
|
170
254
|
logo?: Logo | null;
|
|
255
|
+
logos?: Logos[] | null;
|
|
171
256
|
primaryButton?: LabeledRoute | null;
|
|
172
257
|
secondaryButton?: LabeledRoute | null;
|
|
173
258
|
routes?: LabeledRouteWithKey[] | null;
|
|
174
259
|
menu?: LabeledRouteWithKey[] | null;
|
|
260
|
+
dropdownMenu?: LabeledRouteWithKey[] | null;
|
|
261
|
+
iconLinks?: LabeledRouteWithKey[] | null;
|
|
175
262
|
plans?: Plans[] | null;
|
|
176
263
|
formLinks?: LabeledRouteWithKey[] | null;
|
|
177
264
|
portfolios?: Portfolios[] | null;
|
|
@@ -195,6 +282,7 @@ export interface Variants {
|
|
|
195
282
|
contactEmail?: string | null;
|
|
196
283
|
contactNumber?: string | null;
|
|
197
284
|
socialLinks?: SocialLink[] | null;
|
|
285
|
+
socialMedia?: SocialLink[] | null;
|
|
198
286
|
block?: any;
|
|
199
287
|
heading?: string | null;
|
|
200
288
|
acceptButtonLabel?: string | null;
|
|
@@ -359,4 +447,27 @@ export declare interface Reference {
|
|
|
359
447
|
};
|
|
360
448
|
};
|
|
361
449
|
}
|
|
450
|
+
export type MyPortableTextComponents = PortableTextComponents & {
|
|
451
|
+
code?: ({ value }: {
|
|
452
|
+
value: {
|
|
453
|
+
language?: string;
|
|
454
|
+
code?: string;
|
|
455
|
+
};
|
|
456
|
+
}) => JSX.Element;
|
|
457
|
+
};
|
|
458
|
+
export interface ConditionalLinkTypes {
|
|
459
|
+
className?: string;
|
|
460
|
+
ariaLabel: string;
|
|
461
|
+
style?: any;
|
|
462
|
+
children: string | React.ReactNode;
|
|
463
|
+
link: LabeledRoute | LabeledRouteWithKey | undefined;
|
|
464
|
+
target?: string;
|
|
465
|
+
}
|
|
466
|
+
export interface IconLink {
|
|
467
|
+
_key: string;
|
|
468
|
+
image: string;
|
|
469
|
+
alt?: string;
|
|
470
|
+
linkExternal: string;
|
|
471
|
+
linkTarget?: "_blank" | "_self";
|
|
472
|
+
}
|
|
362
473
|
export {};
|
package/dist/types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var l=Object.defineProperty;var
|
|
1
|
+
"use strict";var l=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var o=Object.prototype.hasOwnProperty;var g=(n,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let e of s(t))!o.call(n,e)&&e!==r&&l(n,e,{get:()=>t[e],enumerable:!(i=a(t,e))||i.enumerable});return n};var u=n=>g(l({},"__esModule",{value:!0}),n);var c={};module.exports=u(c);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stackshift-ui/footer",
|
|
3
3
|
"description": "",
|
|
4
|
-
"version": "6.0
|
|
4
|
+
"version": "6.1.0",
|
|
5
5
|
"private": false,
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"main": "./dist/index.js",
|
|
@@ -33,26 +33,27 @@
|
|
|
33
33
|
"@stackshift-ui/typescript-config": "6.0.10"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
+
"@portabletext/react": "^3.1.0",
|
|
36
37
|
"classnames": "^2.5.1",
|
|
37
|
-
"@stackshift-ui/scripts": "6.0
|
|
38
|
-
"@stackshift-ui/text": "6.0
|
|
39
|
-
"@stackshift-ui/
|
|
40
|
-
"@stackshift-ui/
|
|
41
|
-
"@stackshift-ui/
|
|
42
|
-
"@stackshift-ui/
|
|
43
|
-
"@stackshift-ui/
|
|
44
|
-
"@stackshift-ui/
|
|
45
|
-
"@stackshift-ui/
|
|
46
|
-
"@stackshift-ui/social-icons": "6.0
|
|
47
|
-
"@stackshift-ui/
|
|
48
|
-
"@stackshift-ui/
|
|
38
|
+
"@stackshift-ui/scripts": "6.1.0",
|
|
39
|
+
"@stackshift-ui/text": "6.1.0",
|
|
40
|
+
"@stackshift-ui/image": "6.1.0",
|
|
41
|
+
"@stackshift-ui/flex": "6.1.0",
|
|
42
|
+
"@stackshift-ui/system": "6.1.0",
|
|
43
|
+
"@stackshift-ui/grid-item": "6.1.0",
|
|
44
|
+
"@stackshift-ui/grid": "6.1.0",
|
|
45
|
+
"@stackshift-ui/link": "6.1.0",
|
|
46
|
+
"@stackshift-ui/container": "6.1.0",
|
|
47
|
+
"@stackshift-ui/social-icons": "6.1.0",
|
|
48
|
+
"@stackshift-ui/section": "6.1.0",
|
|
49
|
+
"@stackshift-ui/button": "6.1.0"
|
|
49
50
|
},
|
|
50
51
|
"peerDependencies": {
|
|
51
52
|
"@types/react": "16.8 - 19",
|
|
52
53
|
"next": "10 - 14",
|
|
53
54
|
"react": "16.8 - 19",
|
|
54
55
|
"react-dom": "16.8 - 19",
|
|
55
|
-
"@stackshift-ui/system": ">=
|
|
56
|
+
"@stackshift-ui/system": ">=7.0.0"
|
|
56
57
|
},
|
|
57
58
|
"peerDependenciesMeta": {
|
|
58
59
|
"next": {
|
package/src/footer.test.tsx
CHANGED
|
@@ -7,7 +7,7 @@ describe.concurrent("footer", () => {
|
|
|
7
7
|
|
|
8
8
|
test.skip("Dummy test - test if renders without errors", ({ expect }) => {
|
|
9
9
|
const clx = "my-class";
|
|
10
|
-
render(<Footer />);
|
|
11
|
-
expect(screen.getByTestId("
|
|
10
|
+
render(<Footer data-testid="footer" />);
|
|
11
|
+
expect(screen.getByTestId("footer").classList).toContain(clx);
|
|
12
12
|
});
|
|
13
13
|
});
|
package/src/footer.tsx
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import
|
|
1
|
+
import React from "react";
|
|
2
|
+
import FooterA from "./footer_a";
|
|
3
|
+
import FooterB from "./footer_b";
|
|
4
|
+
import FooterC from "./footer_c";
|
|
5
|
+
import FooterD from "./footer_d";
|
|
6
|
+
import { ContactDetails, LabeledRouteWithKey, Logo, SectionsProps, SocialLink } from "./types";
|
|
3
7
|
|
|
4
8
|
const Variants = {
|
|
5
|
-
variant_a:
|
|
6
|
-
variant_b:
|
|
7
|
-
variant_c:
|
|
8
|
-
variant_d:
|
|
9
|
+
variant_a: FooterA,
|
|
10
|
+
variant_b: FooterB,
|
|
11
|
+
variant_c: FooterC,
|
|
12
|
+
variant_d: FooterD,
|
|
9
13
|
};
|
|
10
14
|
|
|
11
15
|
export interface FooterProps {
|
package/src/footer_a.tsx
CHANGED
|
@@ -7,7 +7,6 @@ import { Link } from "@stackshift-ui/link";
|
|
|
7
7
|
import { Section } from "@stackshift-ui/section";
|
|
8
8
|
import { SocialIcons } from "@stackshift-ui/social-icons";
|
|
9
9
|
import { Text } from "@stackshift-ui/text";
|
|
10
|
-
|
|
11
10
|
import { FooterProps } from ".";
|
|
12
11
|
import { logoLink } from "./helper";
|
|
13
12
|
import { ContactDetails, Logo, SocialLink, Socials } from "./types";
|
|
@@ -124,7 +123,9 @@ function SocialMediaContainer({ socialMedia }: { socialMedia?: SocialLink[] }) {
|
|
|
124
123
|
|
|
125
124
|
return (
|
|
126
125
|
<Flex wrap className="gap-5">
|
|
127
|
-
{socialMedia?.map((social, index) =>
|
|
126
|
+
{socialMedia?.map((social, index) => (
|
|
127
|
+
<SocialMediaLink social={social} key={index} />
|
|
128
|
+
))}
|
|
128
129
|
</Flex>
|
|
129
130
|
);
|
|
130
131
|
}
|
package/src/footer_b.tsx
CHANGED
|
@@ -7,7 +7,6 @@ import { Section } from "@stackshift-ui/section";
|
|
|
7
7
|
import { SocialIcons } from "@stackshift-ui/social-icons";
|
|
8
8
|
import { Text } from "@stackshift-ui/text";
|
|
9
9
|
import React from "react";
|
|
10
|
-
|
|
11
10
|
import { FooterProps } from ".";
|
|
12
11
|
import { logoLink } from "./helper";
|
|
13
12
|
import { LabeledRoute, LabeledRouteWithKey, Logo, SocialLink, Socials } from "./types";
|
|
@@ -33,7 +32,7 @@ function LogoSection({ logo }: { logo?: Logo }) {
|
|
|
33
32
|
if (!logo?.image) return null;
|
|
34
33
|
|
|
35
34
|
return (
|
|
36
|
-
<div className="
|
|
35
|
+
<div className="w-full lg:w-1/5">
|
|
37
36
|
<Link
|
|
38
37
|
aria-label={logoLink(logo) === "/" ? "Go to home page" : `Go to ${logoLink(logo)}`}
|
|
39
38
|
className="w-40 h-14 flex items-center"
|
|
@@ -51,7 +50,7 @@ function MenuLists({ menu }: { menu?: LabeledRouteWithKey[] }) {
|
|
|
51
50
|
|
|
52
51
|
return (
|
|
53
52
|
<div className="w-full lg:w-auto">
|
|
54
|
-
<Flex wrap align="center" justify="between" as="ul" gap={5}
|
|
53
|
+
<Flex wrap align="center" justify="between" as="ul" gap={5}>
|
|
55
54
|
{menu?.map((links, index, { length }) => (
|
|
56
55
|
<React.Fragment key={links?._key || index}>
|
|
57
56
|
<MenuList links={links} />
|
|
@@ -71,8 +70,10 @@ function MenuList({ links, index }: { links?: LabeledRoute; index?: number }) {
|
|
|
71
70
|
<Button
|
|
72
71
|
as="link"
|
|
73
72
|
link={links}
|
|
73
|
+
variant="unstyled"
|
|
74
74
|
className="text-gray-500 no-underline lg:text-sm hover:text-gray-700"
|
|
75
|
-
|
|
75
|
+
aria-label={links?.label}
|
|
76
|
+
asChild>
|
|
76
77
|
{links?.label}
|
|
77
78
|
</Button>
|
|
78
79
|
</li>
|
|
@@ -114,7 +115,9 @@ function SocialMediaContainer({ socialMedia }: { socialMedia?: SocialLink[] }) {
|
|
|
114
115
|
|
|
115
116
|
return (
|
|
116
117
|
<div className="order-first mb-4 lg:order-last lg:mb-0">
|
|
117
|
-
{socialMedia?.map(social =>
|
|
118
|
+
{socialMedia?.map(social => (
|
|
119
|
+
<SocialMediaLink social={social} />
|
|
120
|
+
))}
|
|
118
121
|
</div>
|
|
119
122
|
);
|
|
120
123
|
}
|
package/src/footer_c.tsx
CHANGED
|
@@ -6,7 +6,6 @@ import { Link } from "@stackshift-ui/link";
|
|
|
6
6
|
import { Section } from "@stackshift-ui/section";
|
|
7
7
|
import { SocialIcons } from "@stackshift-ui/social-icons";
|
|
8
8
|
import { Text } from "@stackshift-ui/text";
|
|
9
|
-
|
|
10
9
|
import { FooterProps } from ".";
|
|
11
10
|
import { logoLink } from "./helper";
|
|
12
11
|
import { LabeledRoute, LabeledRouteWithKey, Logo, SocialLink, Socials } from "./types";
|
|
@@ -71,7 +70,9 @@ function MenuLists({ menu }: { menu?: LabeledRouteWithKey[] }) {
|
|
|
71
70
|
as="ul"
|
|
72
71
|
align="center"
|
|
73
72
|
justify="center">
|
|
74
|
-
{menu?.map((links, index) =>
|
|
73
|
+
{menu?.map((links, index) => (
|
|
74
|
+
<MenuList links={links} index={index} />
|
|
75
|
+
))}
|
|
75
76
|
</Flex>
|
|
76
77
|
</div>
|
|
77
78
|
);
|
|
@@ -85,8 +86,10 @@ function MenuList({ links, index }: { links?: LabeledRoute; index?: number }) {
|
|
|
85
86
|
<Button
|
|
86
87
|
as="link"
|
|
87
88
|
link={links}
|
|
89
|
+
variant="unstyled"
|
|
90
|
+
asChild
|
|
88
91
|
className="text-sm text-center text-black no-underline hover:text-gray-500 whitespace-nowrap"
|
|
89
|
-
|
|
92
|
+
aria-label={links?.label}>
|
|
90
93
|
{links?.label}
|
|
91
94
|
</Button>
|
|
92
95
|
</li>
|
|
@@ -98,7 +101,9 @@ function SocialMediaContainer({ socialMedia }: { socialMedia?: SocialLink[] }) {
|
|
|
98
101
|
|
|
99
102
|
return (
|
|
100
103
|
<Flex wrap justify="center" align="center" className="gap-5">
|
|
101
|
-
{socialMedia?.map((social, index) =>
|
|
104
|
+
{socialMedia?.map((social, index) => (
|
|
105
|
+
<SocialMediaLink social={social} key={index} />
|
|
106
|
+
))}
|
|
102
107
|
</Flex>
|
|
103
108
|
);
|
|
104
109
|
}
|
|
@@ -130,23 +135,23 @@ function SocialMediaLink({ social }: { social?: SocialLink }) {
|
|
|
130
135
|
|
|
131
136
|
function BorderStyle() {
|
|
132
137
|
return (
|
|
133
|
-
<
|
|
134
|
-
<
|
|
138
|
+
<Flex className="w-full">
|
|
139
|
+
<Flex className="w-1/3">
|
|
135
140
|
<div className="w-1/3 py-1 bg-secondary" />
|
|
136
141
|
<div className="w-1/3 py-1 bg-primary" />
|
|
137
142
|
<div className="w-1/3 py-1 bg-primary" />
|
|
138
|
-
</
|
|
139
|
-
<
|
|
143
|
+
</Flex>
|
|
144
|
+
<Flex className="w-1/3">
|
|
140
145
|
<div className="w-1/3 py-1 bg-secondary" />
|
|
141
146
|
<div className="w-1/3 py-1 bg-primary" />
|
|
142
147
|
<div className="w-1/3 py-1 bg-primary" />
|
|
143
|
-
</
|
|
144
|
-
<
|
|
148
|
+
</Flex>
|
|
149
|
+
<Flex className="w-1/3">
|
|
145
150
|
<div className="w-1/3 py-1 bg-secondary" />
|
|
146
151
|
<div className="w-1/3 py-1 bg-primary" />
|
|
147
152
|
<div className="w-1/3 py-1 bg-primary" />
|
|
148
|
-
</
|
|
149
|
-
</
|
|
153
|
+
</Flex>
|
|
154
|
+
</Flex>
|
|
150
155
|
);
|
|
151
156
|
}
|
|
152
157
|
|
package/src/footer_d.tsx
CHANGED
|
@@ -6,7 +6,6 @@ import { Link } from "@stackshift-ui/link";
|
|
|
6
6
|
import { Section } from "@stackshift-ui/section";
|
|
7
7
|
import { SocialIcons } from "@stackshift-ui/social-icons";
|
|
8
8
|
import { Text } from "@stackshift-ui/text";
|
|
9
|
-
|
|
10
9
|
import { FooterProps } from ".";
|
|
11
10
|
import { logoLink } from "./helper";
|
|
12
11
|
import { Logo, SocialLink, Socials } from "./types";
|
|
@@ -21,29 +20,29 @@ export default function Footer_D({
|
|
|
21
20
|
return (
|
|
22
21
|
<Section className="py-20 overflow-hidden bg-background">
|
|
23
22
|
<Container maxWidth={1280}>
|
|
24
|
-
<
|
|
23
|
+
<Flex className="flex-col lg:flex-row w-full gap-5 lg:items-center lg:justify-between xl:items-start">
|
|
25
24
|
<div className="w-full lg:max-w-sm xl:max-w-xs space-y-4">
|
|
26
25
|
<LogoSection logo={logo} />
|
|
27
26
|
<TextSection text={text} />
|
|
28
27
|
</div>
|
|
29
28
|
|
|
30
|
-
<
|
|
31
|
-
<
|
|
29
|
+
<Flex className="flex-col space-y-8 lg:space-y-0">
|
|
30
|
+
<Flex className=" flex-col lg:flex-row w-full justify-between items-start lg:items-center">
|
|
32
31
|
<MenuSection multipleMenus={multipleMenus} />
|
|
33
|
-
</
|
|
34
|
-
</
|
|
32
|
+
</Flex>
|
|
33
|
+
</Flex>
|
|
35
34
|
|
|
36
35
|
<div className="hidden [@media(min-width:1444px)]:block">
|
|
37
36
|
<SocialMediaContainer socialMedia={socialMedia} />
|
|
38
37
|
</div>
|
|
39
|
-
</
|
|
38
|
+
</Flex>
|
|
40
39
|
<div className="hidden [@media(min-width:1444px)]:block items-center">
|
|
41
40
|
<CopyrightSection copyright={copyright} />
|
|
42
41
|
</div>
|
|
43
|
-
<
|
|
42
|
+
<Flex className="flex-col sm:flex-row w-full sm:items-center sm:justify-between pt-10 gap-5 [@media(min-width:1444px)]:hidden">
|
|
44
43
|
<CopyrightSection copyright={copyright} />
|
|
45
44
|
<SocialMediaContainer socialMedia={socialMedia} />
|
|
46
|
-
</
|
|
45
|
+
</Flex>
|
|
47
46
|
</Container>
|
|
48
47
|
</Section>
|
|
49
48
|
);
|
|
@@ -90,7 +89,9 @@ function MenuSection({ multipleMenus }: { multipleMenus?: any[] }) {
|
|
|
90
89
|
|
|
91
90
|
return (
|
|
92
91
|
<div className="flex flex-col sm:flex-row flex-wrap gap-5">
|
|
93
|
-
{multipleMenus?.map(menu =>
|
|
92
|
+
{multipleMenus?.map(menu => (
|
|
93
|
+
<MenuLinks key={menu?._key} menu={menu} />
|
|
94
|
+
))}
|
|
94
95
|
</div>
|
|
95
96
|
);
|
|
96
97
|
}
|
|
@@ -112,8 +113,10 @@ function MenuLinks({ menu }: { menu?: any }) {
|
|
|
112
113
|
<Button
|
|
113
114
|
as="link"
|
|
114
115
|
link={link}
|
|
115
|
-
|
|
116
|
-
|
|
116
|
+
variant="unstyled"
|
|
117
|
+
className="text-gray-500 no-underline hover:text-gray-700 px-0 py-0"
|
|
118
|
+
aria-label={link?.label}
|
|
119
|
+
asChild>
|
|
117
120
|
{link?.label}
|
|
118
121
|
</Button>
|
|
119
122
|
</li>
|
package/src/helper/index.tsx
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Link } from "@stackshift-ui/link";
|
|
2
|
+
import { ConditionalLinkTypes, Logo } from "../types";
|
|
2
3
|
|
|
3
4
|
// Logo link
|
|
4
5
|
export const logoLink = (logo: Logo) => {
|
|
@@ -13,3 +14,118 @@ export const logoLink = (logo: Logo) => {
|
|
|
13
14
|
return "/";
|
|
14
15
|
}
|
|
15
16
|
};
|
|
17
|
+
|
|
18
|
+
export const ConditionalLink = ({
|
|
19
|
+
className,
|
|
20
|
+
ariaLabel,
|
|
21
|
+
style = {},
|
|
22
|
+
children,
|
|
23
|
+
link,
|
|
24
|
+
target,
|
|
25
|
+
}: ConditionalLinkTypes) => {
|
|
26
|
+
const defaultStyle =
|
|
27
|
+
"inline-block py-2 px-6 rounded-l-xl rounded-t-xl bg-primary hover:bg-primary-foreground text-gray-50 font-bold leading-loose outline-none transition duration-200";
|
|
28
|
+
|
|
29
|
+
if (!link?.internalLink && !link?.externalLink) {
|
|
30
|
+
return (
|
|
31
|
+
<a
|
|
32
|
+
className={className ?? defaultStyle}
|
|
33
|
+
aria-label={ariaLabel}
|
|
34
|
+
//style={style}
|
|
35
|
+
target={target}
|
|
36
|
+
href="/page-not-found">
|
|
37
|
+
{children}
|
|
38
|
+
</a>
|
|
39
|
+
);
|
|
40
|
+
} else if (
|
|
41
|
+
(link?.type === "linkInternal" || link.linkType === "linkInternal") &&
|
|
42
|
+
// link?.internalLink?.toLowerCase()?.includes("home")
|
|
43
|
+
link?.internalLink?.toLowerCase() === "home"
|
|
44
|
+
) {
|
|
45
|
+
return (
|
|
46
|
+
<Link
|
|
47
|
+
href={link?.referenceType === "projects" ? "/projects" : "/"}
|
|
48
|
+
aria-label={ariaLabel}
|
|
49
|
+
className={className ?? defaultStyle}
|
|
50
|
+
//style={style}
|
|
51
|
+
target={target}>
|
|
52
|
+
{children}
|
|
53
|
+
</Link>
|
|
54
|
+
);
|
|
55
|
+
} else if (link?.type === "linkInternal" || link?.linkType === "linkInternal") {
|
|
56
|
+
let hrefPath = "";
|
|
57
|
+
|
|
58
|
+
switch (link?.referenceType) {
|
|
59
|
+
case "projects":
|
|
60
|
+
hrefPath = `/projects/${link?.internalLink}`;
|
|
61
|
+
break;
|
|
62
|
+
case "commercial":
|
|
63
|
+
hrefPath = `/projects/commercial/${link?.internalLink}`;
|
|
64
|
+
break;
|
|
65
|
+
case "residential":
|
|
66
|
+
hrefPath = `/projects/residential/${link?.internalLink}`;
|
|
67
|
+
break;
|
|
68
|
+
case "landscape":
|
|
69
|
+
hrefPath = `/projects/landscape/${link?.internalLink}`;
|
|
70
|
+
break;
|
|
71
|
+
case "public":
|
|
72
|
+
hrefPath = `/projects/public/${link?.internalLink}`;
|
|
73
|
+
break;
|
|
74
|
+
case "teaching":
|
|
75
|
+
hrefPath = `/projects/teaching/${link?.internalLink}`;
|
|
76
|
+
break;
|
|
77
|
+
case "designInMotion":
|
|
78
|
+
hrefPath = `/projects/future-projects/${link?.internalLink}`;
|
|
79
|
+
break;
|
|
80
|
+
case "renovation":
|
|
81
|
+
hrefPath = `/projects/residential/renovation/${link?.internalLink}`;
|
|
82
|
+
break;
|
|
83
|
+
case "newConstruction":
|
|
84
|
+
hrefPath = `/projects/residential/new-construction/${link?.internalLink}`;
|
|
85
|
+
break;
|
|
86
|
+
case "ourTeam":
|
|
87
|
+
hrefPath = `/our-team/${link?.internalLink}`;
|
|
88
|
+
break;
|
|
89
|
+
case "recognition":
|
|
90
|
+
hrefPath = `/recognition/${link?.internalLink}`;
|
|
91
|
+
break;
|
|
92
|
+
|
|
93
|
+
default:
|
|
94
|
+
hrefPath = `/${link?.internalLink}`;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
return (
|
|
98
|
+
<Link
|
|
99
|
+
href={hrefPath}
|
|
100
|
+
aria-label={ariaLabel}
|
|
101
|
+
className={className ?? defaultStyle}
|
|
102
|
+
//style={style}
|
|
103
|
+
target={target}>
|
|
104
|
+
{children}
|
|
105
|
+
</Link>
|
|
106
|
+
);
|
|
107
|
+
} else if (link?.type === "linkExternal" || link?.linkType === "linkExternal") {
|
|
108
|
+
return (
|
|
109
|
+
<a
|
|
110
|
+
aria-label={ariaLabel}
|
|
111
|
+
className={className ?? defaultStyle}
|
|
112
|
+
//style={style}
|
|
113
|
+
href={link?.externalLink ?? ""}
|
|
114
|
+
target={target}
|
|
115
|
+
rel={link?.linkTarget === "_blank" ? "noopener noreferrer" : undefined}>
|
|
116
|
+
{children}
|
|
117
|
+
</a>
|
|
118
|
+
);
|
|
119
|
+
} else {
|
|
120
|
+
return (
|
|
121
|
+
<Link
|
|
122
|
+
href="/"
|
|
123
|
+
aria-label={ariaLabel}
|
|
124
|
+
className={className ?? defaultStyle}
|
|
125
|
+
//style={style}
|
|
126
|
+
target={target}>
|
|
127
|
+
{children}
|
|
128
|
+
</Link>
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
};
|