Skip to content

Commit

Permalink
Merge pull request #976 from contentful/development
Browse files Browse the repository at this point in the history
release@next
  • Loading branch information
chasepoirier authored Feb 4, 2025
2 parents 0d21a1f + 5bea055 commit ed279b2
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 34 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';

import React, { useState } from 'react';
import React from 'react';
import { usePathname } from 'next/navigation';
import Link from 'next/link';
import { Menu } from 'antd';
Expand All @@ -13,27 +13,20 @@ const items = [
},
{
key: '/about',
label: <Link href="/about">About</Link>,
label: 'About',
},
{
key: '/contact',
label: <Link href="/contact">Contact</Link>,
label: 'Contact',
},
];

const FooterNav: React.FC = () => {
const pathname = usePathname();
const [current, setCurrent] = useState(pathname);

return (
<div className={styles.nav}>
<Menu
onClick={(e) => setCurrent(e.key)}
selectedKeys={[current]}
mode="horizontal"
className={styles.menu}
items={items}
/>
<Menu selectedKeys={[pathname]} mode="horizontal" className={styles.menu} items={items} />
</div>
);
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';

import React, { useState } from 'react';
import React from 'react';
import { usePathname } from 'next/navigation';
import Link from 'next/link';
import { Button, Grid, Menu } from 'antd';
Expand All @@ -14,29 +14,27 @@ const items = [
},
{
key: '/about',
label: <Link href="/about">About</Link>,
label: 'About',
},
];

const mobileItems = [
...items,
{
key: '/contact',
label: <Link href="/contact">Contact</Link>,
label: 'Contact',
},
];

const Nav: React.FC = () => {
const pathname = usePathname();
const [current, setCurrent] = useState(pathname);
const screens = Grid.useBreakpoint();

if (screens.xs) {
return (
<div className={styles.nav}>
<Menu
onClick={(e) => setCurrent(e.key)}
selectedKeys={[current]}
selectedKeys={[pathname]}
mode="horizontal"
className={styles.mobileMenu}
items={mobileItems}
Expand All @@ -52,16 +50,8 @@ const Nav: React.FC = () => {

return (
<div className={styles.nav}>
<Menu
onClick={(e) => setCurrent(e.key)}
selectedKeys={[current]}
mode="horizontal"
className={styles.menu}
items={items}
/>
<Link href="/contact">
<Button variant="outlined">Contact Us</Button>
</Link>
<Menu selectedKeys={[pathname]} mode="horizontal" className={styles.menu} items={items} />
<Button variant="outlined">Contact Us</Button>
</div>
);
};
Expand Down
22 changes: 15 additions & 7 deletions packages/validators/src/schemas/v2023_09_28/experience.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,17 +86,22 @@ const ComponentValueSchema = z
})
.strict();

// TODO: finalize schema structure before release
// https://contentful.atlassian.net/browse/LUMOS-523
const EmptyObjectSchema = z.object({ type: z.undefined() });

const ComponentPropertyValueSchema = z.discriminatedUnion('type', [
DesignValueSchema,
BoundValueSchema,
UnboundValueSchema,
HyperlinkValueSchema,
ComponentValueSchema,
EmptyObjectSchema,
]);

export type ComponentPropertyValue = z.infer<typeof ComponentPropertyValueSchema>;

// TODO: finalized schema structure before release
// TODO: finalize schema structure before release
// https://contentful.atlassian.net/browse/LUMOS-523
const VariableMappingSchema = z.object({
patternPropertyDefinitionId: propertyKeySchema,
Expand All @@ -106,13 +111,16 @@ const VariableMappingSchema = z.object({

const VariableMappingsSchema = z.record(propertyKeySchema, VariableMappingSchema);

// TODO: finalized schema structure before release
// TODO: finalize schema structure before release
// https://contentful.atlassian.net/browse/LUMOS-523
const PatternPropertyDefinitionSchema = z.object({
defaultValue: z.object({
path: z.string(),
type: z.literal('BoundValue'),
}),
defaultValue: z.union([
z.object({
path: z.string(),
type: z.literal('BoundValue'),
}),
z.null(),
]),
contentTypes: z.record(z.string(), z.any()),
});

Expand All @@ -121,7 +129,7 @@ const PatternPropertyDefinitionsSchema = z.record(
PatternPropertyDefinitionSchema,
);

// TODO: finalized schema structure before release
// TODO: finalize schema structure before release
// https://contentful.atlassian.net/browse/LUMOS-523
const PatternPropertySchema = z.object({
type: z.literal('BoundValue'),
Expand Down

0 comments on commit ed279b2

Please sign in to comment.