Skip to content

Commit 7412779

Browse files
feat: updated to latest version
1 parent 29b4a1e commit 7412779

File tree

6 files changed

+47
-65
lines changed

6 files changed

+47
-65
lines changed

apps/api-harmonization/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"@dxp/blocks.quick-links": "^0.1.1",
3333
"@dxp/configs.integrations": "*",
3434
"@dxp/framework": "^0.2.1",
35-
"@dxp/integrations.mocked": "^0.4.1",
35+
"@dxp/integrations.mocked": "^0.4.3",
3636
"@dxp/utils.api-harmonization": "^0.0.5",
3737
"@nestjs/axios": "^4.0.0",
3838
"@nestjs/common": "^11.1.1",

apps/frontend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"@dxp/blocks.pricing-section": "^0.1.2",
2525
"@dxp/blocks.quick-links": "^0.1.1",
2626
"@dxp/framework": "^0.2.1",
27-
"@dxp/integrations.mocked": "^0.4.1",
27+
"@dxp/integrations.mocked": "^0.4.3",
2828
"@dxp/ui": "*",
2929
"class-variance-authority": "^0.7.1",
3030
"date-fns": "^4.1.0",

apps/frontend/src/containers/Header/DesktopNavigation/DesktopNavigation.tsx

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,24 +28,36 @@ export function DesktopNavigation({ logoSlot, localeSlot, items }: DesktopNaviga
2828
const itemClassNames =
2929
'data-active:bg-transparent data-active:underline underline-offset-4 hover:!bg-transparent hover:underline';
3030

31+
// Find all path segments from the current pathname
32+
const pathSegments = pathname
33+
.split('/')
34+
.filter(Boolean)
35+
.map((_segment, index, segments) => '/' + segments.slice(0, index + 1).join('/'));
36+
37+
// Add root path if not already included
38+
if (!pathSegments.includes('/')) {
39+
pathSegments.unshift('/');
40+
}
41+
42+
// Find the active navigation group that matches the deepest path segment
3143
const activeNavigationGroup = items.find((item) => {
3244
if (item.__typename === 'NavigationGroup') {
3345
if (item.url) {
34-
return item.url && pathname.startsWith(item.url);
46+
return pathSegments.includes(item.url);
3547
}
3648

3749
return item.items
3850
.filter((item) => item.__typename === 'NavigationItem')
3951
.some((item) => {
4052
if (pathname !== '/') {
41-
return item.url !== '/' && item.url && pathname.startsWith(item.url);
53+
return item.url !== '/' && item.url && pathSegments.includes(item.url);
4254
}
4355

44-
return item.url && pathname.startsWith(item.url);
56+
return item.url && pathSegments.includes(item.url);
4557
});
4658
}
4759

48-
return item.url && pathname.includes(item.url);
60+
return item.url && pathSegments.includes(item.url);
4961
});
5062

5163
const navigationItemClass = cn(navigationMenuTriggerStyle(), '!text-sm', itemClassNames);
@@ -155,23 +167,25 @@ export function DesktopNavigation({ logoSlot, localeSlot, items }: DesktopNaviga
155167
<NavigationItem
156168
item={item}
157169
key={item.label}
158-
active={activeNavigationGroup?.url === item.url}
170+
active={item.url ? pathSegments.includes(item.url) : false}
159171
className={cn(itemClassNames, 'hover:!text-navbar-primary')}
160172
/>
161173
);
162-
case 'NavigationGroup':
174+
case 'NavigationGroup': {
175+
const url = getUrl(item);
163176
return (
164177
<NavigationItem
165178
item={{
166179
label: item.title,
167-
url: getUrl(item),
180+
url: url,
168181
__typename: 'NavigationItem',
169182
}}
170183
key={item.title}
171-
active={activeNavigationGroup?.url === getUrl(item)}
184+
active={url ? pathSegments.includes(url) : false}
172185
className={cn(itemClassNames, 'hover:!text-navbar-primary')}
173186
/>
174187
);
188+
}
175189
}
176190
})}
177191
</NavigationMenuList>
@@ -202,7 +216,7 @@ export function DesktopNavigation({ logoSlot, localeSlot, items }: DesktopNaviga
202216
<NavigationItem
203217
item={item}
204218
key={item.label}
205-
active={pathname === item.url}
219+
active={item.url ? pathSegments.includes(item.url) : false}
206220
className="!text-sm !text-navbar-sub-foreground hover:!text-navbar-sub-foreground"
207221
/>
208222
);

