Skip to content

Commit

Permalink
fix: Resolved issues with server components
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-crowell committed Jun 17, 2024
1 parent fdfa650 commit 0df2e65
Show file tree
Hide file tree
Showing 9 changed files with 883 additions and 60 deletions.
27 changes: 27 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,32 @@
import doob from '@do-ob/eslint-config';
import react from 'eslint-plugin-react';
import reactHooks from 'eslint-plugin-react-hooks';

export default [
...doob.configs.recommended,
{
files: [ '**/*.{jsx,tsx}' ],
plugins: {
react,
},
languageOptions: {
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
},
rules: {
...react.configs.recommended.rules,
'react/react-in-jsx-scope': 'off',
},
},
{
plugins: {
'react-hooks': reactHooks,
},
rules: {
...reactHooks.configs.recommended.rules,
},
}
];
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@
"autoprefixer": "^10.4.19",
"cssnano": "^7.0.2",
"eslint": "^9.2.0",
"eslint-plugin-next": "^0.0.0",
"eslint-plugin-react": "^7.34.2",
"eslint-plugin-react-hooks": "^4.6.2",
"framer-motion": "^11.2.10",
"postcss": "^8.4.38",
"react": "18.3.1",
Expand Down
37 changes: 19 additions & 18 deletions packages/ui/src/components/Navigation/NavigationExtended.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,33 @@ import { NavigationPart_Brand } from './parts/NavigationPart_Brand';
import { NavigationPart_Links } from './parts/NavigationPart_Links';
import { NavigationPart_Actions } from './parts/NavigationPart_Actions';
import { NavigationProvider } from './data/NavigationProvider';
import { twColors } from '@do-ob/ui/utility';

export function NavigationExtended(props: NavigationProps) {

const colors = twColors(props.color);

return (
<NavigationProvider {...props}>
{({ color, colors, className }) => (
<Navbar
className={clmg(clsx(color && colors, 'relative border-b-1 border-b-foreground-200/50', className))}
height="4rem"
>
<NavbarContent justify="start">
<NavigationPart_Brand />
</NavbarContent>
<Navbar
className={clmg(clsx(props.color && colors, 'relative border-b-1 border-b-foreground-200/50', props.className))}
height="4rem"
>
<NavbarContent justify="start">
<NavigationPart_Brand />
</NavbarContent>

<NavbarContent justify="start">
<NavigationPart_Links />
</NavbarContent>
<NavbarContent justify="start">
<NavigationPart_Links />
</NavbarContent>

<NavbarContent justify="end">
<div className="max-w-64">
<NavigationPart_Actions />
</div>
</NavbarContent>
<NavbarContent justify="end">
<div className="max-w-64">
<NavigationPart_Actions />
</div>
</NavbarContent>

</Navbar>
)}
</Navbar>
</NavigationProvider>
);
}
31 changes: 16 additions & 15 deletions packages/ui/src/components/Navigation/NavigationIsland.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,27 @@ import { NavigationProvider } from './data/NavigationProvider';
import { NavigationPart_Brand } from './parts/NavigationPart_Brand';
import { NavigationPart_Links } from './parts/NavigationPart_Links';
import { NavigationPart_Actions } from './parts/NavigationPart_Actions';
import { twColors } from '@do-ob/ui/utility';

export function NavigationIsland(props: NavigationProps) {

const colors = twColors(props.color);

return (
<NavigationProvider {...props}>
{({ color, colors, className }) => (
<Navbar className="items-center justify-center bg-transparent backdrop-blur-none backdrop-filter-none" height="5rem">
<NavbarContent justify="start" className="flex items-center">
<NavigationPart_Brand />
</NavbarContent>
<NavbarContent justify="center">
<div className={clmg(clsx(color && colors, 'flex rounded-full border-1 border-foreground-200/50 px-4', className))}>
<NavigationPart_Links />
</div>
</NavbarContent>
<NavbarContent justify="end">
<NavigationPart_Actions />
</NavbarContent>
</Navbar>
)}
<Navbar className="items-center justify-center bg-transparent backdrop-blur-none backdrop-filter-none" height="5rem">
<NavbarContent justify="start" className="flex items-center">
<NavigationPart_Brand />
</NavbarContent>
<NavbarContent justify="center">
<div className={clmg(clsx(props.color && colors, 'flex rounded-full border-1 border-foreground-200/50 px-4', props.className))}>
<NavigationPart_Links />
</div>
</NavbarContent>
<NavbarContent justify="end">
<NavigationPart_Actions />
</NavbarContent>
</Navbar>
</NavigationProvider>
);
}
38 changes: 20 additions & 18 deletions packages/ui/src/components/Navigation/NavigationStandard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,33 @@ import { NavigationProvider } from './data/NavigationProvider';
import { NavigationPart_Brand } from './parts/NavigationPart_Brand';
import { NavigationPart_Links } from './parts/NavigationPart_Links';
import { NavigationPart_Actions } from './parts/NavigationPart_Actions';
import { twColors } from '@do-ob/ui/utility';

export function NavigationStandard(props: NavigationProps) {

const colors = twColors(props.color);

return (
<NavigationProvider {...props}>
{({ color, colors, className }) => (
<Navbar
className={clmg(clsx(color && colors, 'border-b-1 border-b-foreground-200/50', className))}
height="4rem"
>
<NavbarContent justify="start">
<NavigationPart_Brand />
</NavbarContent>
<Navbar
className={clmg(clsx(props.color && colors, 'border-b-1 border-b-foreground-200/50', props.className))}
height="4rem"
>
<NavbarContent justify="start">
<NavigationPart_Brand />
</NavbarContent>

<NavbarContent justify="center">
<NavigationPart_Links />
</NavbarContent>
<NavbarContent justify="center">
<NavigationPart_Links />
</NavbarContent>

<NavbarContent justify="end">
<div className="max-w-64">
<NavigationPart_Actions />
</div>
</NavbarContent>
<NavbarContent justify="end">
<div className="max-w-64">
<NavigationPart_Actions />
</div>
</NavbarContent>

</Navbar>
)}
</Navbar>
</NavigationProvider>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@ export interface NavigationContextProps extends NavigationProps {
/**
* Default properties for the do-ob ui context
*/
export const NavigationProps: NavigationContextProps = {
export const navigationContextProps: NavigationContextProps = {
colors: [ '', '', '' ],
};

/**
* The do-ob user interface (ui) context
*/
export const NavigationContext = createContext<NavigationContextProps>(NavigationProps);
export const NavigationContext = createContext<NavigationContextProps>(navigationContextProps);
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
'use client';

import { twColors } from '@do-ob/ui/utility';
import { NavigationContext, NavigationContextProps, NavigationProps } from './NavigationContext';

export interface NavigationProviderProps extends NavigationProps {
children: ((props: NavigationContextProps) => React.ReactNode )| React.ReactNode;
}
import { NavigationContext, NavigationProps } from './NavigationContext';
import { PropsWithChildren } from 'react';

export function NavigationProvider({
children,
...props
}: NavigationProviderProps) {
}: PropsWithChildren<NavigationProps>) {

const value = {
...props,
Expand All @@ -19,7 +16,7 @@ export function NavigationProvider({

return (
<NavigationContext.Provider value={value}>
{typeof children === 'function' ? children(value) : children}
{children}
</NavigationContext.Provider>
);
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import { ThemeButton, SearchButton } from '@do-ob/ui/components';
import { SocialIcons } from '@do-ob/ui/icons';
import { Link, Button, Divider } from '@nextui-org/react';
Expand Down
Loading

0 comments on commit 0df2e65

Please sign in to comment.