package-lock.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/configs/integrations/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
},
1818
"dependencies": {
1919
"@dxp/framework": "^0.2.1",
20-
"@dxp/integrations.mocked": "^0.4.1",
20+
"@dxp/integrations.mocked": "^0.4.3",
2121
"@dxp/integrations.strapi-cms": "^0.3.0"
2222
},
2323
"devDependencies": {

packages/ui/src/theme.css

Lines changed: 15 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
:root {
22
--background: hsl(0 0% 100%);
33
--foreground: hsl(225 9% 9%);
4-
--card: hsl(220 13% 95%);
5-
--card-foreground: hsl(240 10% 4%);
4+
--card: hsl(0, 0%, 100%);
5+
--card-foreground: hsl(0, 0%, 100%);
66
--popover: hsl(0 0% 100%);
77
--popover-foreground: hsl(240 10% 4%);
8-
--primary: hsl(228 66% 50%);
8+
--primary: hsl(114 95.2% 32.4%);
99
--primary-foreground: hsl(0 0% 100%);
10-
--secondary: hsl(228 71% 91%);
10+
--secondary: hsla(114, 95%, 32%, 0.1);
1111
--secondary-foreground: hsl(0 0% 0%);
1212
--muted: hsl(232 12% 87%);
1313
--muted-foreground: hsl(217 19% 27%);
14-
--accent: hsl(214 95% 93%);
14+
--accent: hsl(115, 94%, 93%);
1515
--accent-foreground: hsl(240 6% 10%);
1616
--destructive: hsl(346 100% 41%);
1717
--destructive-foreground: hsl(0 0% 100%);
@@ -33,65 +33,33 @@
3333
--sidebar-accent-foreground: hsl(240 6% 10%);
3434
--sidebar-border: hsl(220 13% 91%);
3535
--sidebar-ring: hsl(240 5% 65%);
36-
--navbar-background: hsl(234 25% 92%);
36+
--navbar-background: hsl(0 100% 100%);
3737
--navbar-foreground: hsl(215 28% 17%);
38-
--navbar-primary: hsl(228 100% 19%);
38+
--navbar-primary: hsl(0 0% 0%);
3939
--navbar-primary-foreground: hsl(0 0% 100%);
4040
--navbar-border: hsl(232 12% 87%);
41-
--navbar-muted: hsl(228 100% 19%);
42-
--navbar-accent-background: hsl(214 95% 93%);
41+
--navbar-muted: hsl(217 19% 27%);
42+
--navbar-accent-background: hsl(125, 94%, 93%);
4343
--navbar-accent-foreground: hsl(224 64% 33%);
44-
--navbar-sub-background: hsl(228 32% 15%);
45-
--navbar-sub-foreground: hsl(0 0% 100%);
44+
--navbar-sub-background: hsl(0 0% 100%);
45+
--navbar-sub-foreground: hsl(0 0% 0%);
4646
--navbar-sub-accent: hsl(228 96% 29%);
47-
--footer-background: hsl(234 25% 92%);
48-
--footer-foreground: hsl(228 100% 19%);
47+
--footer-background: hsl(240 4.8% 95.9%);
48+
--footer-foreground: hsl(0, 0%, 0%);
4949
--footer-muted: hsl(240 2% 20%);
5050
--footer-border: hsl(230 6% 81%);
51-
--navbar-sub-muted: hsl(228 78% 35%);
51+
--navbar-sub-muted: hsl(0, 0%, 0%);
5252
--tertiary: hsl(0 0% 100%);
5353
--tertiary-foreground: hsl(228 100% 19%);
5454
--tertiary-border: hsl(230 6% 81%);
55-
--badge-default-background: hsl(186 100% 28%);
55+
--badge-default-background: hsl(31 100% 63.9%);
5656
--badge-secondary-background: hsl(31 97% 72%);
5757
--badge-default-foreground: hsl(0 0% 100%);
5858
--badge-secondary-foreground: hsl(0 0% 0%);
5959
--tertiary-hover: hsl(220 13% 95%);
6060
}
6161

6262
.theme-personal {
63-
--background: hsl(0 0% 100%);
64-
--foreground: hsl(225 9% 9%);
65-
--card: hsl(0, 0%, 100%);
66-
--card-foreground: hsl(0, 0%, 100%);
67-
--popover: hsl(0 0% 100%);
68-
--popover-foreground: hsl(240 10% 4%);
69-
--primary: hsl(114 95.2% 32.4%);
70-
--primary-foreground: hsl(0 0% 100%);
71-
--secondary: hsla(114, 95%, 32%, 0.1);
72-
--secondary-foreground: hsl(0 0% 0%);
73-
--success: hsl(141 71% 48%);
74-
--accent: hsl(115, 94%, 93%);
75-
--accent-foreground: hsl(240 6% 10%);
76-
--muted: hsl(232 12% 87%);
77-
--muted-foreground: hsl(217 19% 27%);
78-
--navbar-background: hsl(0 100% 100%);
79-
--navbar-foreground: hsl(215 28% 17%);
80-
--navbar-primary: hsl(0 0% 0%);
81-
--navbar-primary-foreground: hsl(0 0% 100%);
82-
--navbar-border: hsl(232 12% 87%);
83-
--navbar-muted: hsl(217 19% 27%);
84-
--navbar-accent-background: hsl(125, 94%, 93%);
85-
--navbar-accent-foreground: hsl(224 64% 33%);
86-
--navbar-sub-background: hsl(0 0% 100%);
87-
--navbar-sub-foreground: hsl(0 0% 0%);
88-
--navbar-sub-accent: hsl(0 0% 100%);
89-
--navbar-sub-muted: hsl(0, 0%, 0%);
90-
--footer-background: hsl(240 4.8% 95.9%);
91-
--footer-foreground: hsl(0, 0%, 0%);
92-
--footer-muted: hsl(240 2% 20%);
93-
--footer-border: hsl(230 6% 81%);
94-
--badge-default-background: hsl(31 100% 63.9%);
9563
}
9664

9765
.theme-business {

0 commit comments

Comments
 (0)